Skip to content

Commit

Permalink
Check if new api is available
Browse files Browse the repository at this point in the history
  • Loading branch information
yury authored and Carlos Cabanero committed Nov 14, 2017
1 parent 05af591 commit 0357255
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 7 additions & 2 deletions Blink/SpaceController.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,13 @@ - (void)loadView
[_viewportsController.view setTranslatesAutoresizingMaskIntoConstraints:NO];

// Support new top & bottom guides (and fixes the notch)
_topConstraint = [_viewportsController.view.topAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.topAnchor];
_bottomConstraint = [_viewportsController.view.bottomAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.bottomAnchor];
if (@available(iOS 11, *)) {
_topConstraint = [_viewportsController.view.topAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.topAnchor];
_bottomConstraint = [_viewportsController.view.bottomAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.bottomAnchor];
} else {
_topConstraint = [_viewportsController.view.topAnchor constraintEqualToAnchor:self.view.topAnchor];
_bottomConstraint = [_viewportsController.view.bottomAnchor constraintEqualToAnchor:self.bottomLayoutGuide.bottomAnchor];
}

// Container view fills out entire root view.
[NSLayoutConstraint activateConstraints:
Expand Down
4 changes: 3 additions & 1 deletion Settings/ViewControllers/Settings/BKSettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ - (void)viewDidLoad

// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
self.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeAlways;
if (@available(iOS 11, *)) {
self.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeAlways;
}
}

- (void)viewWillAppear:(BOOL)animated
Expand Down

0 comments on commit 0357255

Please sign in to comment.