From 87848657904dacd0d457e149dc74defda7da3df4 Mon Sep 17 00:00:00 2001 From: Martin Barreto Date: Fri, 29 Jan 2016 00:58:32 -0300 Subject: [PATCH] rename types to make them shorter --- .../Example/BarExampleViewController.swift | 4 +- .../ButtonBarExampleViewController.swift | 4 +- .../ChildExampleViewController.swift | 2 +- .../TableChildExampleViewController.swift | 2 +- .../InstagramExampleViewController.swift | 4 +- .../NavButtonBarExampleViewController.swift | 4 +- .../SegmentedExampleViewController.swift | 4 +- .../SpotifyExampleViewController.swift | 4 +- .../TwitterExampleViewController.swift | 2 +- .../YoutubeExampleViewController.swift | 6 +-- README.md | 39 ++++++++++++------- Sources/BarPagerTabStripViewController.swift | 4 +- ...ButtonBarPagerTabStripViewController.swift | 6 +-- ...ButtonBarPagerTabStripViewController.swift | 6 +-- ...hildItemInfo.swift => IndicatorInfo.swift} | 0 Sources/PagerTabStripViewController.swift | 28 ++++++------- ...SegmentedPagerTabStripViewController.swift | 8 ++-- .../TwitterPagerTabStripViewController.swift | 6 +-- XLPagerTabStrip.xcodeproj/project.pbxproj | 8 ++-- 19 files changed, 77 insertions(+), 64 deletions(-) rename Sources/{ChildItemInfo.swift => IndicatorInfo.swift} (100%) diff --git a/Example/Example/BarExampleViewController.swift b/Example/Example/BarExampleViewController.swift index b9397f5..42362b0 100644 --- a/Example/Example/BarExampleViewController.swift +++ b/Example/Example/BarExampleViewController.swift @@ -41,9 +41,9 @@ class BarExampleViewController: BarPagerTabStripViewController { super.viewDidLoad() } - // MARK: - PagerTabStripViewControllerDataSource + // MARK: - PagerTabStripDataSource - override func viewControllersForPagerTabStripViewController(pagerTabStripController: PagerTabStripViewController) -> [UIViewController] { + override func viewControllersForPagerTabStrip(pagerTabStripController: PagerTabStripViewController) -> [UIViewController] { let child_1 = TableChildExampleViewController(style: .Plain, itemInfo: "Table View") let child_2 = ChildExampleViewController(itemInfo: "View") diff --git a/Example/Example/ButtonBarExampleViewController.swift b/Example/Example/ButtonBarExampleViewController.swift index d884a2d..05b81e3 100644 --- a/Example/Example/ButtonBarExampleViewController.swift +++ b/Example/Example/ButtonBarExampleViewController.swift @@ -36,9 +36,9 @@ class ButtonBarExampleViewController: ButtonBarPagerTabStripViewController { buttonBarView.backgroundColor = UIColor(red: 7/255, green: 185/255, blue: 155/255, alpha: 1) } - // MARK: - PagerTabStripVIewControllerDataSource + // MARK: - PagerTabStripDataSource - override func viewControllersForPagerTabStripViewController(pagerTabStripController: PagerTabStripViewController) -> [UIViewController] { + override func viewControllersForPagerTabStrip(pagerTabStripController: PagerTabStripViewController) -> [UIViewController] { let child_1 = TableChildExampleViewController(style: .Plain, itemInfo: "Table View") let child_2 = ChildExampleViewController(itemInfo: "View") let child_3 = TableChildExampleViewController(style: .Grouped, itemInfo: "Table View 2") diff --git a/Example/Example/ChildControllers/ChildExampleViewController.swift b/Example/Example/ChildControllers/ChildExampleViewController.swift index 498bda4..1da1798 100644 --- a/Example/Example/ChildControllers/ChildExampleViewController.swift +++ b/Example/Example/ChildControllers/ChildExampleViewController.swift @@ -54,7 +54,7 @@ class ChildExampleViewController: UIViewController, IndicatorInfoProvider { // MARK: - IndicatorInfoProvider - func infoForPagerTabStripViewController(pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo { + func indicatorInfoForPagerTabStrip(pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo { return itemInfo } } diff --git a/Example/Example/ChildControllers/TableChildExampleViewController.swift b/Example/Example/ChildControllers/TableChildExampleViewController.swift index d20aad4..577efe0 100644 --- a/Example/Example/ChildControllers/TableChildExampleViewController.swift +++ b/Example/Example/ChildControllers/TableChildExampleViewController.swift @@ -79,7 +79,7 @@ class TableChildExampleViewController: UITableViewController, IndicatorInfoProvi // MARK: - IndicatorInfoProvider - func infoForPagerTabStripViewController(pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo { + func indicatorInfoForPagerTabStrip(pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo { return itemInfo } } diff --git a/Example/Example/Instagram/InstagramExampleViewController.swift b/Example/Example/Instagram/InstagramExampleViewController.swift index 08032a2..7f775ad 100644 --- a/Example/Example/Instagram/InstagramExampleViewController.swift +++ b/Example/Example/Instagram/InstagramExampleViewController.swift @@ -52,9 +52,9 @@ class InstagramExampleViewController: ButtonBarPagerTabStripViewController { super.viewDidLoad() } - // MARK: - PagerTabStripVIewControllerDataSource + // MARK: - PagerTabStripDataSource - override func viewControllersForPagerTabStripViewController(pagerTabStripController: PagerTabStripViewController) -> [UIViewController] { + override func viewControllersForPagerTabStrip(pagerTabStripController: PagerTabStripViewController) -> [UIViewController] { let child_1 = TableChildExampleViewController(style: .Plain, itemInfo: "FOLLOWING") let child_2 = ChildExampleViewController(itemInfo: "YOU") return [child_1, child_2] diff --git a/Example/Example/NavButtonBarExampleViewController.swift b/Example/Example/NavButtonBarExampleViewController.swift index 3a73f4f..9bac3d2 100644 --- a/Example/Example/NavButtonBarExampleViewController.swift +++ b/Example/Example/NavButtonBarExampleViewController.swift @@ -57,9 +57,9 @@ class NavButtonBarExampleViewController: ButtonBarPagerTabStripViewController { } } - // MARK: - PagerTabStripViewControllerDataSource + // MARK: - PagerTabStripDataSource - override func viewControllersForPagerTabStripViewController(pagerTabStripController: PagerTabStripViewController) -> [UIViewController] { + override func viewControllersForPagerTabStrip(pagerTabStripController: PagerTabStripViewController) -> [UIViewController] { let child_1 = TableChildExampleViewController(style: .Plain, itemInfo: "Table View") let child_2 = ChildExampleViewController(itemInfo: "View") let child_3 = TableChildExampleViewController(style: .Grouped, itemInfo: "Table View 2") diff --git a/Example/Example/SegmentedExampleViewController.swift b/Example/Example/SegmentedExampleViewController.swift index 761f57a..cad9ce4 100644 --- a/Example/Example/SegmentedExampleViewController.swift +++ b/Example/Example/SegmentedExampleViewController.swift @@ -35,9 +35,9 @@ class SegmentedExampleViewController: SegmentedPagerTabStripViewController { settings.style.segmentedControlColor = .whiteColor() } - // MARK: - PagerTabStripViewControllerDataSource + // MARK: - PagerTabStripDataSource - override func viewControllersForPagerTabStripViewController(pagerTabStripController: PagerTabStripViewController) -> [UIViewController] { + override func viewControllersForPagerTabStrip(pagerTabStripController: PagerTabStripViewController) -> [UIViewController] { let child_1 = TableChildExampleViewController(style: .Plain, itemInfo: "Table View") let child_2 = ChildExampleViewController(itemInfo: "View") let child_3 = TableChildExampleViewController(style: .Grouped, itemInfo: "Table View 2") diff --git a/Example/Example/Spotify/SpotifyExampleViewController.swift b/Example/Example/Spotify/SpotifyExampleViewController.swift index 2e7619d..1760ca0 100644 --- a/Example/Example/Spotify/SpotifyExampleViewController.swift +++ b/Example/Example/Spotify/SpotifyExampleViewController.swift @@ -55,9 +55,9 @@ public class SpotifyExampleViewController: ButtonBarPagerTabStripViewController super.viewDidLoad() } - // MARK: - PagerTabStripVIewControllerDataSource + // MARK: - PagerTabStripDataSource - public override func viewControllersForPagerTabStripViewController(pagerTabStripController: PagerTabStripViewController) -> [UIViewController] { + public override func viewControllersForPagerTabStrip(pagerTabStripController: PagerTabStripViewController) -> [UIViewController] { let child_1 = TableChildExampleViewController(style: .Plain, itemInfo: IndicatorInfo(title: "FRIENDS")) child_1.blackTheme = true let child_2 = TableChildExampleViewController(style: .Plain, itemInfo: IndicatorInfo(title: "FEATURED")) diff --git a/Example/Example/TwitterExampleViewController.swift b/Example/Example/TwitterExampleViewController.swift index 3b1a338..260c09b 100644 --- a/Example/Example/TwitterExampleViewController.swift +++ b/Example/Example/TwitterExampleViewController.swift @@ -28,7 +28,7 @@ import XLPagerTabStrip class TwitterExampleViewController: TwitterPagerTabStripViewController { var isReload = false - override func viewControllersForPagerTabStripViewController(pagerTabStripController: PagerTabStripViewController) -> [UIViewController] { + override func viewControllersForPagerTabStrip(pagerTabStripController: PagerTabStripViewController) -> [UIViewController] { let child_1 = TableChildExampleViewController(style: .Plain, itemInfo: "TableView") let child_2 = ChildExampleViewController(itemInfo: "View") diff --git a/Example/Example/Youtube/YoutubeExampleViewController.swift b/Example/Example/Youtube/YoutubeExampleViewController.swift index 2c81131..6600376 100644 --- a/Example/Example/Youtube/YoutubeExampleViewController.swift +++ b/Example/Example/Youtube/YoutubeExampleViewController.swift @@ -70,9 +70,9 @@ class YoutubeExampleViewController: BaseButtonBarPagerTabStripViewController [UIViewController] { + override func viewControllersForPagerTabStrip(pagerTabStripController: PagerTabStripViewController) -> [UIViewController] { let child_1 = TableChildExampleViewController(style: .Plain, itemInfo: IndicatorInfo(title: " HOME", image: UIImage(named: "home"))) let child_2 = TableChildExampleViewController(style: .Plain, itemInfo: IndicatorInfo(title: " TRENDING", image: UIImage(named: "trending"))) let child_3 = ChildExampleViewController(itemInfo: IndicatorInfo(title: " ACCOUNT", image: UIImage(named: "profile"))) @@ -91,7 +91,7 @@ class YoutubeExampleViewController: BaseButtonBarPagerTabStripViewController Void in guard let me = self else { return } - me.navigationItem.leftBarButtonItem?.title = child.infoForPagerTabStripViewController(me).title + me.navigationItem.leftBarButtonItem?.title = child.indicatorInfoForPagerTabStrip(me).title }) } } diff --git a/README.md b/README.md index 8f6ec97..e7dc970 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Long time ago twitter app made use of this type of pager in the app main screen. ### Segmented -This mode uses a `UIsegmentedControl` to indicates which is the view controller being displayed. +This mode uses a `UISegmentedControl` to indicates which is the view controller being displayed. @@ -83,34 +83,34 @@ Drag a `UIScrollView` into your view controller view and connect `PagerTabStripV Depending on which type of paging view controller you are working with you may have to connect more outlets. -For `BarPagerTabStripViewController` we should connect `barView` outlet. `ButtonBarPagerTabStripViewController` requires us to connect `buttonBarView` outlet. `SegmentedPagerTabStripViewController` has a `segmentedControl` outlet, if the outlet is not connected the library try to set up the navigationItem titleView using a `UIsegmentedControl`. `TwitterPagerTabStripViewController` doesn't require to connect any additional outlet. +For `BarPagerTabStripViewController` we should connect `barView` outlet. `ButtonBarPagerTabStripViewController` requires us to connect `buttonBarView` outlet. `SegmentedPagerTabStripViewController` has a `segmentedControl` outlet, if the outlet is not connected the library try to set up the navigationItem `titleView` property using a `UISegmentedControl`. `TwitterPagerTabStripViewController` doesn't require us to connect any additional outlet. > The example project contains a example for each pager controller type and we can look into it to see how views were added and how outlets were connected. ##### Provide the view controllers that will appear embedded into the PagerTabStrip view controller -You can provide the view controllers by overriding `func viewControllersForPagerTabStripViewController(pagerTabStripController: PagerTabStripViewController) -> [UIViewController]` method. +You can provide the view controllers by overriding `func viewControllersForPagerTabStrip(pagerTabStripController: PagerTabStripViewController) -> [UIViewController]` method. ```swift -override public func viewControllersForPagerTabStripViewController(pagerTabStripController: PagerTabStripViewController) -> [UIViewController] { +override public func viewControllersForPagerTabStrip(pagerTabStripController: PagerTabStripViewController) -> [UIViewController] { return [MyEmbeddedViewController(), MySecondEmbeddedViewController()] } ``` -> The method above is the only method declared in `PagerTabStripViewControllerDataSource` protocol. We don't need to explicitly conform to it since base pager class already does it. +> The method above is the only method declared in `PagerTabStripDataSource` protocol. We don't need to explicitly conform to it since base pager class already does it. ##### Provide information to show in each indicator -Every UIViewController that will appear within the PagerTabStrip controller needs to provide either a title or an image. -In order to do so they should conform to `PagerTabStripChildItem` by implementing `func childHeaderForPagerTabStripViewController(pagerTabStripController: PagerTabStripViewController) -> ChildItemInfo` +Every UIViewController that will appear within the PagerTabStrip needs to provide either a title or an image. +In order to do so they should conform to `IndicatorInfoProvider` by implementing `func indicatorInfoForPagerTabStrip(pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo` which provides the information required to show the PagerTabStrip menu (indicator) associated with the view controller. ```swift -class MyEmbeddedViewController: UITableViewController, PagerTabStripChildItem { +class MyEmbeddedViewController: UITableViewController, IndicatorInfoProvider { - func childInfoForPagerTabStripViewController(pagerTabStripController: PagerTabStripViewController) -> ChildItemInfo { - return ChildItemInfo(title: "My Child title") + func indicatorInfoForPagerTabStrip(pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo { + return IndicatorInfo(title: "My Child title") } } ``` @@ -121,7 +121,6 @@ That's it! We're done! 🍻🍻 ## Customization - ## Requirements * iOS 8.0+ @@ -145,7 +144,7 @@ You can also experiment and learn with the *XLPagerTabStrip Playground* which is ## Installation -#### CocoaPods +### CocoaPods [CocoaPods](https://cocoapods.org/) is a dependency manager for Cocoa projects. @@ -155,7 +154,7 @@ To install XLPagerTabStrip, simply add the following line to your Podfile: pod 'XLPagerTabStrip', '~> 4.0' ``` -#### Carthage +### Carthage [Carthage](https://github.com/Carthage/Carthage) is a simple, decentralized dependency manager for Cocoa. @@ -165,6 +164,20 @@ To install XLPagerTabStrip, simply add the following line to your Cartfile: github "xmartlabs/XLPagerTabStrip" ~> 4.0 ``` +## FAQ + +#### How to change the visible child view controller programmatically + +`XLPagerTabStripViewController` provides the following methods to programmatically change the visible child view controller: + +```swift +func moveToViewControllerAtIndex(index: Int) +func moveToViewControllerAtIndex(index: Int, animated: Bool) +func moveToViewController(viewController: UIViewController) +func moveToViewController(viewController: UIViewController, animated: Bool) +``` + + ## Author * [Martin Barreto](https://github.com/mtnBarreto) ([@mtnBarreto](https://twitter.com/mtnBarreto)) diff --git a/Sources/BarPagerTabStripViewController.swift b/Sources/BarPagerTabStripViewController.swift index 3f411c2..6fce374 100644 --- a/Sources/BarPagerTabStripViewController.swift +++ b/Sources/BarPagerTabStripViewController.swift @@ -35,7 +35,7 @@ public struct BarPagerTabStripSettings { public var style = Style() } -public class BarPagerTabStripViewController: PagerTabStripViewController, PagerTabStripViewControllerDataSource, PagerTabStripViewControllerIsProgressiveDelegate { +public class BarPagerTabStripViewController: PagerTabStripViewController, PagerTabStripDataSource, PagerTabStripIsProgressiveDelegate { public var settings = BarPagerTabStripSettings() @@ -82,7 +82,7 @@ public class BarPagerTabStripViewController: PagerTabStripViewController, PagerT } } - // MARK: - PagerTabStripViewControllerDelegate + // MARK: - PagerTabStripDelegate public func pagerTabStripViewController(pagerTabStripViewController: PagerTabStripViewController, updateIndicatorFromIndex fromIndex: Int, toIndex: Int) throws { barView.moveToIndex(index: toIndex, animated: true) diff --git a/Sources/BaseButtonBarPagerTabStripViewController.swift b/Sources/BaseButtonBarPagerTabStripViewController.swift index 7681b09..6fce082 100644 --- a/Sources/BaseButtonBarPagerTabStripViewController.swift +++ b/Sources/BaseButtonBarPagerTabStripViewController.swift @@ -24,7 +24,7 @@ import Foundation -public class BaseButtonBarPagerTabStripViewController: PagerTabStripViewController, PagerTabStripViewControllerDataSource, PagerTabStripViewControllerIsProgressiveDelegate, UICollectionViewDelegate, UICollectionViewDataSource { +public class BaseButtonBarPagerTabStripViewController: PagerTabStripViewController, PagerTabStripDataSource, PagerTabStripIsProgressiveDelegate, UICollectionViewDelegate, UICollectionViewDataSource { public var settings = ButtonBarPagerTabStripSettings() public var buttonBarItemSpec: ButtonBarItemSpec! @@ -231,7 +231,7 @@ public class BaseButtonBarPagerTabStripViewController IndicatorInfo + func indicatorInfoForPagerTabStrip(pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo } -public protocol PagerTabStripViewControllerDelegate: class { +public protocol PagerTabStripDelegate: class { func pagerTabStripViewController(pagerTabStripViewController: PagerTabStripViewController, updateIndicatorFromIndex fromIndex: Int, toIndex: Int) throws } -public protocol PagerTabStripViewControllerIsProgressiveDelegate : PagerTabStripViewControllerDelegate { +public protocol PagerTabStripIsProgressiveDelegate : PagerTabStripDelegate { func pagerTabStripViewController(pagerTabStripViewController: PagerTabStripViewController, updateIndicatorFromIndex fromIndex: Int, toIndex: Int, withProgressPercentage progressPercentage: CGFloat, indexWasChanged: Bool) throws } -public protocol PagerTabStripViewControllerDataSource: class { +public protocol PagerTabStripDataSource: class { - func viewControllersForPagerTabStripViewController(pagerTabStripController: PagerTabStripViewController) -> [UIViewController] + func viewControllersForPagerTabStrip(pagerTabStripController: PagerTabStripViewController) -> [UIViewController] } @@ -59,8 +59,8 @@ public class PagerTabStripViewController: UIViewController, UIScrollViewDelegate return containerView }() - public weak var delegate: PagerTabStripViewControllerDelegate? - public weak var datasource: PagerTabStripViewControllerDataSource? + public weak var delegate: PagerTabStripDelegate? + public weak var datasource: PagerTabStripDataSource? public var pagerBehaviour = PagerTabStripBehaviour.Progressive(skipIntermediteViewControllers: true, elasticIndicatorLimit: true) @@ -156,10 +156,10 @@ public class PagerTabStripViewController: UIViewController, UIScrollViewDelegate moveToViewControllerAtIndex(viewControllers.indexOf(viewController)!, animated: animated) } - //MARK: - PagerTabStripViewControllerDataSource + //MARK: - PagerTabStripDataSource - public func viewControllersForPagerTabStripViewController(pagerTabStripController: PagerTabStripViewController) -> [UIViewController] { - assertionFailure("Sub-class must implement the PagerTabStripViewControllerDataSource viewControllersForPagerTabStripViewController: method") + public func viewControllersForPagerTabStrip(pagerTabStripController: PagerTabStripViewController) -> [UIViewController] { + assertionFailure("Sub-class must implement the PagerTabStripDataSource viewControllersForPagerTabStrip: method") return [] } @@ -253,7 +253,7 @@ public class PagerTabStripViewController: UIViewController, UIScrollViewDelegate currentIndex = newCurrentIndex let changeCurrentIndex = newCurrentIndex != oldCurrentIndex - if let progressiveDeledate = self as? PagerTabStripViewControllerIsProgressiveDelegate where pagerBehaviour.isProgressiveIndicator { + if let progressiveDeledate = self as? PagerTabStripIsProgressiveDelegate where pagerBehaviour.isProgressiveIndicator { let (fromIndex, toIndex, scrollPercentage) = progressiveIndicatorData(virtualPage) try! progressiveDeledate.pagerTabStripViewController(self, updateIndicatorFromIndex: fromIndex, toIndex: toIndex, withProgressPercentage: scrollPercentage, indexWasChanged: changeCurrentIndex) @@ -363,12 +363,12 @@ public class PagerTabStripViewController: UIViewController, UIScrollViewDelegate guard let dataSource = datasource else { fatalError("dataSource must not be nil") } - viewControllers = dataSource.viewControllersForPagerTabStripViewController(self) + viewControllers = dataSource.viewControllersForPagerTabStrip(self) // viewControllers guard viewControllers.count != 0 else { - fatalError("viewControllersForPagerTabStripViewController should provide at least one child view controller") + fatalError("viewControllersForPagerTabStrip should provide at least one child view controller") } - viewControllers.forEach { if !($0 is IndicatorInfoProvider) { fatalError("Every view controller provided by PagerTabStripViewControllerDataSource's viewControllersForPagerTabStripViewController method must conform to InfoProvider") }} + viewControllers.forEach { if !($0 is IndicatorInfoProvider) { fatalError("Every view controller provided by PagerTabStripDataSource's viewControllersForPagerTabStrip method must conform to InfoProvider") }} } diff --git a/Sources/SegmentedPagerTabStripViewController.swift b/Sources/SegmentedPagerTabStripViewController.swift index 5cb0d38..71aa234 100644 --- a/Sources/SegmentedPagerTabStripViewController.swift +++ b/Sources/SegmentedPagerTabStripViewController.swift @@ -34,7 +34,7 @@ public struct SegmentedPagerTabStripSettings { } -public class SegmentedPagerTabStripViewController: PagerTabStripViewController, PagerTabStripViewControllerDataSource, PagerTabStripViewControllerDelegate { +public class SegmentedPagerTabStripViewController: PagerTabStripViewController, PagerTabStripDataSource, PagerTabStripDelegate { @IBOutlet lazy public var segmentedControl: UISegmentedControl! = UISegmentedControl() @@ -75,11 +75,11 @@ public class SegmentedPagerTabStripViewController: PagerTabStripViewController, segmentedControl.removeAllSegments() for (index, item) in viewControllers.enumerate(){ let child = item as! IndicatorInfoProvider - if let image = child.infoForPagerTabStripViewController(self).image { + if let image = child.indicatorInfoForPagerTabStrip(self).image { segmentedControl.insertSegmentWithImage(image, atIndex: index, animated: false) } else { - segmentedControl.insertSegmentWithTitle(child.infoForPagerTabStripViewController(self).title, atIndex: index, animated: false) + segmentedControl.insertSegmentWithTitle(child.indicatorInfoForPagerTabStrip(self).title, atIndex: index, animated: false) } } segmentedControl.selectedSegmentIndex = currentIndex @@ -92,7 +92,7 @@ public class SegmentedPagerTabStripViewController: PagerTabStripViewController, moveToViewControllerAtIndex(index) } - // MARK: - PagerTabStripViewControllerDelegate + // MARK: - PagerTabStripDelegate public func pagerTabStripViewController(pagerTabStripViewController: PagerTabStripViewController, updateIndicatorFromIndex fromIndex: Int, toIndex: Int) throws { if shouldUpdateSegmentedControl { diff --git a/Sources/TwitterPagerTabStripViewController.swift b/Sources/TwitterPagerTabStripViewController.swift index 56c3084..05a8c5c 100644 --- a/Sources/TwitterPagerTabStripViewController.swift +++ b/Sources/TwitterPagerTabStripViewController.swift @@ -37,7 +37,7 @@ public struct TwitterPagerTabStripSettings { public var style = Style() } -public class TwitterPagerTabStripViewController: PagerTabStripViewController, PagerTabStripViewControllerDataSource, PagerTabStripViewControllerIsProgressiveDelegate { +public class TwitterPagerTabStripViewController: PagerTabStripViewController, PagerTabStripDataSource, PagerTabStripIsProgressiveDelegate { public var settings = TwitterPagerTabStripSettings() @@ -74,7 +74,7 @@ public class TwitterPagerTabStripViewController: PagerTabStripViewController, Pa setNavigationViewItemsPosition(updateAlpha: true) } - // MARK: - PagerTabStripViewControllerDelegate + // MARK: - PagerTabStripDelegate public func pagerTabStripViewController(pagerTabStripViewController: PagerTabStripViewController, updateIndicatorFromIndex fromIndex: Int, toIndex: Int) throws { fatalError() @@ -165,7 +165,7 @@ public class TwitterPagerTabStripViewController: PagerTabStripViewController, Pa childTitleLabels.removeAll() for (index, item) in viewControllers.enumerate() { let child = item as! IndicatorInfoProvider - let indicatorInfo = child.infoForPagerTabStripViewController(self) + let indicatorInfo = child.indicatorInfoForPagerTabStrip(self) let navTitleLabel : UILabel = { let label = UILabel() label.text = indicatorInfo.title diff --git a/XLPagerTabStrip.xcodeproj/project.pbxproj b/XLPagerTabStrip.xcodeproj/project.pbxproj index c6a16a4..dcc6616 100644 --- a/XLPagerTabStrip.xcodeproj/project.pbxproj +++ b/XLPagerTabStrip.xcodeproj/project.pbxproj @@ -7,7 +7,7 @@ objects = { /* Begin PBXBuildFile section */ - 281BFDC11C511C420090C26F /* ChildItemInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 281BFDC01C511C420090C26F /* ChildItemInfo.swift */; }; + 281BFDC11C511C420090C26F /* IndicatorInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 281BFDC01C511C420090C26F /* IndicatorInfo.swift */; }; 281BFDC31C511F120090C26F /* PagerTabStripBehaviour.swift in Sources */ = {isa = PBXBuildFile; fileRef = 281BFDC21C511F120090C26F /* PagerTabStripBehaviour.swift */; }; 287D0A6E1C4B73BD004566D6 /* XLPagerTabStripTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 287D0A6D1C4B73BD004566D6 /* XLPagerTabStripTests.swift */; }; 28C83C841C54229A000B2902 /* BaseButtonBarPagerTabStripViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28C83C831C54229A000B2902 /* BaseButtonBarPagerTabStripViewController.swift */; }; @@ -39,7 +39,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 281BFDC01C511C420090C26F /* ChildItemInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChildItemInfo.swift; sourceTree = ""; }; + 281BFDC01C511C420090C26F /* IndicatorInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IndicatorInfo.swift; sourceTree = ""; }; 281BFDC21C511F120090C26F /* PagerTabStripBehaviour.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PagerTabStripBehaviour.swift; sourceTree = ""; }; 287D0A6D1C4B73BD004566D6 /* XLPagerTabStripTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = XLPagerTabStripTests.swift; path = Tests/XLPagerTabStripTests.swift; sourceTree = SOURCE_ROOT; }; 28C83C831C54229A000B2902 /* BaseButtonBarPagerTabStripViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseButtonBarPagerTabStripViewController.swift; sourceTree = ""; }; @@ -154,7 +154,7 @@ 281BFDBE1C511B890090C26F /* Views */, 28E098BD1C5002D90083B788 /* PagerTabStripError.swift */, 28E098BF1C5003130083B788 /* SwipeDirection.swift */, - 281BFDC01C511C420090C26F /* ChildItemInfo.swift */, + 281BFDC01C511C420090C26F /* IndicatorInfo.swift */, 281BFDC21C511F120090C26F /* PagerTabStripBehaviour.swift */, ); path = Sources; @@ -287,7 +287,7 @@ CBA0A1FC1C502DA300C5748C /* BarPagerTabStripViewController.swift in Sources */, CB71C6EE1C4EB988008EC806 /* SegmentedPagerTabStripViewController.swift in Sources */, 28E098BE1C5002D90083B788 /* PagerTabStripError.swift in Sources */, - 281BFDC11C511C420090C26F /* ChildItemInfo.swift in Sources */, + 281BFDC11C511C420090C26F /* IndicatorInfo.swift in Sources */, CB86ED6B1C4D6E6C00DA463B /* PagerTabStripViewController.swift in Sources */, 28E098C01C5003130083B788 /* SwipeDirection.swift in Sources */, CB0986C81C5158A000DF7087 /* ButtonBarViewCell.swift in Sources */,