local Tabman to fix inset issues (#923)

This commit is contained in:
Ryan Nystrom
2017-11-11 21:53:12 -05:00
committed by GitHub
parent 9c1fe7eabf
commit 00414833fd
143 changed files with 13186 additions and 2365 deletions

View File

@@ -64,7 +64,9 @@ NewIssueTableViewControllerDelegate {
makeBackBarItemEmpty()
// automaticallyAdjustsChildScrollViewInsets = false
dataSource = self
delegate = self
bar.items = controllers.map { Item(title: $0.title ?? "" ) }
bar.appearance = TabmanBar.Appearance({ appearance in
appearance.text.font = Styles.Fonts.button
@@ -77,13 +79,6 @@ NewIssueTableViewControllerDelegate {
navigationItem.configure(title: repo.name, subtitle: repo.owner)
}
override func viewSafeAreaInsetsDidChange() {
if #available(iOS 11.0, *) {
super.viewSafeAreaInsetsDidChange()
}
setNeedsScrollViewInsetUpdate()
}
// MARK: Private API
var repoUrl: URL {
@@ -156,4 +151,37 @@ NewIssueTableViewControllerDelegate {
show(issuesViewController, sender: self)
}
// MARK: PageboyViewControllerDelegate
// override func pageboyViewController(
// _ pageboyViewController: PageboyViewController,
// willScrollToPageAt index: PageboyViewController.PageIndex,
// direction: PageboyViewController.NavigationDirection,
// animated: Bool
// ) {
// super.pageboyViewController(
// pageboyViewController,
// willScrollToPageAt: index,
// direction: direction,
// animated: animated
// )
//
// return
//
// // hack to fix Tabman not applying top (nav bar) and bottom (tab bar) insets simultaneously
// var inset: UIEdgeInsets
// if #available(iOS 11.0, *) {
// inset = view.safeAreaInsets
// } else {
// inset = UIEdgeInsets(top: topLayoutGuide.length, left: 0, bottom: bottomLayoutGuide.length, right: 0)
// }
// inset.top += bar.requiredInsets.bar
// for view in controllers[index].view.subviews {
// if let scrollView = view as? UIScrollView {
// scrollView.contentInset = inset
// scrollView.scrollIndicatorInsets = inset
// }
// }
// }
}