diff --git a/Classes/Repository/RepositoryIssuesViewController.swift b/Classes/Repository/RepositoryIssuesViewController.swift index 51cfbb59..859bd1c9 100644 --- a/Classes/Repository/RepositoryIssuesViewController.swift +++ b/Classes/Repository/RepositoryIssuesViewController.swift @@ -14,7 +14,9 @@ enum RepositoryIssuesType { case pullRequests } -class RepositoryIssuesViewController: BaseListViewController, BaseListViewControllerDataSource, SearchBarSectionControllerDelegate { +class RepositoryIssuesViewController: BaseListViewController, +BaseListViewControllerDataSource, +SearchBarSectionControllerDelegate { private var models = [ListDiffable]() private let repo: RepositoryDetails diff --git a/Classes/Repository/RepositoryViewController.swift b/Classes/Repository/RepositoryViewController.swift index d75a2fb4..000f88b4 100644 --- a/Classes/Repository/RepositoryViewController.swift +++ b/Classes/Repository/RepositoryViewController.swift @@ -71,11 +71,8 @@ NewIssueTableViewControllerDelegate { override func viewSafeAreaInsetsDidChange() { if #available(iOS 11.0, *) { super.viewSafeAreaInsetsDidChange() - } else { - // Fallback on earlier versions } setNeedsScrollViewInsetUpdate() - print("safe area insets changed") } // MARK: Private API diff --git a/Podfile b/Podfile index 21b4f44f..8c98417d 100644 --- a/Podfile +++ b/Podfile @@ -12,7 +12,7 @@ pod 'HTMLString', '~> 4.0.1' pod 'NYTPhotoViewer', '~> 1.1.0' pod 'SDWebImage/GIF', '~> 4.0.0' pod 'SnapKit', '~> 4.0.0' -pod 'Tabman', '1.0.1' +pod 'Tabman', '1.0.5' pod 'TUSafariActivity', '~> 1.0.0' pod 'SwiftLint' diff --git a/Podfile.lock b/Podfile.lock index 1ea0ce88..aef74614 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -32,7 +32,7 @@ PODS: - SnapKit (4.0.0) - SwiftLint (0.23.1) - SwipeCellKit (1.9.0) - - Tabman (1.0.1): + - Tabman (1.0.5): - Pageboy (~> 2.0.0) - PureLayout (~> 3.0.0) - TUSafariActivity (1.0.4) @@ -52,7 +52,7 @@ DEPENDENCIES: - SnapKit (~> 4.0.0) - SwiftLint - SwipeCellKit (from `Local Pods/SwipeCellKit`) - - Tabman (= 1.0.1) + - Tabman (= 1.0.5) - TUSafariActivity (~> 1.0.0) EXTERNAL SOURCES: @@ -91,9 +91,9 @@ SPEC CHECKSUMS: SnapKit: a42d492c16e80209130a3379f73596c3454b7694 SwiftLint: 1b670ce79284c76520f84060e87d645078fd32fa SwipeCellKit: c5199021f354565c955fe8e2f45f79d3b1713e41 - Tabman: 627b2bddc6c054bcd86c60919000c30c4adf2ec4 + Tabman: 9f87244fdbbd070fe6a518f445880b2b4a56ea1b TUSafariActivity: afc55a00965377939107ce4fdc7f951f62454546 -PODFILE CHECKSUM: 527cbfc893f5a36df17a5a6f114380a5ceccbab5 +PODFILE CHECKSUM: 4a864aaeb993f16d6af262e16552acdd76ae8b53 COCOAPODS: 1.4.0.beta.1 diff --git a/Pods/Manifest.lock b/Pods/Manifest.lock index 1ea0ce88..aef74614 100644 --- a/Pods/Manifest.lock +++ b/Pods/Manifest.lock @@ -32,7 +32,7 @@ PODS: - SnapKit (4.0.0) - SwiftLint (0.23.1) - SwipeCellKit (1.9.0) - - Tabman (1.0.1): + - Tabman (1.0.5): - Pageboy (~> 2.0.0) - PureLayout (~> 3.0.0) - TUSafariActivity (1.0.4) @@ -52,7 +52,7 @@ DEPENDENCIES: - SnapKit (~> 4.0.0) - SwiftLint - SwipeCellKit (from `Local Pods/SwipeCellKit`) - - Tabman (= 1.0.1) + - Tabman (= 1.0.5) - TUSafariActivity (~> 1.0.0) EXTERNAL SOURCES: @@ -91,9 +91,9 @@ SPEC CHECKSUMS: SnapKit: a42d492c16e80209130a3379f73596c3454b7694 SwiftLint: 1b670ce79284c76520f84060e87d645078fd32fa SwipeCellKit: c5199021f354565c955fe8e2f45f79d3b1713e41 - Tabman: 627b2bddc6c054bcd86c60919000c30c4adf2ec4 + Tabman: 9f87244fdbbd070fe6a518f445880b2b4a56ea1b TUSafariActivity: afc55a00965377939107ce4fdc7f951f62454546 -PODFILE CHECKSUM: 527cbfc893f5a36df17a5a6f114380a5ceccbab5 +PODFILE CHECKSUM: 4a864aaeb993f16d6af262e16552acdd76ae8b53 COCOAPODS: 1.4.0.beta.1 diff --git a/Pods/Tabman/README.md b/Pods/Tabman/README.md index bf57db86..88ed812e 100644 --- a/Pods/Tabman/README.md +++ b/Pods/Tabman/README.md @@ -23,7 +23,7 @@ - [x] Built on a powerful and informative page view controller, [Pageboy](https://github.com/uias/pageboy). ## Requirements -Tabman requires iOS 9 or above, Swift 4 and uses [Pageboy 2](https://github.com/uias/Pageboy/releases/tag/2.0.0). +Tabman requires iOS 8 or above, Swift 4 and uses [Pageboy 2](https://github.com/uias/Pageboy/releases/tag/2.0.0). For details on using older versions of Tabman or Swift please see [Compatibility](Docs/COMPATIBILITY.md). @@ -65,8 +65,9 @@ carthage bootstrap --platform ios and build the workspace. + ## Usage -### Getting Started +### The Basics 1) Create an instance of `TabmanViewController` and provide it with a `PageboyViewControllerDataSource`, also configuring the items you want to display in the `TabmanBar`. Note: `TabmanViewController` conforms to and is set as the `PageboyViewControllerDelegate`. @@ -104,23 +105,19 @@ func defaultPage(for pageboyViewController: PageboyViewController) -> PageboyVie 3) All done! 🎉 -### Going forward -As Tabman is based on [Pageboy](github.com/uias/Pageboy), everything behaves the same and all the same properties/functions are available. Such as these functions for navigation & reloading: +### Page View Controller +As Tabman is based on [Pageboy](github.com/uias/Pageboy), all the extras and niceities in a `PageboyViewController` are available in a`TabmanViewController`. Including: -```swift -// Scroll the page view controller to a new page. -func scrollToPage(_ pageIndex: PageIndex, - animated: Bool, - completion: PageTransitionCompletion? = nil) +- Simplified data source management. +- Enhanced delegation; featuring exact relative positional data and reliable updates. +- Infinite scrolling support. +- Automatic timer-based page transitioning. +- Support for custom page transitions. -// Reload the view controllers in the page view controller. -func reloadPages() -``` - -Read up on the `Pageboy` docs to find out a bit more [here](https://www.github.com/uias/Pageboy/blob/master/README.md). +Read up on the `Pageboy` documentation [here](https://github.com/uias/Pageboy#usage). ## Child Content Insetting -Tabman will automatically inset any `UITableView` or `UICollectionView`'s that are in the child view controllers provided to the `PageboyViewControllerDataSource`. This behaviour can easily be disabled: +Tabman will automatically inset any `UIScrollView` that if finds within the child view controllers provided by the `PageboyViewControllerDataSource`. This behaviour can easily be disabled: ```swift tabmanViewController.automaticallyAdjustsChildScrollViewInsets = false @@ -128,8 +125,9 @@ tabmanViewController.automaticallyAdjustsChildScrollViewInsets = false A `requiredInsets` property is also available on `TabmanBarConfig` which provides any insets required to inset content correctly for the visible `TabmanBar` manually. -## Customisation -The `TabmanBar` in Tabman can be completely customised to your liking, by simply modifying the available properties in the `.bar` `TabmanBar.Config` object. + +## Customization +The `TabmanBar` in Tabman can be completely customized to your liking, by simply modifying the available properties in the `.bar` `TabmanBar.Config` object. #### Style The style of bar to display, by default this is set to `.scrollingButtonBar`. @@ -166,12 +164,15 @@ tabViewController.bar.appearance = TabmanBar.Appearance({ (appearance) in For more advanced customisation, including defining your own indicator and bar styles please read [here](Docs/ADVANCED_CUSTOMISATION.md). + ## About - Created by [Merrick Sapsford](https://github.com/msaps) ([@MerrickSapsford](https://twitter.com/MerrickSapsford)) - Contributed to by a growing [list of others](https://github.com/uias/Tabman/graphs/contributors). + ## Contributing Bug reports and pull requests are welcome on GitHub at [https://github.com/uias/Tabman](https://github.com/uias/Tabman). + ## License The library is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). diff --git a/Pods/Tabman/Sources/Tabman/TabmanBar/Styles/Abstract/TabmanButtonBar.swift b/Pods/Tabman/Sources/Tabman/TabmanBar/Styles/Abstract/TabmanButtonBar.swift index f9ab8782..77a0c052 100644 --- a/Pods/Tabman/Sources/Tabman/TabmanBar/Styles/Abstract/TabmanButtonBar.swift +++ b/Pods/Tabman/Sources/Tabman/TabmanBar/Styles/Abstract/TabmanButtonBar.swift @@ -58,8 +58,23 @@ internal class TabmanButtonBar: TabmanBar { }) } } + public var color: UIColor = Appearance.defaultAppearance.state.color! public var selectedColor: UIColor = Appearance.defaultAppearance.state.selectedColor! + + public var imageRenderingMode: UIImageRenderingMode = Appearance.defaultAppearance.style.imageRenderingMode! { + didSet { + guard oldValue != imageRenderingMode else { + return + } + updateButtons(update: { + guard let image = $0.currentImage else { + return + } + $0.setImage(image.withRenderingMode(imageRenderingMode), for: .normal) + }) + } + } public var itemVerticalPadding: CGFloat = Appearance.defaultAppearance.layout.itemVerticalPadding! { didSet { @@ -142,6 +157,8 @@ internal class TabmanButtonBar: TabmanBar { let edgeInset = appearance.layout.edgeInset self.edgeInset = edgeInset ?? defaultAppearance.layout.edgeInset! + self.imageRenderingMode = appearance.style.imageRenderingMode ?? defaultAppearance.style.imageRenderingMode! + // update left margin for progressive style if self.indicator?.isProgressiveCapable ?? false { @@ -175,7 +192,7 @@ internal class TabmanButtonBar: TabmanBar { // resize images to fit let resizedImage = image.resize(toSize: Defaults.titleWithImageSize) if resizedImage.size != .zero { - button.setImage(resizedImage.withRenderingMode(.alwaysTemplate), for: .normal) + button.setImage(resizedImage.withRenderingMode(imageRenderingMode), for: .normal) } button.setTitle(title, for: .normal) // Nudge it over a little bit @@ -186,7 +203,7 @@ internal class TabmanButtonBar: TabmanBar { // resize images to fit let resizedImage = image.resize(toSize: Defaults.itemImageSize) if resizedImage.size != .zero { - button.setImage(resizedImage.withRenderingMode(.alwaysTemplate), for: .normal) + button.setImage(resizedImage.withRenderingMode(imageRenderingMode), for: .normal) } } diff --git a/Pods/Tabman/Sources/Tabman/TabmanBar/TabmanBar+Appearance.swift b/Pods/Tabman/Sources/Tabman/TabmanBar/TabmanBar+Appearance.swift index 17fa1691..248d3192 100644 --- a/Pods/Tabman/Sources/Tabman/TabmanBar/TabmanBar+Appearance.swift +++ b/Pods/Tabman/Sources/Tabman/TabmanBar/TabmanBar+Appearance.swift @@ -81,6 +81,8 @@ public extension TabmanBar { public var showEdgeFade: Bool? /// Color of the separator at the bottom of the bar. public var bottomSeparatorColor: UIColor? + /// The image rendering mode for items that have an image + public var imageRenderingMode: UIImageRenderingMode? } public struct Text { @@ -146,7 +148,8 @@ public extension TabmanBar { // style self.style.background = .blur(style: .extraLight) self.style.bottomSeparatorColor = .clear - + self.style.imageRenderingMode = .alwaysTemplate + // interaction self.interaction.isScrollEnabled = true } diff --git a/Pods/Tabman/Sources/Tabman/TabmanBar/TabmanBar+Insets.swift b/Pods/Tabman/Sources/Tabman/TabmanBar/TabmanBar+Insets.swift index 2e895c9a..9fd5e148 100644 --- a/Pods/Tabman/Sources/Tabman/TabmanBar/TabmanBar+Insets.swift +++ b/Pods/Tabman/Sources/Tabman/TabmanBar/TabmanBar+Insets.swift @@ -17,9 +17,17 @@ public extension TabmanBar { internal let barInsets: UIEdgeInsets /// The inset required for the top layout guide (UINavigationBar etc.). - public let topLayoutGuide: CGFloat + @available(*, deprecated: 1.0.1, message: "Use safeAreaInsets") + public var topLayoutGuide: CGFloat { + return safeAreaInsets.top + } /// The inset required for the bottom layout guide (UITabBar etc.). - public let bottomLayoutGuide: CGFloat + @available(*, deprecated: 1.0.1, message: "Use safeAreaInsets") + public var bottomLayoutGuide: CGFloat { + return safeAreaInsets.bottom + } + /// The insets that determine the safe area for the view controller view. + public let safeAreaInsets: UIEdgeInsets /// The inset required for the bar. public var bar: CGFloat { return max(barInsets.top, barInsets.bottom) @@ -30,8 +38,8 @@ public extension TabmanBar { /// This takes topLayoutGuide, bottomlayoutGuide and the bar height into account. /// Set on a UIScrollView's contentInset to manually inset the contents. public var all: UIEdgeInsets { - let top = topLayoutGuide + barInsets.top - let bottom = bottomLayoutGuide + barInsets.bottom + let top = safeAreaInsets.top + barInsets.top + let bottom = safeAreaInsets.bottom + barInsets.bottom if barInsets.top > 0.0 { return UIEdgeInsetsMake(top, 0.0, 0.0, 0.0) @@ -42,17 +50,14 @@ public extension TabmanBar { // MARK: Init - internal init(topLayoutGuide: CGFloat, - bottomLayoutGuide: CGFloat, + internal init(safeAreaInsets: UIEdgeInsets, bar: UIEdgeInsets) { - self.topLayoutGuide = topLayoutGuide - self.bottomLayoutGuide = bottomLayoutGuide + self.safeAreaInsets = safeAreaInsets self.barInsets = bar } internal init() { - self.init(topLayoutGuide: 0.0, - bottomLayoutGuide: 0.0, + self.init(safeAreaInsets: .zero, bar: .zero) } diff --git a/Pods/Tabman/Sources/Tabman/TabmanBar/TabmanBar+Layout.swift b/Pods/Tabman/Sources/Tabman/TabmanBar/TabmanBar+Layout.swift index ba67b419..a93f3827 100644 --- a/Pods/Tabman/Sources/Tabman/TabmanBar/TabmanBar+Layout.swift +++ b/Pods/Tabman/Sources/Tabman/TabmanBar/TabmanBar+Layout.swift @@ -8,6 +8,7 @@ import UIKit +// MARK: - Bar location management internal extension TabmanBar { @discardableResult func barAutoPinToTop(topLayoutGuide: UILayoutSupport) -> [NSLayoutConstraint]? { @@ -55,14 +56,57 @@ internal extension TabmanBar { self.superview?.addConstraints(constraints) return constraints } +} + +// MARK: - Background View layout +internal extension TabmanBar { + + /// Extend the background view for system areas if applicable. + /// + /// - Parameters: + /// - location: The current location of the bar. + /// - viewController: The view controller containing the bar. + /// - appearance: The appearance configuration of the bar. + func extendBackgroundForSystemAreasIfNeeded(for location: TabmanBar.Location, + in viewController: UIViewController, + appearance: TabmanBar.Appearance) { + let safeAreaInsets = generateSafeAreaInsetsIfNeeded(from: viewController) + + extendBackgroundForStatusBarIfNeeded(location: location, + safeAreaInsets: safeAreaInsets, + appearance: appearance) + + if #available(iOS 11, *) { + extendBackgroundForBottomSafeAreaIfNeeded(location: location, + viewController: viewController, + safeAreaInsets: safeAreaInsets, + appearance: appearance) + } + } + + /// Generate a set of insets for safe areas. (Uses layout guides on UIEdgeInsets { + if #available(iOS 11, *) { + return viewController.view.safeAreaInsets + } + + var safeAreaInsets = UIEdgeInsets.zero + safeAreaInsets.top = viewController.topLayoutGuide.length + safeAreaInsets.bottom = viewController.bottomLayoutGuide.length + return safeAreaInsets + } /// Extends the bar background view underneath status bar if applicable. /// /// - Parameters: /// - location: The location of the bar. - /// - topLayoutGuide: The TabmanViewController top layout guide. - func extendBackgroundForStatusBarIfNeeded(location: TabmanBar.Location, - topLayoutGuide: UILayoutSupport, + /// - safeAreaInsets: The current insets of the safe area. + /// - appearance: The appearance configuration of the bar. + private func extendBackgroundForStatusBarIfNeeded(location: TabmanBar.Location, + safeAreaInsets: UIEdgeInsets, appearance: TabmanBar.Appearance) { guard let topPinConstraint = self.backgroundView.constraints.first else { return } guard location == .top, appearance.layout.extendBackgroundEdgeInsets ?? false else { @@ -71,8 +115,36 @@ internal extension TabmanBar { } let statusBarHeight = UIApplication.shared.statusBarFrame.height - if topLayoutGuide.length == statusBarHeight { - self.backgroundView.constraints.first?.constant = -statusBarHeight + if safeAreaInsets.top == statusBarHeight { + topPinConstraint.constant = -statusBarHeight } } + + @available (iOS 11, *) + /// Extends the bar background view onto bottom safe area if applicable (for iPhone X). + /// + /// - Parameters: + /// - location: The location of the bar. + /// - viewController: The view controller that the bar is contained in. + /// - safeAreaInsets: The current insets of the safe area. + /// - appearance: The appearance configuration of the bar. + func extendBackgroundForBottomSafeAreaIfNeeded(location: TabmanBar.Location, + viewController: UIViewController, + safeAreaInsets: UIEdgeInsets, + appearance: TabmanBar.Appearance) { + let bottomPinConstraint = self.backgroundView.constraints[2] + let extendBackgroundEdgeInsets = appearance.layout.extendBackgroundEdgeInsets ?? false + + // ensure location is bottom, extending is enabled + // and view controller is not in a tab bar controller. + guard location == .bottom && + extendBackgroundEdgeInsets && + viewController.tabBarController == nil else { + bottomPinConstraint.constant = 0.0 + return + } + + let bottomSafeAreaInset = safeAreaInsets.bottom + bottomPinConstraint.constant = bottomSafeAreaInset + } } diff --git a/Pods/Tabman/Sources/Tabman/TabmanViewController+Embedding.swift b/Pods/Tabman/Sources/Tabman/TabmanViewController+Embedding.swift index 754f7c7b..5736c844 100644 --- a/Pods/Tabman/Sources/Tabman/TabmanViewController+Embedding.swift +++ b/Pods/Tabman/Sources/Tabman/TabmanViewController+Embedding.swift @@ -16,7 +16,9 @@ public extension TabmanViewController { /// /// - Parameter bar: The bar to attach. public func attach(bar: TabmanBar) { - guard self.attachedTabmanBar == nil else { return } + guard self.attachedTabmanBar == nil else { + fatalError("Tabman - You must detach the currently attached bar before attempting to attach a new bar.") + } self.tabmanBar?.isHidden = true self.reloadRequiredBarInsets() @@ -65,9 +67,20 @@ public extension TabmanViewController { /// This will add the bar to the specified view, and pin the bar edges to the view edges. /// /// - Parameter view: The view to embed the bar in. + @available(*, deprecated: 1.0.4, message: "Use embedBar(in: )") public func embedBar(inView view: UIView) { + embedBar(in: view) + } + + /// Embed the TabmanBar in an external view. + /// This will add the bar to the specified view, and pin the bar edges to the view edges. + /// + /// - Parameter view: The view to embed the bar in. + public func embedBar(in view: UIView) { guard let bar = self.tabmanBar else { return } - guard self.embeddingView == nil || view === self.embeddingView else { return } + guard self.embeddingView == nil || view === self.embeddingView else { + fatalError("Tabman - The bar must be disembedded from the view it is currently embedded in first. Use disembedBar().") + } self.embeddingView = view diff --git a/Pods/Tabman/Sources/Tabman/TabmanViewController+Insetting.swift b/Pods/Tabman/Sources/Tabman/TabmanViewController+Insetting.swift index ee46ffc2..a640dd2e 100644 --- a/Pods/Tabman/Sources/Tabman/TabmanViewController+Insetting.swift +++ b/Pods/Tabman/Sources/Tabman/TabmanViewController+Insetting.swift @@ -13,8 +13,16 @@ internal extension TabmanViewController { /// Reload the required bar insets for the current bar. func reloadRequiredBarInsets() { - self.bar.requiredInsets = TabmanBar.Insets(topLayoutGuide: self.topLayoutGuide.length, - bottomLayoutGuide: self.bottomLayoutGuide.length, + + var layoutInsets: UIEdgeInsets = .zero + if #available(iOS 11, *) { + layoutInsets = view.safeAreaInsets + } else { + layoutInsets.top = topLayoutGuide.length + layoutInsets.bottom = bottomLayoutGuide.length + } + + self.bar.requiredInsets = TabmanBar.Insets(safeAreaInsets: layoutInsets, bar: self.calculateRequiredBarInsets()) } @@ -60,6 +68,8 @@ internal extension TabmanViewController { var scrollViews = [UIScrollView?]() if let tableViewController = childViewController as? UITableViewController { // UITableViewController scrollViews.append(tableViewController.tableView) + } else if let collectionViewController = childViewController as? UICollectionViewController { // UICollectionViewController + scrollViews.append(collectionViewController.collectionView) } else if let subviews = childViewController.view?.subviews { // standard subview filtering scrollViews.append(contentsOf: subviews.map({ $0 as? UIScrollView })) } @@ -69,11 +79,13 @@ internal extension TabmanViewController { guard let scrollView = scrollView else { continue } guard !scrollView.isBeingInteracted else { continue } - var requiredContentInset = self.bar.requiredInsets.barInsets + if #available(iOS 11.0, *) { + scrollView.contentInsetAdjustmentBehavior = .never + } + + var requiredContentInset = self.bar.requiredInsets.all let currentContentInset = self.viewControllerInsets[scrollView.hash] ?? .zero - requiredContentInset.top += self.topLayoutGuide.length - requiredContentInset.bottom += self.bottomLayoutGuide.length self.viewControllerInsets[scrollView.hash] = requiredContentInset // take account of custom top / bottom insets @@ -90,16 +102,26 @@ internal extension TabmanViewController { requiredContentInset.right = currentContentInset.right // ensure scroll view is either at top or full height before doing automatic insetting - if requiredContentInset.top > 0.0 { - guard scrollView.frame.minY == 0.0 else { continue } - } - if requiredContentInset.bottom > 0.0 { - guard let scrollViewSuperview = scrollView.superview, scrollViewSuperview.bounds.maxY - scrollView.frame.maxY == 0.0 else { continue } + var isValidLayout = true + checkIsNotEmbeddedViewController(childViewController, { + if requiredContentInset.top > 0.0 { + isValidLayout = scrollView.frame.minY == 0.0 + } + if requiredContentInset.bottom > 0.0 { + guard let scrollViewSuperview = scrollView.superview else { + return + } + isValidLayout = (scrollViewSuperview.bounds.maxY - scrollView.frame.maxY) == 0.0 + } + }) + + guard isValidLayout else { + continue } // dont update if we dont need to if scrollView.contentInset != requiredContentInset { - + scrollView.contentInset = requiredContentInset scrollView.scrollIndicatorInsets = requiredContentInset @@ -109,6 +131,17 @@ internal extension TabmanViewController { } } } + + /// Check whether a view controller is not an 'embedded' view controller type (i.e. UITableViewController) + /// + /// - Parameters: + /// - viewController: The view controller. + /// - success: Execution if view controller is not embedded type. + private func checkIsNotEmbeddedViewController(_ viewController: UIViewController, _ success: () -> Void) { + if !(viewController is UITableViewController) && !(viewController is UICollectionViewController) { + success() + } + } } // MARK: - UIViewController extension for handling insetting. diff --git a/Pods/Tabman/Sources/Tabman/TabmanViewController.swift b/Pods/Tabman/Sources/Tabman/TabmanViewController.swift index 1ba15d6c..c3cdef5d 100644 --- a/Pods/Tabman/Sources/Tabman/TabmanViewController.swift +++ b/Pods/Tabman/Sources/Tabman/TabmanViewController.swift @@ -40,11 +40,12 @@ open class TabmanViewController: PageboyViewController, PageboyViewControllerDel /// Internal store for bar component transitions. internal var barTransitionStore = TabmanBarTransitionStore() + /// Collection of cached insets for view controllers per page index. + internal var viewControllerInsets: [PageIndex : UIEdgeInsets] = [:] - internal var viewControllerInsets: [Int : UIEdgeInsets] = [:] - - /// Whether any UICollectionView / UITableView in child view controllers should be + /// Whether any UIScrollView in child view controllers should be /// automatically insetted to display below the TabmanBar. + /// NOTE: This needs to be set before a dataSource is set, defaults to true. public var automaticallyAdjustsChildScrollViewInsets: Bool = true { didSet { if automaticallyAdjustsScrollViewInsets { @@ -75,10 +76,10 @@ open class TabmanViewController: PageboyViewController, PageboyViewControllerDel insetChildViewControllerIfNeeded(self.currentViewController) reloadBarWithCurrentPosition() - activeTabmanBar?.extendBackgroundForStatusBarIfNeeded(location: bar.location, - topLayoutGuide: self.topLayoutGuide, - appearance: bar.appearance ?? .defaultAppearance) - + let appearance = bar.appearance ?? .defaultAppearance + activeTabmanBar?.extendBackgroundForSystemAreasIfNeeded(for: bar.location, + in: self, + appearance: appearance) } open override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { @@ -200,7 +201,7 @@ internal extension TabmanViewController { /// - Parameter location: The new location. func updateBar(withLocation location: TabmanBar.Location) { guard self.embeddingView == nil else { - self.embedBar(inView: self.embeddingView!) + self.embedBar(in: self.embeddingView!) return } diff --git a/Pods/Target Support Files/Tabman/Info.plist b/Pods/Target Support Files/Tabman/Info.plist index 3c175b60..a5730fa1 100644 --- a/Pods/Target Support Files/Tabman/Info.plist +++ b/Pods/Target Support Files/Tabman/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.0.1 + 1.0.5 CFBundleSignature ???? CFBundleVersion diff --git a/Settings.bundle/com.mono0926.LicensePlist.plist b/Settings.bundle/com.mono0926.LicensePlist.plist index 7cf314e9..9615978b 100644 --- a/Settings.bundle/com.mono0926.LicensePlist.plist +++ b/Settings.bundle/com.mono0926.LicensePlist.plist @@ -136,7 +136,7 @@ File com.mono0926.LicensePlist/Tabman Title - Tabman (1.0.1) + Tabman (1.0.5) Type PSChildPaneSpecifier