[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-6769":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":32,"readmeContent":33,"aiSummary":34,"trendingCount":16,"starSnapshotCount":16,"syncStatus":35,"lastSyncTime":36,"discoverSource":37},6769,"XLPagerTabStrip","xmartlabs\u002FXLPagerTabStrip","xmartlabs","Android PagerTabStrip for iOS.","",null,"Swift",7006,1314,124,278,0,1,5,40.36,"MIT License",false,"master",true,[25,26,27,28,29,30,31],"carthage","cocoapods","ios-libraries","ios-ui","pager-controller","swift","swift-library","2026-06-12 02:01:29","![XLPagerTabStripView](https:\u002F\u002Fraw.githubusercontent.com\u002Fxmartlabs\u002FXLPagerTabStrip\u002Fmaster\u002FXLPagerTabTrip.png)\n\n\u003Cp align=\"left\">\n\u003Ca href=\"https:\u002F\u002Ftravis-ci.org\u002Fxmartlabs\u002FXLPagerTabStrip\">\u003Cimg src=\"https:\u002F\u002Ftravis-ci.org\u002Fxmartlabs\u002FXLPagerTabStrip.svg?branch=master\" alt=\"Build status\" \u002F>\u003C\u002Fa>\n\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fplatform-iOS-blue.svg?style=flat\" alt=\"Platform iOS\" \u002F>\n\u003Ca href=\"https:\u002F\u002Fdeveloper.apple.com\u002Fswift\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fswift5-compatible-4BC51D.svg?style=flat\" alt=\"Swift 5 compatible\" \u002F>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCarthage-compatible-4BC51D.svg?style=flat\" alt=\"Carthage compatible\" \u002F>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fcocoapods.org\u002Fpods\u002FXLPagerTabStrip\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fcocoapods\u002Fv\u002FXLPagerTabStrip.svg\" alt=\"CocoaPods compatible\" \u002F>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fxmartlabs\u002FXLPagerTabStrip\u002Fmaster\u002FLICENSE\">\u003Cimg src=\"http:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-blue.svg?style=flat\" alt=\"License: MIT\" \u002F>\n\u003C\u002Fa>\n\u003C!-- \u003Ca href=\"https:\u002F\u002Fcodebeat.co\u002Fprojects\u002Fgithub-com-xmartlabs-xlpagertabstrip\">\u003Cimg alt=\"codebeat badge\" src=\"https:\u002F\u002Fcodebeat.co\u002Fbadges\u002Ff32c9ad3-0aa1-4b40-a632-9421211bd39e\" \u002F>\u003C\u002Fa> -->\n\n\u003C\u002Fp>\n\nMade with ❤️ by [XMARTLABS](http:\u002F\u002Fxmartlabs.com).\n\nAndroid [PagerTabStrip](http:\u002F\u002Fdeveloper.android.com\u002Freference\u002Fandroid\u002Fsupport\u002Fv4\u002Fview\u002FPagerTabStrip.html) for iOS!\n\n👉 Looking for a SwiftUI version? Check out [PagerTabStripView](https:\u002F\u002Fgithub.com\u002Fxmartlabs\u002FPagerTabStripView), it's fully written in pure SwiftUI. 👈\n\n**XLPagerTabStrip** is a *Container View Controller* that allows us to switch easily among a collection of view controllers. Pan gesture can be used to move on to next or previous view controller. It shows a interactive indicator of the current, previous, next child view controllers.\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Cth>\u003Cimg src=\"Example\u002Finstagram.gif\" width=\"250\"\u002F>\u003C\u002Fth>\n    \u003Cth>\u003Cimg src=\"Example\u002Fspotify.gif\" width=\"250\"\u002F>\u003C\u002Fth>\n    \u003Cth>\u003Cimg src=\"Example\u002Fyoutube.gif\" width=\"250\"\u002F>\u003C\u002Fth>\n    \u003Cth>\u003Cimg src=\"Example\u002FpagerTabStripTypes.gif\" width=\"250\"\u002F>\u003C\u002Fth>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n## Getting involved\n\n* If you **want to contribute** please feel free to **submit pull requests**.\n* If you **have a feature request** please **open an issue**.\n* If you **found a bug** or **need help** please **check older issues, [FAQ](#faq) and threads on [StackOverflow](http:\u002F\u002Fstackoverflow.com\u002Fquestions\u002Ftagged\u002FXLPagerTabStrip) (Tag 'XLPagerTabStrip') before submitting an issue**.\n\n**Before contribute check the [CONTRIBUTING](CONTRIBUTING.md) file for more info.**\n\nIf you use **XLPagerTabStrip** in your app we would love to hear about it! Drop us a line on [twitter](https:\u002F\u002Ftwitter.com\u002Fxmartlabs).\n\n## Pager Types\n\nThe library provides 4 different ways to show the view controllers.\n\n### Button Bar\n\nThis is likely the most common pager type. It's used by many well-known apps such as instagram, youtube, skype, and many others.\n\n\u003Cimg src=\"Example\u002FbarButton.gif\" width=\"250\"\u002F>\n\n### Bar\n\nThis mode doesn't show a title neither an image. It only shows a bar that indicates the current view controller.\n\n\u003Cimg src=\"Example\u002Fbar.gif\" width=\"250\"\u002F>\n\n### Twitter\n\nA long time ago, the twitter app made use of this type of pager in the app main screen.\n\n\u003Cimg src=\"Example\u002Ftwitter.gif\" width=\"250\"\u002F>\n\n### Segmented\n\nThis mode uses a `UISegmentedControl` to indicate which view controller is being displayed.\n\n\u003Cimg src=\"Example\u002Fsegmented.gif\" width=\"250\"\u002F>\n\n## Usage\n\nBasically, we just need to provide the list of child view controllers to show, and these view controllers should provide the information (title or image) that will be shown in the associated indicator.\n\nLet's see the steps to do this:\n\n##### Choose which type of pager we want to create\n\nFirst, we must choose the type of pager we want to create.  Depending on our choice, we will have to create a view controller that extends from one of the following controllers: `TwitterPagerTabStripViewController`, `ButtonBarPagerTabStripViewController`, `SegmentedPagerTabStripViewController`, `BarPagerTabStripViewController`.\n\n> All these built-in pager controllers extend from the base class `PagerTabStripViewController`.\n> You can also make your custom pager controller by extending directly from `PagerTabStripViewController` in the event that no pager menu type fits your needs.\n\n```swift\nimport XLPagerTabStrip\n\nclass MyPagerTabStripName: ButtonBarPagerTabStripViewController {\n  ..\n}\n```\n\n##### Connect outlets and add layout constraints\n\nWe strongly recommend using IB to set up our page controller views.\n\nDrag a `UIViewController` into the storyboard and set up its class with your pager controller (`MyPagerTabStripName`).\nDrag a `UIScrollView` into your view controller view and connect `PagerTabStripViewController` `containerView` outlet with the scroll view.\n\nDepending on which type of paging view controller you are working with you may have to connect more outlets.\n\nFor `BarPagerTabStripViewController`, we should connect `barView` outlet. barView type is UIView. `ButtonBarPagerTabStripViewController` requires us to connect `buttonBarView` outlet. `buttonBarView` type is `ButtonBarView` which extends from `UICollectionView`. `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.\n\n> 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.\n\n##### Provide the view controllers that will appear embedded into the PagerTabStrip view controller\n\nYou can provide the view controllers by overriding `func viewControllers(for: pagerTabStripController: PagerTabStripViewController) -> [UIViewController]` method.\n\n```swift\noverride public func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> [UIViewController] {\n  return [MyEmbeddedViewController(), MySecondEmbeddedViewController()]\n}\n```\n\n> 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.\n\n\n##### Provide information to show in each indicator\n\nEvery UIViewController that will appear within the PagerTabStrip needs to provide either a title or an image.\nIn order to do so they should conform to `IndicatorInfoProvider` by implementing `func indicatorInfo(for pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo`\n which provides the information required to show the PagerTabStrip menu (indicator) associated with the view controller.\n\n```swift\nclass MyEmbeddedViewController: UITableViewController, IndicatorInfoProvider {\n\n  func indicatorInfo(for pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo {\n    return IndicatorInfo(title: \"My Child title\")\n  }\n}\n```\n\n**For a detailed step-by-step guide about how to use the library, please check out this community [blog post](https:\u002F\u002Fmedium.com\u002Fmichaeladeyeri\u002Fhow-to-implement-android-like-tab-layouts-in-ios-using-swift-3-578516c3aa9).**\n\nThat's it! We're done! 🍻🍻\n\n\n## Customization\n\n##### Pager Behaviour\n\nThe pager indicator can be updated progressive as we swipe or at once in the middle of the transition between the view controllers.\nBy setting up `pagerBehaviour` property we can choose how the indicator should be updated.\n\n```swift\npublic var pagerBehaviour: PagerTabStripBehaviour\n```\n\n```swift\npublic enum PagerTabStripBehaviour {\n    case common(skipIntermediteViewControllers: Bool)\n    case progressive(skipIntermediteViewControllers: Bool, elasticIndicatorLimit: Bool)\n}\n```\n\nDefault Values:\n```swift\n\u002F\u002F Twitter Type\nPagerTabStripBehaviour.common(skipIntermediateViewControllers: true)\n\u002F\u002F Segmented Type\nPagerTabStripBehaviour.common(skipIntermediateViewControllers: true)\n\u002F\u002F Bar Type\nPagerTabStripBehaviour.progressive(skipIntermediateViewControllers: true, elasticIndicatorLimit: true)\n\u002F\u002F ButtonBar Type\nPagerTabStripBehaviour.progressive(skipIntermediateViewControllers: true, elasticIndicatorLimit: true)\n```\n\nAs you might have noticed, `common` and `progressive` enumeration cases have `skipIntermediateViewControllers` and `elasticIndicatorLimit` associated values.\n\n`skipIntermediateViewControllers` allows us to skip intermediate view controllers when a tab indicator is tapped.\n\n`elasticIndicatorLimit` allows us to tension the indicator when we reach a limit, I mean when we try to move forward from last indicator or move back from first indicator.\n\n##### PagerTabStripDelegate & PagerTabStripIsProgressiveDelegate\n\nNormally we don't need to implement these protocols because each pager type already conforms to it in order to properly update its indicator. However, there may be some scenarios when overriding a method may come in handy.\n\n```swift\npublic protocol PagerTabStripDelegate: class {\n\n    func updateIndicator(for viewController: PagerTabStripViewController, fromIndex: Int, toIndex: Int)\n}\n\npublic protocol PagerTabStripIsProgressiveDelegate : PagerTabStripDelegate {\n\n    func updateIndicator(for viewController: PagerTabStripViewController, fromIndex: Int, toIndex: Int, withProgressPercentage progressPercentage: CGFloat, indexWasChanged: Bool)\n}\n```\n\n> Again, the method invoked by the library depends on the `pagerBehaviour` value.\n\n\n\n\n### ButtonBar Customization\n\n```swift\n\nsettings.style.buttonBarBackgroundColor: UIColor?\n\u002F\u002F buttonBar minimumInteritemSpacing value, note that button bar extends from UICollectionView\nsettings.style.buttonBarMinimumInteritemSpacing: CGFloat?\n\u002F\u002F buttonBar minimumLineSpacing value\nsettings.style.buttonBarMinimumLineSpacing: CGFloat?\n\u002F\u002F buttonBar flow layout left content inset value\nsettings.style.buttonBarLeftContentInset: CGFloat?\n\u002F\u002F buttonBar flow layout right content inset value\nsettings.style.buttonBarRightContentInset: CGFloat?\n\n\u002F\u002F selected bar view is created programmatically so it's important to set up the following 2 properties properly\nsettings.style.selectedBarBackgroundColor = UIColor.black\nsettings.style.selectedBarHeight: CGFloat = 5\n\n\u002F\u002F each buttonBar item is a UICollectionView cell of type ButtonBarViewCell\nsettings.style.buttonBarItemBackgroundColor: UIColor?\nsettings.style.buttonBarItemFont = UIFont.systemFont(ofSize: 18)\n\u002F\u002F helps to determine the cell width, it represent the space before and after the title label\nsettings.style.buttonBarItemLeftRightMargin: CGFloat = 8\nsettings.style.buttonBarItemTitleColor: UIColor?\n\u002F\u002F in case the barView items do not fill the screen width this property stretch the cells to fill the screen\nsettings.style.buttonBarItemsShouldFillAvailableWidth = true\n\u002F\u002F only used if button bar is created programmatically and not using storyboards or nib files as recommended.\npublic var buttonBarHeight: CGFloat?\n```\n\n**Important:** Settings should be called before `viewDidLoad` is called.\n```swift\noverride func viewDidLoad() {\n   self.settings.style.selectedBarHeight = 2\n   self.settings.style.selectedBarBackgroundColor = UIColor.white\n\n   super.viewDidLoad()\n}\n```\n\n#####  Update cells when selected indicator changes\n\nWe may need to update the indicator cell when the displayed view controller changes. The following function properties help to accomplish that. Depending on our pager `pagerBehaviour` value we will have to set up `changeCurrentIndex` or `changeCurrentIndexProgressive`.\n\n```swift\npublic var changeCurrentIndex: ((oldCell: ButtonBarViewCell?, newCell: ButtonBarViewCell?, animated: Bool) -> Void)?\npublic var changeCurrentIndexProgressive: ((oldCell: ButtonBarViewCell?, newCell: ButtonBarViewCell?, progressPercentage: CGFloat, changeCurrentIndex: Bool, animated: Bool) -> Void)?\n```\n\nLet's see an example:\n\n```swift\nchangeCurrentIndexProgressive = { (oldCell: ButtonBarViewCell?, newCell: ButtonBarViewCell?, progressPercentage: CGFloat, changeCurrentIndex: Bool, animated: Bool) -> Void in\n    guard changeCurrentIndex == true else { return }\n\n    oldCell?.label.textColor = UIColor(white: 1, alpha: 0.6)\n    newCell?.label.textColor = UIColor.white\n\n    if animated {\n        UIView.animate(withDuration: 0.1, animations: { () -> Void in\n            newCell?.transform = CGAffineTransform(scaleX: 1.0, y: 1.0)\n            oldCell?.transform = CGAffineTransform(scaleX: 0.8, y: 0.8)\n        })\n    }\n    else {\n        newCell?.transform = CGAffineTransform(scaleX: 1.0, y: 1.0)\n        oldCell?.transform = CGAffineTransform(scaleX: 0.8, y: 0.8)\n    }\n}\n```\n\n### Bar Type Customization\n\n```swift\nsettings.style.barBackgroundColor: UIColor?\nsettings.style.selectedBarBackgroundColor: UIColor?\n\u002F\u002F barHeight is only set up when the bar is created programmatically and not using storyboards or xib files as recommended.\nsettings.style.barHeight: CGFloat = 5\n```\n\n### Twitter Type Customization\n\n```swift\nsettings.style.dotColor = UIColor(white: 1, alpha: 0.4)\nsettings.style.selectedDotColor = UIColor.white\nsettings.style.portraitTitleFont = UIFont.systemFont(ofSize: 18)\nsettings.style.landscapeTitleFont = UIFont.systemFont(ofSize: 15)\nsettings.style.titleColor = UIColor.white\n```\n\n### Segmented Type Customization\n\n```swift\nsettings.style.segmentedControlColor: UIColor?\n```\n\n\n\n## Requirements\n\n* iOS 9.3+\n* Xcode 10.2+\n\n## Examples\n\nFollow these 3 steps to run Example project: Clone XLPagerTabStrip repository, open XLPagerTabStrip workspace and run the *Example* project.\n\n## Installation\n\n### CocoaPods\n\n[CocoaPods](https:\u002F\u002Fcocoapods.org\u002F) is a dependency manager for Cocoa projects.\n\nTo install XLPagerTabStrip, simply add the following line to your Podfile:\n\n```ruby\npod 'XLPagerTabStrip', '~> 9.0'\n```\n\n### Carthage\n\n[Carthage](https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage) is a simple, decentralized dependency manager for Cocoa.\n\nTo install XLPagerTabStrip, simply add the following line to your Cartfile:\n\n```ogdl\ngithub \"xmartlabs\u002FXLPagerTabStrip\" ~> 9.0\n```\n\n### SPM\n\n- File > Swift Packages > Add Package Dependency\n- Add `https:\u002F\u002Fgithub.com\u002Fxmartlabs\u002FXLPagerTabStrip.git`\n- Select \"Up to Next Major\" with \"9.0.0\"\n\n## FAQ\n\n#### How to change the visible child view controller programmatically\n\n`PagerTabStripViewController` provides the following methods to programmatically change the visible child view controller:\n\n```swift\nfunc moveToViewController(at index: Int)\nfunc moveToViewController(at index: Int, animated: Bool)\nfunc moveTo(viewController: UIViewController)\nfunc moveTo(viewController: UIViewController, animated: Bool)\n```\n\n\n#### How to migrate from Swift 2 to Swift 3 \u003Ca name=\"migrate\">\u003C\u002Fa>\n\nCheck out [our migration guide](https:\u002F\u002Fgithub.com\u002Fxmartlabs\u002FXLPagerTabStrip\u002Fblob\u002Fmaster\u002FMigration.md)\n\n## Author\n\n* [Martin Barreto](https:\u002F\u002Fgithub.com\u002FmtnBarreto) ([@mtnBarreto](https:\u002F\u002Ftwitter.com\u002FmtnBarreto))\n\n## Change Log\n\nThis can be found in the [CHANGELOG.md](CHANGELOG.md) file.\n","XLPagerTabStrip 是一个用于 iOS 的容器视图控制器，它模仿了 Android 的 PagerTabStrip 功能。该项目使用 Swift 语言开发，支持通过手势在多个子视图控制器之间平滑切换，并提供当前、前一和下一子视图控制器的交互式指示器。它具备四种不同的分页类型显示方式，其中按钮栏是最常见的形式之一，适用于如社交媒体应用、视频播放平台等多种场景下的导航界面设计。该库兼容 Carthage 和 CocoaPods 管理工具，易于集成到现有项目中。",2,"2026-06-11 03:08:48","top_language"]