Compare commits

Invalid templates have been ignored

1 invalid template(s) found .github/PULL_REQUEST_TEMPLATE.md: 'about' is required

...

188 Commits

Author SHA1 Message Date
iON1k fb7397a961
Merge pull request #2 from TouchInstinct/feature/swift_4_2
Feature/swift 4 2
2018-10-15 16:40:09 +03:00
Anton Popkov a691ba2010 Merge branch 'master' of github.com:xmartlabs/XLPagerTabStrip 2018-10-15 16:31:23 +03:00
Martin Barreto 73ffb21720
Merge pull request #626 from xmartlabs/fix/travis
Update xcode version in Travis config
2018-09-28 11:35:19 -03:00
Mathias Claassen 813e74e466 Update xcode version in Travis config 2018-09-28 11:32:36 -03:00
Martin Barreto f664c9c21c
Merge pull request #580 from dotkebi/readme
# modifiy `README.md` example code
2018-09-28 11:31:02 -03:00
Martin Barreto f0a0c37c76
Merge pull request #612 from ikesyo/update-example-postcell
[Example] Update PostCell to use contentView
2018-09-28 11:29:45 -03:00
Martin Barreto 8f3afd76e4
Merge pull request #614 from ikesyo/patch-1
Fix typo in README
2018-09-28 11:28:57 -03:00
Alexander Khitev 56acdd9401 updated to Swift 4.2 and added swift version to podspec (#617) 2018-09-28 11:02:48 -03:00
Sho Ikeda 7fedf7172a
Fix typo in README 2018-09-10 23:44:43 +09:00
Sho Ikeda 4ad6b8ac56 [Example] Update PostCell to use contentView
We need to place subviews onto UITableViewCell's contentView (to use `UITableViewCell.insetsContentViewsToSafeArea`).
2018-09-05 11:43:05 +09:00
Myoung-jin, Ko 17e7cc1c0a # modifiy `README.md` example code
by swift 4.1 syntax

* UIView.animate
* CGAffineTransform
2018-05-18 12:07:44 +09:00
Myoung-jin, Ko 8a5b93556c # modifiy `README.md` example code
by swift 4.1 syntax

* UIColor.whiteColor() -> UIColor.white
* UIFont.systemFontOfSize(18) -> UIFont.systemFont(ofSize: 18)
2018-05-18 11:12:37 +09:00
Martin Barreto 1619ad4fe1
Update README.md 2018-04-10 14:58:55 -03:00
Martin Barreto 7268f0afec
Merge pull request #500 from ykws/example/495
Add Example Youtube with Label
2018-04-10 14:47:16 -03:00
Martin Barreto 2f2afb62d9
Merge pull request #563 from 432daiki/fix/UIScrollViewDelegate-typo
fix UIScrollViewDelegate typo
2018-04-10 14:25:43 -03:00
Martin Barreto 7647974075
Merge pull request #506 from DenHeadless/patch-1
Fix compilation of the project when using Xcode 9 new build system and CocoaPods
2018-04-10 14:25:11 -03:00
Martin Barreto 2351f06987
Merge pull request #570 from Nixsm/master
Removing deprecated flatMap
2018-04-10 14:22:33 -03:00
Martin Barreto 372e819812
Update .travis.yml 2018-04-10 13:58:17 -03:00
Martin Barreto b56f4ad7e1
Merge pull request #566 from danielpetroianu/8.0.1_deploymentversion_fix
fix deployment target - framework should require iOS 8.0
2018-04-10 13:37:09 -03:00
Nixsm 95f96be31d Removing deprecated flatMap 2018-04-06 11:07:34 -03:00
Daniel Petroianu 3f7b234593 fix deployment target - framework should require iOS 8.0 - broken in 9bcd7cc559 2018-04-03 23:16:29 +03:00
432daiki 83735ac5a5 fix typo 2018-03-30 15:36:43 +09:00
Martin Barreto 04f02d9148 8.0.1 version 2018-03-28 17:51:53 -03:00
Martin Barreto 64a8ef8920
Merge pull request #540 from CodeStage/feature/accessibility
Accessibility traits + labels
2018-03-28 15:27:01 -03:00
Martin Barreto 04212ea5e7
Merge branch 'master' into feature/accessibility 2018-03-28 15:25:18 -03:00
AlexanderGCX a974e6b11a Accessibility for ButtonBarPagerTabStripViewController ButtonBarViewCells (#323)
* add proper accessibility information to ButtonBarPagerTabStripViewController

* mark BarButton as header for accessibility
2018-03-28 15:19:56 -03:00
Martin Barreto 2964d27c44 fix #558 2018-03-28 14:48:14 -03:00
Skye Book 5f398ceb89 docfix for assertion 2018-03-28 14:30:49 -03:00
Ryoga Kitagawa 1896e6873d Fix IndicatorInfo's initializers. 2018-03-28 14:28:14 -03:00
Christian König d0b0d76725 Added accessibility traits 2018-02-10 11:12:48 +01:00
Denys Telezhkin 4fe566f187
Fix compilation of the project when using Xcode 9 new build system and CocoaPods
With current podspec, one .xib file is getting picked up as a source, and is getting into Xcode Compile Sources build step in CocoaPods generated project. 

New build system is more strict than the old one, and prohibits this by saying:

```
error: unexpected duplicate task: CompileXIB /Path-To-Project/Pods/XLPagerTabStrip/Sources/ButtonCell.xib (in target 'XLPagerTabStrip')
```

This behavior is described in [this CocoaPods issue](https://github.com/CocoaPods/CocoaPods/issues/7079).

This PR changes source_files search path from being * to more specific code-related one *.{h,m,swift}, thus picking only sources into sources.

This fix can be verified by installing XLPagerTabStrip, trying to build with new Build System - it will fail. Then you can remove ButtonCell.xib file from Pods -> XLPagerTabStrip -> Compile Sources build phase and this time project will build successfully.
2017-12-14 16:05:40 +02:00
Yoshiyuki Kawashima ae722325b0 Add Example Youtube with Label
Put image above title text

fixes #495
2017-12-08 21:57:24 +09:00
Alexey Gerasimov 9bf01d7d0e
Merge pull request #1 from scoreyou/fix/reloadLayout
IndexPaths duplication on reload fixed
2017-12-06 17:19:21 +03:00
Alexey Gerasimov 2b9877dc68 IndexPaths duplication on reload fixed 2017-12-06 17:18:40 +03:00
pera ce3a0034d3
Merge pull request #391 from xmartlabs/feature/indicator-custom-info
Allow customization for indicators, #378
2017-11-16 12:00:09 -03:00
pera a98448beb2
Merge branch 'master' into feature/indicator-custom-info 2017-11-16 11:57:41 -03:00
Skye Book 248b2cbe5a deledate -> delegate 2017-10-28 17:44:00 -03:00
Martin Barreto 5be0da1c43
Merge pull request #476 from lowki93/feature/Swift4
fix swift 4 version
2017-10-28 17:42:51 -03:00
Kévin Budain 9bcd7cc559 fix swift 4 version 2017-10-25 11:01:42 -04:00
Martin Barreto 835570c855 Merge pull request #454 from mlequeux/master
Proper Bundle loading when linking with static libraries
2017-10-11 10:13:29 -03:00
Martin Barreto 30b9e41f0c Merge pull request #461 from 432daiki/insert_child_5
Insert child_5 into childViewControllers
2017-10-11 10:06:43 -03:00
Martin Barreto 44cefabc12 minor improvement to get pod version from cocoapods repository 2017-10-05 14:50:46 -03:00
pera b67f31b237 Merge pull request #394 from xmartlabs/swift4
Added support for swift 4
2017-10-05 14:19:45 -03:00
pera 342bdecce7 Updated README, CHANGELOG & podspec. 2017-10-05 14:17:18 -03:00
pera 07198bbb9b - Fixed warnings
- Updated to recommended project settings
- Fixed travis
2017-10-05 11:48:37 -03:00
432daiki 711a0cf6e4 Insert child_5 into childViewControllers 2017-10-05 09:53:13 +09:00
Martin Lequeux--Gruninger 3dc83770c3 Proper Bundle loading when linking with static XLPagerTabStrip 2017-09-25 11:51:45 +02:00
Federico Ojeda df0840af3c added support for swift 4 2017-06-07 15:03:44 -03:00
pera 6aede6891a Merge pull request #371 from xmartlabs/feature/swiftlint
Add swiftlint & fixes
2017-05-23 14:10:28 -03:00
pera 0b7dc7fe8c Upgrade travis 2017-05-23 13:28:58 -03:00
pera 21ca6cc08a Add swiftlint & fixes 2017-05-23 11:10:08 -03:00
pera 77da46e1fd Alternative to #378 2017-05-22 14:57:33 -03:00
pera a0c75eb245 Merge pull request #380 from xmartlabs/fix/weak-buttonBar
Fixes weak `buttonBarView`
2017-05-22 13:39:59 -03:00
pera 6d4b55ce79 Fixes weak `buttonBarView` 2017-05-22 11:00:10 -03:00
pera 89b5086ad1 Merge pull request #373 from xmartlabs/fix/issue-322
Fixes #322
2017-05-19 17:06:33 -03:00
pera 2089092533 Merge pull request #368 from xmartlabs/fix/issue-325
Fixes #325
2017-05-11 13:27:50 -03:00
pera 3f5b7b103e Fixes #322 2017-05-10 11:39:00 -03:00
pera e86bef5108 Fixes #325 2017-05-09 17:16:47 -03:00
pera 6c1cc20c9f Merge pull request #367 from xmartlabs/fix/issue-357
Fixes #357
2017-05-08 16:22:31 -03:00
pera 1bda17f09a Fixes #357 2017-05-08 16:21:08 -03:00
pera b77a9a72ce Fixed issue related to #338 2017-05-04 11:39:11 -03:00
pera 7ff9ed7554 Merge pull request #360 from kurebio/fix-scroll-direction
fix to always update lastContentOffset when scrolling
2017-05-03 17:05:44 -03:00
Miguel Revetria 7849d0cc96 Merge pull request #365 from hani-ibrahim/master
Adding `buttonBarMinimumInteritemSpacing`
2017-05-03 16:18:21 -03:00
Miguel Revetria 4c609a92b1 Fixed crash related to #338 2017-05-03 16:16:30 -03:00
pera 6a761b395c Merge pull request #330 from luvacu/selected-bar-vertical-alignment
Add option to set a different vertical alignment for selected bar
2017-05-03 12:59:41 -03:00
hani-ibrahim 2f2a4fc4de adding `buttonBarMinimumInteritemSpacing` 2017-05-03 13:41:18 +02:00
Miguel Revetria 6340728fa9 Update ISSUE_TEMPLATE.md 2017-05-02 16:27:31 -03:00
Miguel Revetria d1ae7d2175 Reload not visible cells when changing current child controller (#359) 2017-05-02 14:26:00 -03:00
d wat ccb76e2fa7 fix to always update lastContentOffset when scrolling 2017-04-29 10:40:55 +09:00
Luis Valdés d42269e5ab Add option to select a different vertical alignment for ButtonBar’s SelectedBar: top, middle or bottom (default). 2017-03-02 22:30:21 +00:00
Martin Barreto 4f2d9d9838 Update README.md 2017-01-27 15:57:57 -03:00
Martin Barreto 7f0ca677a4 Merge pull request #311 from xmartlabs/version/7.0.0
new 7.0.0 version
2017-01-27 13:48:20 -03:00
Martin Barreto 4431b20e0d new 7.0.0 version 2017-01-27 12:59:47 -03:00
Martin Barreto 7225a45c96 Merge pull request #310 from xmartlabs/fix/178
“TwitterPagerTabStripViewController crash on back navigation” fixed. …
2017-01-26 16:51:15 -03:00
Martin Barreto bf8edc820b “TwitterPagerTabStripViewController crash on back navigation” fixed. #178 2017-01-26 16:50:20 -03:00
Martin Barreto 3ecbb5665d Update README.md 2017-01-25 15:10:04 -03:00
Martin Barreto 87d6a5a96e Update README.md 2017-01-25 15:09:25 -03:00
Martin Barreto 14d0788779 Update README.md 2017-01-25 15:05:44 -03:00
Martin Barreto 93bbb990a5 minor fix 2017-01-25 14:46:21 -03:00
Martin Barreto 357d6c7bc6 Merge pull request #246 from abeyuya/fix/ButtonBarView-selectedBar-YPosition
update-selectedBar-yposition-when-use-autolayout
2017-01-25 14:26:06 -03:00
Martin Barreto 9da3e6c32b Merge pull request #280 from mt81/fix-buttonbarview-initializer
Public int(frame: collectionViewLayout:) in ButtonBarView
2017-01-25 14:18:06 -03:00
Martin Barreto 3f6534c494 Merge pull request #306 from xmartlabs/fix/274
fix #274
2017-01-24 19:44:18 -03:00
Martin Barreto 2514be218f fix #274 2017-01-24 19:43:34 -03:00
Martin Barreto 42d25afadf Merge pull request #305 from xmartlabs/issue/277
fix selected bar position issue.
2017-01-24 17:25:04 -03:00
Martin Barreto a4bbb9b209 fix selected bar position issue. 2017-01-24 16:33:08 -03:00
Martin Barreto 77fd23c637 Update README.md 2017-01-23 18:19:10 -03:00
Martin Barreto cb42bfb00c Update README.md 2017-01-23 18:17:38 -03:00
Martin Barreto 91250ed6b0 Merge pull request #303 from xmartlabs/fix/172
Child view controllers lifecycle methods called twice sometimes.
2017-01-23 17:55:43 -03:00
Martin Barreto df6c3ebdd9 fix #172 & #189 2017-01-23 17:54:30 -03:00
Martin Barreto 9f7d4a1517 Merge pull request #285 from Maqix/patch-1
Fix #284
2017-01-23 13:58:01 -03:00
Martin Barreto 8c9acaff30 Merge pull request #286 from gali8/patch-2
Update README.md
2017-01-23 13:53:02 -03:00
g8production ca06917a77 Update README.md 2016-12-14 11:00:26 +01:00
Maqix d9fae65d26 Fix #284 2016-12-09 15:40:47 +01:00
Martin Barreto c66b8ba441 update to recommended settings 2016-12-02 12:53:10 -03:00
Matteo Ugolini 79a4ecc685 Public int(frame: collectionViewLayout:) in ButtonBarView 2016-12-01 12:51:50 -05:00
Mathias Claassen d18a243045 Merge pull request #243 from raphaklr/fix/user_interaction_disabled_when_not_animating
Only disable user interaction when animating (fixes Issue #242)
2016-10-21 09:23:00 -03:00
abeyuya 9bdd6acfbc update-selectedBar-yposition-when-use-autolayout 2016-10-04 14:00:26 +09:00
Raphael Köhler e00a90b671 Only disable user interaction when animating 2016-10-01 15:34:16 +02:00
Martin Barreto d12b4fa6c5 Merge pull request #238 from xmartlabs/fix/carthageLinkingError
Fix/carthage linking error
2016-09-30 12:53:00 -03:00
Martin Barreto eca167e0e3 trying to fix carthage issue #227. 2016-09-28 14:30:23 -03:00
Martin Barreto 8cd01639b6 trying to fix linking error 2016-09-27 15:56:04 -03:00
Martin Barreto 0b3f3244c9 minor framework configuration fixes 2016-09-27 15:28:02 -03:00
Mathias Claassen d0f9fd1a84 release version 6.0.0 2016-09-16 17:53:25 -03:00
Mathias Claassen 794f085a63 Merge pull request #226 from xmartlabs/Swift3
Convert XLPagerTabStrip to Swift 3
2016-09-16 17:47:46 -03:00
Mathias Claassen 9d80d2011b Swiftly function names 2016-09-16 17:36:13 -03:00
Mathias Claassen 1e73449c46 Converted whole project to Xcode 8 and Swift 3 2016-09-14 15:22:17 -03:00
Tomas Radvansky 49f963b687 Swift3 Xcode8 GM Conversion 2016-09-14 15:22:17 -03:00
Mathias Claassen d6011fe0fb release 5.1.0 2016-09-14 14:32:14 -03:00
Mathias Claassen 0dc64e6110 Merge pull request #223 from OpenStack-mobile/master
Updated for Xcode 8
2016-09-14 11:26:21 -03:00
Alsey Coleman Miller dd31ec30fc Updated for Xcode 8 2016-09-13 17:21:27 -05:00
Mathias Claassen 53fee18254 Merge pull request #156 from xmartlabs/fix/userInteraction
fixed issue when user tapped button and scrolled vastly and the bar s…
2016-04-04 18:01:18 -03:00
Mathias Claassen 0fb6e8c6dc fixed issue when user tapped button and scrolled vastly and the bar stayed at the wrong button 2016-04-04 18:00:46 -03:00
Martin Barreto c8bcc9a0c9 Merge pull request #148 from xmartlabs/version_5_0_0
Xcode 7.3 support. Now Swift 2.2 is required.
2016-03-22 22:28:17 -03:00
Martin Barreto f9c767f1b8 Xcode 7.3 support. Now Swift 2.2 is required. 2016-03-22 22:16:38 -03:00
Martin Barreto ea31f3f7e7 Merge branch 'gcutrini-master' 2016-03-22 17:43:27 -03:00
Martin Barreto 38e58c3bf6 solve merge conflicts 2016-03-22 17:42:51 -03:00
Mathias Claassen 54380c5f19 Merge pull request #146 from xmartlabs/fix/buttonBar
use line spacing as interitemspacing in barButtons
2016-03-21 13:06:52 -03:00
Mathias Claassen f37bb7e26a use line spacing as interitemspacing in barButtons 2016-03-21 13:06:09 -03:00
Mathias Claassen 9cd3fa7f9c Merge pull request #144 from xmartlabs/4_0_2
version 4.0.2
2016-03-15 11:40:25 -03:00
Martin Barreto 3e71120c76 version 4.0.2
bug fixes
2016-03-15 11:06:55 -03:00
Martin Barreto be30eda5fc Merge pull request #142 from mrcly/patch-1
Update README.md
2016-03-12 17:40:50 -03:00
Marcel Stolin 34b8186e0c Update README.md 2016-03-12 10:47:31 +01:00
Martin Barreto 29ee45fb17 Merge pull request #140 from xmartlabs/fix/BaseControllerCustomization
BaseButtonBarViewController now sets sectionInset in viewDidLoad
2016-03-07 17:05:48 -03:00
Mathias Claassen 0aa17bb08a BaseButtonBarViewController now sets sectionInset in viewDidLoad 2016-03-07 17:03:30 -03:00
Martin Barreto 877c51ae67 Merge pull request #136 from gali8/patch-1
Update README.md
2016-02-26 12:25:57 -03:00
g8production 326074ca4d Update README.md 2016-02-26 16:15:32 +01:00
Gabriel Cutrini 3d589a0a76 fix container view placement on custom bar height. 2016-02-23 21:05:46 -03:00
Martin Barreto 0e0fc16e07 Merge pull request #127 from chancyWu/bug-fix
Remove wrong observer when deinit
2016-02-18 16:23:17 -03:00
chancyWu cd188e1ec9 Remove wrong observer when deinit 2016-02-16 13:44:40 +08:00
Martin Barreto 06699b84c0 update readme pod version 2016-02-15 19:31:31 -03:00
Martin Barreto 9f61cc978e 4.0.1 pod version. 2016-02-15 19:17:04 -03:00
Martin Barreto bf13f8387d Merge branch 'master' of github.com:xmartlabs/XLPagerTabStrip 2016-02-15 19:06:49 -03:00
Martin Barreto 860e2c3715 added code quality badge to readme. 2016-02-15 19:06:19 -03:00
Martin Barreto e06ba8eea2 Merge pull request #122 from nayzak/master
Changed minimum deployment target from 9.2 to 8.0
2016-02-12 13:08:58 -03:00
Ian Kazlauskas afea837092 min deployment target 8.0 2016-02-12 22:32:20 +09:00
Martin Barreto 4d82d99a1c Merge pull request #120 from nayzak/master
Made ButtonBarPagerTabStripViewController initializer public
2016-02-07 23:13:32 -03:00
Ian Kazlauskas a666b0b943 Made ButtonBarPagerTabStripViewController initializier public instead internal 2016-02-07 18:13:35 +09:00
Martin Barreto 9e0a6930d2 minor fix 2016-02-03 19:46:26 -03:00
Martin Barreto e6366ac68b Merge branch 'master' of github.com:xmartlabs/XLPagerTabStrip 2016-02-03 19:42:35 -03:00
Martin Barreto ac7e6a2b9a clean up code. 2016-02-03 19:42:25 -03:00
Martin Barreto e4ce51a18b Merge pull request #116 from xmartlabs/fixTravis
fix travis CI issue
2016-02-02 22:45:25 -03:00
Martin Barreto 241dc2d442 fix travis CI issue 2016-02-02 22:38:13 -03:00
Martin Barreto 0262ac5ab4 Merge pull request #115 from tailec/master
Small crash fix. Resolves #113
2016-02-02 22:25:14 -03:00
tailec 945d6eab5b Small crash fix. Resolves #113 2016-02-02 19:08:00 +00:00
Martin Barreto f57d272980 fix swift 3 deprecations. 2016-02-02 13:47:41 -03:00
Martin Barreto 9782a0293e Merge pull request #112 from xmartlabs/swift
migration to Swift language
2016-01-30 01:22:12 -03:00
Martin Barreto 0c1964475a minor fix 2016-01-30 01:17:55 -03:00
Martin Barreto 65c1546adf update podspec 2016-01-30 01:07:39 -03:00
Martin Barreto aefbb66e57 replace unavailable function invocation 2016-01-30 01:03:45 -03:00
Martin Barreto aaeabaaa4a Merge pull request #111 from xmartlabs/m-revetria-patch-1
Update README.md
2016-01-30 00:32:15 -03:00
Martin Barreto 7575cdd59b remove throws modifier from protocols. 2016-01-29 22:06:12 -03:00
Martin Barreto 4976a329b3 remove unnecessary Error types 2016-01-29 20:30:56 -03:00
Miguel Revetria 77080ea162 Update README.md
Minor typos fixed
2016-01-29 18:02:20 -03:00
Martin Barreto 6e4a319bb6 fix crash when try to remove observer. 2016-01-29 16:09:24 -03:00
Martin Barreto 17f2e05ae4 add customization readme section. 2016-01-29 15:36:51 -03:00
Martin Barreto 2c88f947fb clean up 2016-01-29 12:44:34 -03:00
Martin Barreto 8784865790 rename types to make them shorter 2016-01-29 01:11:27 -03:00
Martin Barreto 0811a95ada update some class names 2016-01-29 00:31:37 -03:00
Martin Barreto a088f9fcdd refactor pagerOptions 2016-01-28 18:33:38 -03:00
Martin Barreto 5616059712 add some gif examples 2016-01-28 17:17:27 -03:00
Martin Barreto 4b10bcf317 clean up code 2016-01-28 15:14:07 -03:00
Martin Barreto bcd395c2a6 remove public modifier from example project. 2016-01-28 15:02:12 -03:00
Martin Barreto 9018f78c81 added Youtube, Instagram and Spotify Examples. 2016-01-28 14:54:24 -03:00
Martin Barreto c6446c72b9 make currentIndex and viewCOntrollers public. 2016-01-28 14:53:25 -03:00
Martin Barreto 76642790d5 Make ChildItemInfo conforms to StringLiteralConvertible 2016-01-28 14:53:06 -03:00
Martin Barreto 50ccdaa4b8 readme typos. 2016-01-28 14:52:32 -03:00
Martin Barreto 55ce6cdfa8 update readme 2016-01-27 00:24:59 -03:00
Martin Barreto c8a83a27c4 update contributing.md 2016-01-26 15:43:21 -03:00
Martin Barreto cc9a67157d minor fix 2016-01-25 16:21:32 -03:00
Martin Barreto bcaeb4bf89 refactoring code 2016-01-25 16:05:58 -03:00
Martin Barreto b515bafd33 added simpsons images, refactored PostCell 2016-01-25 15:08:31 -03:00
Martin Barreto e0b461e53e Add ability to set up any tab bar view type through view controller generic type. 2016-01-23 18:53:46 -03:00
Martin Barreto a581db7f0c added style settings to BarPagerTabStrip 2016-01-23 12:40:48 -03:00
Martin Barreto 89457994ba clean up code, add ability to set up pager style through settings.style variable 2016-01-22 19:38:55 -03:00
Martin Barreto 0ce8b56f82 Merge branch 'swift' of github.com:xmartlabs/XLPagerTabStrip into swift 2016-01-22 15:52:21 -03:00
Martin Barreto 81ce7a11f4 polish code 2016-01-22 15:52:11 -03:00
Santiago Fernandez e7dedcd42c adds TwitterPagerTabStripViewController & example 2016-01-22 15:23:54 -03:00
Santiago Fernandez aec1610fcb Merge branch 'swift' of github.com:xmartlabs/XLPagerTabStrip into swift 2016-01-22 11:55:10 -03:00
Santiago Fernandez 71f664fe44 adds ButtonBarPagerTabStripController & examples 2016-01-22 11:47:11 -03:00
Martin Barreto 6f5bde2413 clean up PagerTabStripViewController 2016-01-21 16:07:07 -03:00
Martin Barreto bc124e2068 polish code 2016-01-21 14:45:43 -03:00
Martin Barreto 2b620d9578 polish code 2016-01-21 13:09:56 -03:00
Martin Barreto 1a31d5a938 rename pagerTabStripChildViewControllers to viewControllers 2016-01-21 12:56:03 -03:00
Martin Barreto 16c617f21a Merge pull request #109 from xmartlabs/polishCode
polish code
2016-01-21 12:38:05 -03:00
Martin Barreto b5478a2037 polish code 2016-01-21 12:36:07 -03:00
Santiago Fernandez 7265c46b20 wip 2016-01-20 19:13:53 -03:00
Martin Barreto ceb6f843fd work in progress 2016-01-20 16:34:05 -03:00
Santiago Fernandez c0d57d970b initial commit 2016-01-20 12:39:25 -03:00
180 changed files with 6512 additions and 4785 deletions

12
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,12 @@
Before submitting issues ...
- Make sure you are using XLPagerTabStrip [latest release](https://github.com/xmartlabs/XLPagerTabStrip/releases) or master branch version.
- Make sure your Xcode version is the latest stable one.
- Check if the issue was [already reported or fixed](https://github.com/xmartlabs/XLPagerTabStrip/issues?utf8=%E2%9C%93&q=is%3Aissue). We add labels to each issue in order to easily find related issues. If you found a match add a brief comment "I have the same problem" or "+1".
- Please do not use the issue tracker for personal support requests. Stack Overflow is a better place for that where a wider community can help you!
When submitting issues, please provide the following information to help maintainers to fix the problem faster:
- Environment: XLPagerTabStrip, Xcode and iOS version you are using.
- In case of reporting errors, provide Xcode console output of stack trace or code compilation error.
- Any other additional detail such as example code that you think it would be useful to understand, reproduce and solve the problem.

0
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

36
.gitignore vendored
View File

@ -1,6 +1,11 @@
# Xcode
## OS X Finder
.DS_Store
## Build generated
build/
DerivedData
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
@ -10,17 +15,40 @@ build/
*.perspectivev3
!default.perspectivev3
xcuserdata
## Other
*.xccheckout
*.moved-aside
DerivedData
*.xcuserstate
*.xcscmblueprint
## Obj-C/Swift specific
*.hmap
*.ipa
*.xcuserstate
## Playgrounds
timeline.xctimeline
playground.xcworkspace
# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
.build/
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Build
.swift-version

51
.swiftlint.yml Normal file
View File

@ -0,0 +1,51 @@
disabled_rules: # rule identifiers to exclude from running
# - colon
# - comma
# - control_statement
- line_length
- function_body_length
- identifier_name
- type_name
- large_tuple
opt_in_rules: # some rules are only opt-in
- empty_count
# Find all the available rules by running:
# swiftlint rules
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Carthage
- Pods
- Source/ExcludedFolder
- Source/ExcludedFile.swift
# configurable rules can be customized from this configuration file
# binary rules can set their severity level
force_cast: warning # implicitly
force_try:
severity: warning # explicitly
# rules that have both warning and error levels, can set just the warning level
# implicitly
line_length: 200
# they can set both implicitly with an array
type_body_length:
- 300 # warning
- 400 # error
# or they can set both explicitly
file_length:
warning: 500
error: 1200
# naming rules can set warnings/errors for min_length and max_length
# additionally they can set excluded names
type_name:
min_length: 4 # only warning
max_length: # warning and error
warning: 40
error: 50
excluded: iPhone # excluded via string
identifier_name:
min_length: # only min_length
error: 4 # only error
excluded: # excluded via string array
- id
- URL
- GlobalAPIKey
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, junit, html, emoji)

16
.travis.yml Normal file
View File

@ -0,0 +1,16 @@
language: objective-c
osx_image: xcode10
env:
- DESTINATION="OS=12,name=iPhone 8" SCHEME="XLPagerTabStrip" SDK=iphonesimulator
before_install:
- brew update
#- brew outdated carthage || brew upgrade carthage
- if brew outdated | grep -qx xctool; then brew upgrade xctool; fi
#- carthage update --platform iOS
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
script:
- xcodebuild clean build -project XLPagerTabStrip.xcodeproj -scheme "$SCHEME" -sdk "$SDK"
#- xcodebuild test -project XLPagerTabStrip.xcodeproj -scheme "$SCHEME" -sdk "$SDK"
- xcodebuild -project XLPagerTabStrip.xcodeproj -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION"
-configuration Debug ONLY_ACTIVE_ARCH=NO test | xcpretty -c

77
CHANGELOG.md Normal file
View File

@ -0,0 +1,77 @@
# Change Log
All notable changes to XLPagerTabStrip will be documented in this file.
### [8.0.1](https://github.com/xmartlabs/XLPagerTabStrip/releases/tag/8.0.1)
* Bug fixes and stability improvements.
* Support for iPhone X.
### [8.0.0](https://github.com/xmartlabs/XLPagerTabStrip/releases/tag/8.0.0)
* Xcode 9 support. (Swift 4)
* Bug fixes and stability improvements.
### [7.0.0](https://github.com/xmartlabs/XLPagerTabStrip/releases/tag/7.0.0)
* Bug fixes and stability improvements.
### [6.0.0](https://github.com/xmartlabs/XLPagerTabStrip/releases/tag/6.0.0)
* Swift 3 support
* **Breaking change**: Swiftified names of functions (you can see more details about it [here](https://github.com/xmartlabs/XLPagerTabStrip/Migration.md))
### [5.1.0](https://github.com/xmartlabs/XLPagerTabStrip/releases/tag/5.0.0)
* Xcode 8 support. (Swift 2.3)
### [5.0.0](https://github.com/xmartlabs/XLPagerTabStrip/releases/tag/5.0.0)
* Xcode 7.3 support.
* Bug fixes and stability improvements.
### [4.0.2](https://github.com/xmartlabs/XLPagerTabStrip/releases/tag/4.0.2)
* Bug fixes
### [4.0.1](https://github.com/xmartlabs/XLPagerTabStrip/releases/tag/4.0.1)
* Bug fixes and stability improvements
### [4.0.0](https://github.com/xmartlabs/XLPagerTabStrip/releases/tag/4.0.0)
<!-- Released on 2016-01-20. -->
* Base code migration from obj-c to swift.
* Removed XL prefix from all types.
### [3.0.0](https://github.com/xmartlabs/XLPagerTabStrip/releases/tag/3.0.0)
* `selectedBarAlignment` added to `XLButtonBarView`.
* `shouldCellsFillAvailableWidth` added to `XLButtonBarView`.
* Bug fixes and Stability improvements.
### [2.0.0](https://github.com/xmartlabs/XLPagerTabStrip/releases/tag/v2.0.0)
* Added ability to change look and feel of selected tab.
* `changeCurrentIndexProgressiveBlock` added to `XLButtonBarPagerTabStripViewController`.
* `changeCurrentIndexBlock` added to `XLButtonBarPagerTabStripViewController`.
* indxWasChanged parameter was added to `-(void)pagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController updateIndicatorFromIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex withProgressPercentage:(CGFloat)progressPercentage indexWasChanged:(BOOL)indexWasChanged;`
* Bug Fix Issue #45: When the current tab is tapped by the user, and later swiping to another tab, the indicator now changes as expected.
* Bug Fix: When scrolling between tabs with progressive indicator, the indicator now scrolls swiftly. It used to jump for an instant.
* Bug Fix Issue #54: Twitter PagerTabStrip wasn't loading the navigation title correctly.
* Bug Fix Issue #32: Demo for Nav Button Bar Example fix.
* Bug Fix Issue #32: Twitter Pager white dots that mark which tab is currently selected is non selectable now.
* Bug Fix Issue #22: moveToViewControllerAtIndex: in viewDidLoad or viewWillAppear is not reflected in buttonBarView.
### [1.1.1](https://github.com/xmartlabs/XLPagerTabStrip/releases/tag/v1.1.1)
* Nav Button example added
* Support for iOS 7.0 and above
### [1.1.0](https://github.com/xmartlabs/XLPagerTabStrip/releases/tag/v1.1.0)
* Twitter pager added
* Bug fixes and stability improvements
### [1.0.0](https://github.com/xmartlabs/XLPagerTabStrip/releases/tag/v1.0.0)
* Initial release

61
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,61 @@
Contributing Guidelines
--------------------------------------------------
This document provides general guidelines about how to contribute to the project. Keep in mind these important things before you start contributing.
### Asking Questions
We do not use github issues for general library support. We think this questions should be posted on stack overflow using [XlPagerTabStrip](http://http://stackoverflow.com/questions/tagged/xlpagertabstrip) tag.
### Reporting issues
* Use [github issues](https://github.com/xmartlabs/XLPagerTabStrip/issues) to report a bug.
* Before creating a new issue:
* Make sure you are using the [latest release](https://github.com/xmartlabs/XLPagerTabStrip/releases).
* Check if the issue was [already reported or fixed](https://github.com/xmartlabs/XLPagerTabStrip/issues?utf8=%E2%9C%93&q=is%3Aissue). Notice that it may not be released yet.
* If you found a match add a brief comment "I have the same problem" or "+1". This helps prioritize the issues addressing the most common and critical first. If possible add additional information to help us reproduce and fix the issue. Please use your best judgement.
* Reporting issues:
* Please include the following information to help maintainers to fix the problem faster:
* Xcode version you are using.
* iOS version you are targeting.
* Full Xcode console output of stack trace or code compilation error.
* Any other additional detail you think it would be useful to understand and solve the problem.
### Pull requests
The easiest way to start contributing is searching open issues by `help wanted` tag. We also add a `difficulty` tag (difficulty: easy, difficulty: moderate, difficulty: hard) in order to give an idea of how complex it can be to implement the feature according maintainers project experience.
* Add test coverage to the feature or fix. We only accept new feature pull requests that have related test coverage. This allows us to keep the library stable as we move forward.
* Remember to document the new feature. We do not accept new feature pull requests without its associated documentation.
* In case of a new feature please update the example project showing the feature.
* Please only one fix or feature per pull request. This will increase the chances your feature will be merged.
###### Suggested git workflow to contribute
1. Fork the XLPagerTabStrip repository.
2. Clone your forked project into your developer machine: `git clone git@github.com:<your-github-username>/XLPagerTabStrip.git`
3. Add the original project repo as upstream repository in your forked project: `git remote add upstream git@github.com:xmartlabs/XLPagerTabStrip.git`
4. Before starting a new feature make sure your forked master branch is synchronized upstream master branch. Considering you do not mere your pull request into master you can run: `git checkout master` and then `git pull upstream master`. Optionally `git push origin master`.
5. Create a new branch. Note that the starting point is the upstream master branch HEAD. `git checkout -b my-feature-name`
6. Stage all your changes `git add .` and commit them `git commit -m "Your commit message"`
7. Make sure your branch is up to date with upstream master, `git pull --rebase upstream master`, resolve conflicts if necessary. This will move your commit to the top of git stack.
8. Squash your commits into one commit. `git rebase -i HEAD~6` considering you did 6 commits.
9. Push your branch into your forked remote repository.
10. Create a new pull request adding any useful comment.
###### Code style and conventions
We try to follow our [swift style guide](https://github.com/xmartlabs/Swift-Style-Guide). Following it is not strictly necessary to contribute and to have a pull request accepted but project maintainers try to follow it. We would love to hear your ideas to improve our code style and conventions. Feel free to contribute.
### Feature proposal
We would love to hear your ideas and make a discussions about it.
* Use github issues to make feature proposals.
* We use `type: feature request` label to mark all [feature request issues](https://github.com/xmartlabs/XLPagerTabStrip/labels/type%3A%20feature%20request).
* Before submitting your proposal make sure there is no similar feature request. If you found a match feel free to join the discussion or just add a brief "+1" if you think the feature is worth implementing.
* Be as specific as possible providing a precise explanation of feature request so anyone can understand the problem and the benefits of solving it.

2
Cartfile.private Normal file
View File

@ -0,0 +1,2 @@
github "Quick/Quick"
github "Quick/Nimble"

View File

@ -0,0 +1,649 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
1F081A9E1FDABD1400B881EB /* YoutubeIconWithLabelCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F081A9B1FDABD1400B881EB /* YoutubeIconWithLabelCell.swift */; };
1F081A9F1FDABD1400B881EB /* YoutubeIconWithLabelCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1F081A9C1FDABD1400B881EB /* YoutubeIconWithLabelCell.xib */; };
1F081AA01FDABD1400B881EB /* YoutubeWithLabelExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F081A9D1FDABD1400B881EB /* YoutubeWithLabelExampleViewController.swift */; };
285718181C568336004D7E7B /* DataProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 285718171C568336004D7E7B /* DataProvider.swift */; };
285DA2881C569AA2000908CA /* ChildExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 285DA2861C569AA2000908CA /* ChildExampleViewController.swift */; };
285DA2891C569AA2000908CA /* TableChildExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 285DA2871C569AA2000908CA /* TableChildExampleViewController.swift */; };
285DA28C1C592154000908CA /* InstagramExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 285DA28B1C592154000908CA /* InstagramExampleViewController.swift */; };
285DA2901C59C587000908CA /* SpotifyExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 285DA28F1C59C587000908CA /* SpotifyExampleViewController.swift */; };
285DA2931C5A596B000908CA /* YoutubeExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 285DA2921C5A596B000908CA /* YoutubeExampleViewController.swift */; };
285DA2951C5A6A00000908CA /* YoutubeIconCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 285DA2941C5A6A00000908CA /* YoutubeIconCell.swift */; };
285DA2971C5A6A36000908CA /* YoutubeIconCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 285DA2961C5A6A36000908CA /* YoutubeIconCell.xib */; };
287D0A721C4B7877004566D6 /* ExampleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 287D0A711C4B7877004566D6 /* ExampleUITests.swift */; };
287D0A7D1C4B7B55004566D6 /* XLPagerTabStrip.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 287D0A7A1C4B7B26004566D6 /* XLPagerTabStrip.framework */; };
287D0A7E1C4B7B55004566D6 /* XLPagerTabStrip.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 287D0A7A1C4B7B26004566D6 /* XLPagerTabStrip.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
28F828D01C4B714D00330CF4 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28F828CF1C4B714D00330CF4 /* AppDelegate.swift */; };
CB2125DE1C52A80E002DAF42 /* TwitterExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB2125DD1C52A80E002DAF42 /* TwitterExampleViewController.swift */; };
CB3697BF1C5177B4001FC5F8 /* ButtonBarExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB3697BE1C5177B4001FC5F8 /* ButtonBarExampleViewController.swift */; };
CB71C6EB1C4EB964008EC806 /* SegmentedExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB71C6EA1C4EB964008EC806 /* SegmentedExampleViewController.swift */; };
CB71C6F31C4FDDCE008EC806 /* PostCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB71C6F21C4FDDCE008EC806 /* PostCell.swift */; };
CB86ED801C4D6F0D00DA463B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CB86ED6F1C4D6F0D00DA463B /* Assets.xcassets */; };
CB86ED811C4D6F0D00DA463B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CB86ED711C4D6F0D00DA463B /* LaunchScreen.storyboard */; };
CB86ED941C4E89DD00DA463B /* PostCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = CB86ED931C4E89DD00DA463B /* PostCell.xib */; };
CBA0A1FF1C50304500C5748C /* BarExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBA0A1FE1C50304500C5748C /* BarExampleViewController.swift */; };
CBA0A2021C5032E100C5748C /* Storyboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CBA0A2011C5032E100C5748C /* Storyboard.storyboard */; };
CBA0A2041C5033B400C5748C /* ReloadExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBA0A2031C5033B400C5748C /* ReloadExampleViewController.swift */; };
CBBD435F1C5274AE001A748E /* NavButtonBarExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBBD435E1C5274AE001A748E /* NavButtonBarExampleViewController.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
287D0A791C4B7B26004566D6 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 287D0A741C4B7B26004566D6 /* XLPagerTabStrip.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 28F8287D1C494B2C00330CF4;
remoteInfo = XLPagerTabStrip;
};
287D0A7B1C4B7B26004566D6 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 287D0A741C4B7B26004566D6 /* XLPagerTabStrip.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 28F828871C494B2C00330CF4;
remoteInfo = XLPagerTabStripTests;
};
287D0A7F1C4B7B55004566D6 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 287D0A741C4B7B26004566D6 /* XLPagerTabStrip.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 28F8287C1C494B2C00330CF4;
remoteInfo = XLPagerTabStrip;
};
28F828E11C4B714D00330CF4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 28F828C41C4B714D00330CF4 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 28F828CB1C4B714D00330CF4;
remoteInfo = Example;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
287D0A811C4B7B55004566D6 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
287D0A7E1C4B7B55004566D6 /* XLPagerTabStrip.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
1F081A9B1FDABD1400B881EB /* YoutubeIconWithLabelCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YoutubeIconWithLabelCell.swift; sourceTree = "<group>"; };
1F081A9C1FDABD1400B881EB /* YoutubeIconWithLabelCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = YoutubeIconWithLabelCell.xib; sourceTree = "<group>"; };
1F081A9D1FDABD1400B881EB /* YoutubeWithLabelExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YoutubeWithLabelExampleViewController.swift; sourceTree = "<group>"; };
285718171C568336004D7E7B /* DataProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DataProvider.swift; path = Example/Helpers/DataProvider.swift; sourceTree = "<group>"; };
285DA2861C569AA2000908CA /* ChildExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ChildExampleViewController.swift; path = Example/ChildControllers/ChildExampleViewController.swift; sourceTree = "<group>"; };
285DA2871C569AA2000908CA /* TableChildExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TableChildExampleViewController.swift; path = Example/ChildControllers/TableChildExampleViewController.swift; sourceTree = "<group>"; };
285DA28B1C592154000908CA /* InstagramExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = InstagramExampleViewController.swift; path = Example/Instagram/InstagramExampleViewController.swift; sourceTree = "<group>"; };
285DA28F1C59C587000908CA /* SpotifyExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SpotifyExampleViewController.swift; sourceTree = "<group>"; };
285DA2921C5A596B000908CA /* YoutubeExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = YoutubeExampleViewController.swift; path = Example/Youtube/YoutubeExampleViewController.swift; sourceTree = "<group>"; };
285DA2941C5A6A00000908CA /* YoutubeIconCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = YoutubeIconCell.swift; path = Example/Youtube/YoutubeIconCell.swift; sourceTree = "<group>"; };
285DA2961C5A6A36000908CA /* YoutubeIconCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = YoutubeIconCell.xib; path = Example/Youtube/YoutubeIconCell.xib; sourceTree = "<group>"; };
287D0A711C4B7877004566D6 /* ExampleUITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ExampleUITests.swift; path = Example/ExampleUITests/ExampleUITests.swift; sourceTree = SOURCE_ROOT; };
287D0A741C4B7B26004566D6 /* XLPagerTabStrip.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = XLPagerTabStrip.xcodeproj; sourceTree = "<group>"; };
28F828CC1C4B714D00330CF4 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
28F828CF1C4B714D00330CF4 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = Example/AppDelegate.swift; sourceTree = "<group>"; };
28F828DB1C4B714D00330CF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Example/Info.plist; sourceTree = "<group>"; };
28F828E01C4B714D00330CF4 /* ExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
28F828E61C4B714D00330CF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; name = Info.plist; path = Example/ExampleUITests/Info.plist; sourceTree = "<group>"; };
CB2125DD1C52A80E002DAF42 /* TwitterExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TwitterExampleViewController.swift; path = Example/TwitterExampleViewController.swift; sourceTree = "<group>"; };
CB3697BE1C5177B4001FC5F8 /* ButtonBarExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ButtonBarExampleViewController.swift; path = Example/Example/ButtonBarExampleViewController.swift; sourceTree = SOURCE_ROOT; };
CB71C6EA1C4EB964008EC806 /* SegmentedExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SegmentedExampleViewController.swift; path = Example/SegmentedExampleViewController.swift; sourceTree = "<group>"; };
CB71C6F21C4FDDCE008EC806 /* PostCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PostCell.swift; path = Example/Helpers/PostCell.swift; sourceTree = "<group>"; };
CB86ED6F1C4D6F0D00DA463B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Example/Assets.xcassets; sourceTree = "<group>"; };
CB86ED721C4D6F0D00DA463B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
CB86ED931C4E89DD00DA463B /* PostCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = PostCell.xib; path = Example/Helpers/PostCell.xib; sourceTree = "<group>"; };
CBA0A1FE1C50304500C5748C /* BarExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = BarExampleViewController.swift; path = Example/BarExampleViewController.swift; sourceTree = "<group>"; };
CBA0A2011C5032E100C5748C /* Storyboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Storyboard.storyboard; sourceTree = "<group>"; };
CBA0A2031C5033B400C5748C /* ReloadExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ReloadExampleViewController.swift; path = Example/ReloadExampleViewController.swift; sourceTree = "<group>"; };
CBBD435E1C5274AE001A748E /* NavButtonBarExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = NavButtonBarExampleViewController.swift; path = Example/NavButtonBarExampleViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
28F828C91C4B714D00330CF4 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
287D0A7D1C4B7B55004566D6 /* XLPagerTabStrip.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
28F828DD1C4B714D00330CF4 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
1F081A9A1FDABD1400B881EB /* YoutubeWithLabel */ = {
isa = PBXGroup;
children = (
1F081A9B1FDABD1400B881EB /* YoutubeIconWithLabelCell.swift */,
1F081A9C1FDABD1400B881EB /* YoutubeIconWithLabelCell.xib */,
1F081A9D1FDABD1400B881EB /* YoutubeWithLabelExampleViewController.swift */,
);
name = YoutubeWithLabel;
path = Example/YoutubeWithLabel;
sourceTree = "<group>";
};
285718151C568285004D7E7B /* Helpers */ = {
isa = PBXGroup;
children = (
CB86ED931C4E89DD00DA463B /* PostCell.xib */,
CB71C6F21C4FDDCE008EC806 /* PostCell.swift */,
285718171C568336004D7E7B /* DataProvider.swift */,
);
name = Helpers;
sourceTree = "<group>";
};
285DA2841C569A3E000908CA /* ChildControllers */ = {
isa = PBXGroup;
children = (
285DA2861C569AA2000908CA /* ChildExampleViewController.swift */,
285DA2871C569AA2000908CA /* TableChildExampleViewController.swift */,
);
name = ChildControllers;
sourceTree = "<group>";
};
285DA28A1C59210F000908CA /* Instagram */ = {
isa = PBXGroup;
children = (
285DA28B1C592154000908CA /* InstagramExampleViewController.swift */,
);
name = "Instagram ";
sourceTree = "<group>";
};
285DA28E1C59C587000908CA /* Spotify */ = {
isa = PBXGroup;
children = (
285DA28F1C59C587000908CA /* SpotifyExampleViewController.swift */,
);
name = Spotify;
path = Example/Spotify;
sourceTree = "<group>";
};
285DA2911C5A5945000908CA /* Youtube */ = {
isa = PBXGroup;
children = (
285DA2921C5A596B000908CA /* YoutubeExampleViewController.swift */,
285DA2941C5A6A00000908CA /* YoutubeIconCell.swift */,
285DA2961C5A6A36000908CA /* YoutubeIconCell.xib */,
);
name = Youtube;
sourceTree = "<group>";
};
287D0A751C4B7B26004566D6 /* Products */ = {
isa = PBXGroup;
children = (
287D0A7A1C4B7B26004566D6 /* XLPagerTabStrip.framework */,
287D0A7C1C4B7B26004566D6 /* XLPagerTabStripTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
28F828C31C4B714D00330CF4 = {
isa = PBXGroup;
children = (
28F828CE1C4B714D00330CF4 /* Example */,
28F828E31C4B714D00330CF4 /* ExampleUITests */,
28F828CD1C4B714D00330CF4 /* Products */,
287D0A741C4B7B26004566D6 /* XLPagerTabStrip.xcodeproj */,
);
sourceTree = "<group>";
};
28F828CD1C4B714D00330CF4 /* Products */ = {
isa = PBXGroup;
children = (
28F828CC1C4B714D00330CF4 /* Example.app */,
28F828E01C4B714D00330CF4 /* ExampleUITests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
28F828CE1C4B714D00330CF4 /* Example */ = {
isa = PBXGroup;
children = (
CB86ED6C1C4D6ED400DA463B /* Demo */,
28F828CF1C4B714D00330CF4 /* AppDelegate.swift */,
28F828DB1C4B714D00330CF4 /* Info.plist */,
);
path = Example;
sourceTree = "<group>";
};
28F828E31C4B714D00330CF4 /* ExampleUITests */ = {
isa = PBXGroup;
children = (
28F828E61C4B714D00330CF4 /* Info.plist */,
287D0A711C4B7877004566D6 /* ExampleUITests.swift */,
);
path = ExampleUITests;
sourceTree = "<group>";
};
CB86ED6C1C4D6ED400DA463B /* Demo */ = {
isa = PBXGroup;
children = (
1F081A9A1FDABD1400B881EB /* YoutubeWithLabel */,
285DA2911C5A5945000908CA /* Youtube */,
285DA28E1C59C587000908CA /* Spotify */,
285DA28A1C59210F000908CA /* Instagram */,
285DA2841C569A3E000908CA /* ChildControllers */,
285718151C568285004D7E7B /* Helpers */,
CB86ED701C4D6F0D00DA463B /* Base.lproj */,
CB86ED6F1C4D6F0D00DA463B /* Assets.xcassets */,
CB71C6EA1C4EB964008EC806 /* SegmentedExampleViewController.swift */,
CB3697BE1C5177B4001FC5F8 /* ButtonBarExampleViewController.swift */,
CBA0A1FE1C50304500C5748C /* BarExampleViewController.swift */,
CBA0A2031C5033B400C5748C /* ReloadExampleViewController.swift */,
CBBD435E1C5274AE001A748E /* NavButtonBarExampleViewController.swift */,
CB2125DD1C52A80E002DAF42 /* TwitterExampleViewController.swift */,
);
name = Demo;
sourceTree = "<group>";
};
CB86ED701C4D6F0D00DA463B /* Base.lproj */ = {
isa = PBXGroup;
children = (
CBA0A2011C5032E100C5748C /* Storyboard.storyboard */,
CB86ED711C4D6F0D00DA463B /* LaunchScreen.storyboard */,
);
name = Base.lproj;
path = Example/Base.lproj;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
28F828CB1C4B714D00330CF4 /* Example */ = {
isa = PBXNativeTarget;
buildConfigurationList = 28F828E91C4B714D00330CF4 /* Build configuration list for PBXNativeTarget "Example" */;
buildPhases = (
28F828C81C4B714D00330CF4 /* Sources */,
28F828C91C4B714D00330CF4 /* Frameworks */,
28F828CA1C4B714D00330CF4 /* Resources */,
287D0A811C4B7B55004566D6 /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
287D0A801C4B7B55004566D6 /* PBXTargetDependency */,
);
name = Example;
productName = Example;
productReference = 28F828CC1C4B714D00330CF4 /* Example.app */;
productType = "com.apple.product-type.application";
};
28F828DF1C4B714D00330CF4 /* ExampleUITests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 28F828EC1C4B714D00330CF4 /* Build configuration list for PBXNativeTarget "ExampleUITests" */;
buildPhases = (
28F828DC1C4B714D00330CF4 /* Sources */,
28F828DD1C4B714D00330CF4 /* Frameworks */,
28F828DE1C4B714D00330CF4 /* Resources */,
);
buildRules = (
);
dependencies = (
28F828E21C4B714D00330CF4 /* PBXTargetDependency */,
);
name = ExampleUITests;
productName = ExampleUITests;
productReference = 28F828E01C4B714D00330CF4 /* ExampleUITests.xctest */;
productType = "com.apple.product-type.bundle.ui-testing";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
28F828C41C4B714D00330CF4 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0900;
TargetAttributes = {
28F828CB1C4B714D00330CF4 = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0900;
};
28F828DF1C4B714D00330CF4 = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0900;
TestTargetID = 28F828CB1C4B714D00330CF4;
};
};
};
buildConfigurationList = 28F828C71C4B714D00330CF4 /* Build configuration list for PBXProject "Example" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 28F828C31C4B714D00330CF4;
productRefGroup = 28F828CD1C4B714D00330CF4 /* Products */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = 287D0A751C4B7B26004566D6 /* Products */;
ProjectRef = 287D0A741C4B7B26004566D6 /* XLPagerTabStrip.xcodeproj */;
},
);
projectRoot = "";
targets = (
28F828CB1C4B714D00330CF4 /* Example */,
28F828DF1C4B714D00330CF4 /* ExampleUITests */,
);
};
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
287D0A7A1C4B7B26004566D6 /* XLPagerTabStrip.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = XLPagerTabStrip.framework;
remoteRef = 287D0A791C4B7B26004566D6 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
287D0A7C1C4B7B26004566D6 /* XLPagerTabStripTests.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = XLPagerTabStripTests.xctest;
remoteRef = 287D0A7B1C4B7B26004566D6 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
28F828CA1C4B714D00330CF4 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CB86ED801C4D6F0D00DA463B /* Assets.xcassets in Resources */,
CB86ED941C4E89DD00DA463B /* PostCell.xib in Resources */,
CBA0A2021C5032E100C5748C /* Storyboard.storyboard in Resources */,
1F081A9F1FDABD1400B881EB /* YoutubeIconWithLabelCell.xib in Resources */,
CB86ED811C4D6F0D00DA463B /* LaunchScreen.storyboard in Resources */,
285DA2971C5A6A36000908CA /* YoutubeIconCell.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
28F828DE1C4B714D00330CF4 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
28F828C81C4B714D00330CF4 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
285DA28C1C592154000908CA /* InstagramExampleViewController.swift in Sources */,
CB71C6EB1C4EB964008EC806 /* SegmentedExampleViewController.swift in Sources */,
28F828D01C4B714D00330CF4 /* AppDelegate.swift in Sources */,
CBA0A2041C5033B400C5748C /* ReloadExampleViewController.swift in Sources */,
285DA2901C59C587000908CA /* SpotifyExampleViewController.swift in Sources */,
CB3697BF1C5177B4001FC5F8 /* ButtonBarExampleViewController.swift in Sources */,
285DA2881C569AA2000908CA /* ChildExampleViewController.swift in Sources */,
CBA0A1FF1C50304500C5748C /* BarExampleViewController.swift in Sources */,
285718181C568336004D7E7B /* DataProvider.swift in Sources */,
CB2125DE1C52A80E002DAF42 /* TwitterExampleViewController.swift in Sources */,
285DA2891C569AA2000908CA /* TableChildExampleViewController.swift in Sources */,
1F081A9E1FDABD1400B881EB /* YoutubeIconWithLabelCell.swift in Sources */,
CBBD435F1C5274AE001A748E /* NavButtonBarExampleViewController.swift in Sources */,
CB71C6F31C4FDDCE008EC806 /* PostCell.swift in Sources */,
285DA2931C5A596B000908CA /* YoutubeExampleViewController.swift in Sources */,
285DA2951C5A6A00000908CA /* YoutubeIconCell.swift in Sources */,
1F081AA01FDABD1400B881EB /* YoutubeWithLabelExampleViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
28F828DC1C4B714D00330CF4 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
287D0A721C4B7877004566D6 /* ExampleUITests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
287D0A801C4B7B55004566D6 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = XLPagerTabStrip;
targetProxy = 287D0A7F1C4B7B55004566D6 /* PBXContainerItemProxy */;
};
28F828E21C4B714D00330CF4 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 28F828CB1C4B714D00330CF4 /* Example */;
targetProxy = 28F828E11C4B714D00330CF4 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
CB86ED711C4D6F0D00DA463B /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
CB86ED721C4D6F0D00DA463B /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
28F828E71C4B714D00330CF4 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
28F828E81C4B714D00330CF4 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
28F828EA1C4B714D00330CF4 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
INFOPLIST_FILE = "$(SRCROOT)/Example/Example/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
28F828EB1C4B714D00330CF4 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
INFOPLIST_FILE = "$(SRCROOT)/Example/Example/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Release;
};
28F828ED1C4B714D00330CF4 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
INFOPLIST_FILE = Example/ExampleUITests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.ExampleUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
TEST_TARGET_NAME = Example;
USES_XCTRUNNER = YES;
};
name = Debug;
};
28F828EE1C4B714D00330CF4 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
INFOPLIST_FILE = Example/ExampleUITests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.ExampleUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
TEST_TARGET_NAME = Example;
USES_XCTRUNNER = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
28F828C71C4B714D00330CF4 /* Build configuration list for PBXProject "Example" */ = {
isa = XCConfigurationList;
buildConfigurations = (
28F828E71C4B714D00330CF4 /* Debug */,
28F828E81C4B714D00330CF4 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
28F828E91C4B714D00330CF4 /* Build configuration list for PBXNativeTarget "Example" */ = {
isa = XCConfigurationList;
buildConfigurations = (
28F828EA1C4B714D00330CF4 /* Debug */,
28F828EB1C4B714D00330CF4 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
28F828EC1C4B714D00330CF4 /* Build configuration list for PBXNativeTarget "ExampleUITests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
28F828ED1C4B714D00330CF4 /* Debug */,
28F828EE1C4B714D00330CF4 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 28F828C41C4B714D00330CF4 /* Project object */;
}

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:Example.xcodeproj">
</FileRef>
</Workspace>

View File

@ -0,0 +1,48 @@
//
// AppDelegate.swift
// Example
//
// Copyright © 2016 Xmartlabs SRL. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
UITabBar.appearance().tintColor = UIColor.init(red: 0.027, green: 0.725, blue: 0.608, alpha: 1)
UIApplication.shared.statusBarStyle = .lightContent
_ = YoutubeExampleViewController(nibName: nil, bundle: nil)
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}

View File

@ -1,21 +1,38 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"idiom" : "iphone",
"filename" : "xl_appicon_58.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"idiom" : "iphone",
"filename" : "xl_appicon_80.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "xl_appicon_120.png",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{

View File

@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -2,8 +2,8 @@
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "Apu_Nahasapeemapetilon.png"
"filename" : "Apu_Nahasapeemapetilon.png",
"scale" : "1x"
},
{
"idiom" : "universal",

View File

@ -2,8 +2,8 @@
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "Lisa_Simpsons.png"
"filename" : "Bart_Simpsons.png",
"scale" : "1x"
},
{
"idiom" : "universal",

View File

@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -2,8 +2,8 @@
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "Homer_Simpsons.png"
"filename" : "Homer_Simpsons.png",
"scale" : "1x"
},
{
"idiom" : "universal",

View File

@ -2,8 +2,8 @@
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "Bart_Simpsons.png"
"filename" : "Lisa_Simpsons.png",
"scale" : "1x"
},
{
"idiom" : "universal",

View File

@ -2,8 +2,8 @@
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "Maggie_Simpsons.png"
"filename" : "Maggie_Simpsons.png",
"scale" : "1x"
},
{
"idiom" : "universal",

View File

@ -2,8 +2,8 @@
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "Marge_Simpsons.png"
"filename" : "Marge_Simpsons.png",
"scale" : "1x"
},
{
"idiom" : "universal",

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Montgomery_Burns.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -2,8 +2,8 @@
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "Ned_Flanders.png"
"filename" : "Ned_Flanders.png",
"scale" : "1x"
},
{
"idiom" : "universal",

View File

@ -2,8 +2,8 @@
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "Otto_Mann.png"
"filename" : "Otto_Mann.png",
"scale" : "1x"
},
{
"idiom" : "universal",

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "default-avatar@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "a_bar.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "a_bar@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

Before

Width:  |  Height:  |  Size: 244 B

After

Width:  |  Height:  |  Size: 244 B

View File

Before

Width:  |  Height:  |  Size: 293 B

After

Width:  |  Height:  |  Size: 293 B

View File

@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "a_button.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "a_button@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

Before

Width:  |  Height:  |  Size: 282 B

After

Width:  |  Height:  |  Size: 282 B

View File

@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "a_segmented.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "a_segmented@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "a_twitter.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "a_twitter@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

Before

Width:  |  Height:  |  Size: 421 B

After

Width:  |  Height:  |  Size: 421 B

View File

@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "home@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 946 B

View File

@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "more_options@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "more_options@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "profile@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "search@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "search@2x-1.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "trending@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,78 @@
// BarExampleViewController.swift
// XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip )
//
// Copyright (c) 2017 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import Foundation
import XLPagerTabStrip
class BarExampleViewController: BarPagerTabStripViewController {
var isReload = false
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
override func viewDidLoad() {
// set up style before super view did load is executed
settings.style.selectedBarBackgroundColor = .orange
// -
super.viewDidLoad()
}
// MARK: - PagerTabStripDataSource
override func viewControllers(for 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")
let child_4 = ChildExampleViewController(itemInfo: "View 2")
guard isReload else {
return [child_1, child_2, child_3, child_4]
}
var childViewControllers = [child_1, child_2, child_3, child_4]
for index in childViewControllers.indices {
let nElements = childViewControllers.count - index
let n = (Int(arc4random()) % nElements) + index
if n != index {
childViewControllers.swapAt(index, n)
}
}
let nItems = 1 + (arc4random() % 4)
return Array(childViewControllers.prefix(Int(nItems)))
}
override func reloadPagerTabStripView() {
isReload = true
if arc4random() % 2 == 0 {
pagerBehaviour = .progressive(skipIntermediateViewControllers: arc4random() % 2 == 0, elasticIndicatorLimit: arc4random() % 2 == 0 )
} else {
pagerBehaviour = .common(skipIntermediateViewControllers: arc4random() % 2 == 0)
}
super.reloadPagerTabStripView()
}
}

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics" statusBarStyle="lightContent"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,77 @@
// ButtonBarExampleViewController.swift
// XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip )
//
// Copyright (c) 2017 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import Foundation
import XLPagerTabStrip
class ButtonBarExampleViewController: ButtonBarPagerTabStripViewController {
var isReload = false
override func viewDidLoad() {
super.viewDidLoad()
buttonBarView.selectedBar.backgroundColor = .orange
buttonBarView.backgroundColor = UIColor(red: 7/255, green: 185/255, blue: 155/255, alpha: 1)
}
// MARK: - PagerTabStripDataSource
override func viewControllers(for 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")
let child_4 = ChildExampleViewController(itemInfo: "View 2")
let child_5 = TableChildExampleViewController(style: .plain, itemInfo: "Table View 3")
let child_6 = ChildExampleViewController(itemInfo: "View 3")
let child_7 = TableChildExampleViewController(style: .grouped, itemInfo: "Table View 4")
let child_8 = ChildExampleViewController(itemInfo: "View 4")
guard isReload else {
return [child_1, child_2, child_3, child_4, child_5, child_6, child_7, child_8]
}
var childViewControllers = [child_1, child_2, child_3, child_4, child_5, child_6, child_7, child_8]
for index in childViewControllers.indices {
let nElements = childViewControllers.count - index
let n = (Int(arc4random()) % nElements) + index
if n != index {
childViewControllers.swapAt(index, n)
}
}
let nItems = 1 + (arc4random() % 8)
return Array(childViewControllers.prefix(Int(nItems)))
}
override func reloadPagerTabStripView() {
isReload = true
if arc4random() % 2 == 0 {
pagerBehaviour = .progressive(skipIntermediateViewControllers: arc4random() % 2 == 0, elasticIndicatorLimit: arc4random() % 2 == 0 )
} else {
pagerBehaviour = .common(skipIntermediateViewControllers: arc4random() % 2 == 0)
}
super.reloadPagerTabStripView()
}
}

View File

@ -0,0 +1,60 @@
// ChildExampleViewController.swift
// XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip )
//
// Copyright (c) 2017 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import Foundation
import XLPagerTabStrip
class ChildExampleViewController: UIViewController, IndicatorInfoProvider {
var itemInfo: IndicatorInfo = "View"
init(itemInfo: IndicatorInfo) {
self.itemInfo = itemInfo
super.init(nibName: nil, bundle: nil)
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
let label = UILabel()
label.translatesAutoresizingMaskIntoConstraints = false
label.text = "XLPagerTabStrip"
view.addSubview(label)
view.backgroundColor = .white
view.addConstraint(NSLayoutConstraint(item: label, attribute: .centerX, relatedBy: .equal, toItem: view, attribute: .centerX, multiplier: 1, constant: 0))
view.addConstraint(NSLayoutConstraint(item: label, attribute: .centerY, relatedBy: .equal, toItem: view, attribute: .centerY, multiplier: 1, constant: -50))
}
// MARK: - IndicatorInfoProvider
func indicatorInfo(for pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo {
return itemInfo
}
}

View File

@ -0,0 +1,86 @@
// TableChildExampleViewController.swift
// XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip )
//
// Copyright (c) 2017 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import Foundation
import XLPagerTabStrip
class TableChildExampleViewController: UITableViewController, IndicatorInfoProvider {
let cellIdentifier = "postCell"
var blackTheme = false
var itemInfo = IndicatorInfo(title: "View")
init(style: UITableViewStyle, itemInfo: IndicatorInfo) {
self.itemInfo = itemInfo
super.init(style: style)
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
tableView.register(UINib(nibName: "PostCell", bundle: Bundle.main), forCellReuseIdentifier: cellIdentifier)
tableView.estimatedRowHeight = 60.0
tableView.rowHeight = UITableViewAutomaticDimension
tableView.allowsSelection = false
if blackTheme {
tableView.backgroundColor = UIColor(red: 15/255.0, green: 16/255.0, blue: 16/255.0, alpha: 1.0)
}
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
tableView.reloadData()
}
// MARK: - UITableViewDataSource
override func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return DataProvider.sharedInstance.postsData.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard let cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier, for: indexPath) as? PostCell,
let data = DataProvider.sharedInstance.postsData.object(at: indexPath.row) as? NSDictionary else { return PostCell() }
cell.configureWithData(data)
if blackTheme {
cell.changeStylToBlack()
}
return cell
}
// MARK: - IndicatorInfoProvider
func indicatorInfo(for pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo {
return itemInfo
}
}

File diff suppressed because one or more lines are too long

View File

@ -1,8 +1,7 @@
//
// XLPagerTabStripTests.m
// PostCell.swift
// XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip )
//
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2017 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -23,35 +22,32 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
import UIKit
@interface XLPagerTabStripTests : XCTestCase
class PostCell: UITableViewCell {
@end
@IBOutlet weak var userImage: UIImageView!
@IBOutlet weak var postName: UILabel!
@IBOutlet weak var postText: UILabel!
@implementation XLPagerTabStripTests
override func awakeFromNib() {
super.awakeFromNib()
userImage.layer.cornerRadius = 10.0
}
- (void)setUp {
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
func configureWithData(_ data: NSDictionary) {
if let post = data["post"] as? NSDictionary, let user = post["user"] as? NSDictionary {
postName.text = user["name"] as? String
postText.text = post["text"] as? String
userImage.image = UIImage(named: postName.text!.replacingOccurrences(of: " ", with: "_"))
}
}
func changeStylToBlack() {
userImage?.layer.cornerRadius = 30.0
postText.text = nil
postName.font = UIFont(name: "HelveticaNeue-Light", size:18) ?? .systemFont(ofSize: 18)
postName.textColor = .white
backgroundColor = UIColor(red: 15/255.0, green: 16/255.0, blue: 16/255.0, alpha: 1.0)
}
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
- (void)testExample {
// This is an example of a functional test case.
XCTAssert(YES, @"Pass");
}
- (void)testPerformanceExample {
// This is an example of a performance test case.
[self measureBlock:^{
// Put the code you want to measure the time of here.
}];
}
@end

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="84" id="b8n-8Y-pxb" customClass="PostCell" customModule="Example" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="375" height="84"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="b8n-8Y-pxb" id="K88-rd-6gZ">
<rect key="frame" x="0.0" y="0.0" width="375" height="83.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="wQ5-jv-KcD">
<rect key="frame" x="12" y="12" width="60" height="60"/>
<constraints>
<constraint firstAttribute="height" constant="60" id="a22-Yz-B14"/>
<constraint firstAttribute="width" constant="60" id="h3B-3k-YAV"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Xt9-VS-IpY">
<rect key="frame" x="80" y="12" width="278" height="18"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fIC-u4-GzA">
<rect key="frame" x="80" y="38" width="278" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="wQ5-jv-KcD" firstAttribute="top" secondItem="K88-rd-6gZ" secondAttribute="top" constant="12" id="0nA-Ff-0jE"/>
<constraint firstItem="Xt9-VS-IpY" firstAttribute="leading" secondItem="wQ5-jv-KcD" secondAttribute="trailing" constant="8" id="CJD-v3-ZI5"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="fIC-u4-GzA" secondAttribute="bottom" priority="999" constant="20" id="Dsa-9n-hAy"/>
<constraint firstAttribute="trailing" secondItem="fIC-u4-GzA" secondAttribute="trailing" constant="17" id="NGB-u3-BwT"/>
<constraint firstItem="Xt9-VS-IpY" firstAttribute="top" secondItem="K88-rd-6gZ" secondAttribute="top" constant="12" id="aeT-ml-Joy"/>
<constraint firstItem="fIC-u4-GzA" firstAttribute="leading" secondItem="wQ5-jv-KcD" secondAttribute="trailing" constant="8" id="cdd-j8-SOs"/>
<constraint firstItem="wQ5-jv-KcD" firstAttribute="leading" secondItem="K88-rd-6gZ" secondAttribute="leading" constant="12" id="hyC-j1-1ur"/>
<constraint firstAttribute="bottom" secondItem="wQ5-jv-KcD" secondAttribute="bottom" priority="999" constant="12" id="igs-Iw-meI"/>
<constraint firstAttribute="trailing" secondItem="Xt9-VS-IpY" secondAttribute="trailing" constant="17" id="xNw-iC-WEv"/>
<constraint firstItem="fIC-u4-GzA" firstAttribute="top" secondItem="Xt9-VS-IpY" secondAttribute="bottom" constant="8" id="ypP-AG-hch"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="postName" destination="Xt9-VS-IpY" id="VYd-5D-WAS"/>
<outlet property="postText" destination="fIC-u4-GzA" id="GvN-fW-jWH"/>
<outlet property="userImage" destination="wQ5-jv-KcD" id="T64-Nd-dc9"/>
</connections>
<point key="canvasLocation" x="348" y="692"/>
</tableViewCell>
</objects>
</document>

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Storyboard</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

View File

@ -0,0 +1,67 @@
// SegmentedExampleViewController.swift
// XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip )
//
// Copyright (c) 2017 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import Foundation
import XLPagerTabStrip
class InstagramExampleViewController: ButtonBarPagerTabStripViewController {
@IBOutlet weak var shadowView: UIView!
let blueInstagramColor = UIColor(red: 37/255.0, green: 111/255.0, blue: 206/255.0, alpha: 1.0)
override func viewDidLoad() {
// change selected bar color
settings.style.buttonBarBackgroundColor = .white
settings.style.buttonBarItemBackgroundColor = .white
settings.style.selectedBarBackgroundColor = blueInstagramColor
settings.style.buttonBarItemFont = .boldSystemFont(ofSize: 14)
settings.style.selectedBarHeight = 2.0
settings.style.buttonBarMinimumLineSpacing = 0
settings.style.buttonBarItemTitleColor = .black
settings.style.buttonBarItemsShouldFillAvailableWidth = true
settings.style.buttonBarLeftContentInset = 0
settings.style.buttonBarRightContentInset = 0
changeCurrentIndexProgressive = { [weak self] (oldCell: ButtonBarViewCell?, newCell: ButtonBarViewCell?, progressPercentage: CGFloat, changeCurrentIndex: Bool, animated: Bool) -> Void in
guard changeCurrentIndex == true else { return }
oldCell?.label.textColor = .black
newCell?.label.textColor = self?.blueInstagramColor
}
super.viewDidLoad()
}
// MARK: - PagerTabStripDataSource
override func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> [UIViewController] {
let child_1 = TableChildExampleViewController(style: .plain, itemInfo: "FOLLOWING")
let child_2 = ChildExampleViewController(itemInfo: "YOU")
return [child_1, child_2]
}
// MARK: - Custom Action
@IBAction func closeAction(_ sender: UIButton) {
dismiss(animated: true, completion: nil)
}
}

View File

@ -0,0 +1,102 @@
// NavButtonBarExampleViewController.swift
// XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip )
//
// Copyright (c) 2017 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import Foundation
import XLPagerTabStrip
class NavButtonBarExampleViewController: ButtonBarPagerTabStripViewController {
var isReload = false
override func viewDidLoad() {
// set up style before super view did load is executed
settings.style.buttonBarBackgroundColor = .clear
settings.style.selectedBarBackgroundColor = .orange
//-
super.viewDidLoad()
buttonBarView.removeFromSuperview()
navigationController?.navigationBar.addSubview(buttonBarView)
changeCurrentIndexProgressive = { (oldCell: ButtonBarViewCell?, newCell: ButtonBarViewCell?, progressPercentage: CGFloat, changeCurrentIndex: Bool, animated: Bool) -> Void in
guard changeCurrentIndex == true else { return }
oldCell?.label.textColor = UIColor(white: 1, alpha: 0.6)
newCell?.label.textColor = .white
if animated {
UIView.animate(withDuration: 0.1, animations: { () -> Void in
newCell?.transform = CGAffineTransform(scaleX: 1.0, y: 1.0)
oldCell?.transform = CGAffineTransform(scaleX: 0.8, y: 0.8)
})
} else {
newCell?.transform = CGAffineTransform(scaleX: 1.0, y: 1.0)
oldCell?.transform = CGAffineTransform(scaleX: 0.8, y: 0.8)
}
}
}
// MARK: - PagerTabStripDataSource
override func viewControllers(for 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")
let child_4 = ChildExampleViewController(itemInfo: "View 1")
let child_5 = TableChildExampleViewController(style: .plain, itemInfo: "Table View 3")
let child_6 = ChildExampleViewController(itemInfo: "View 2")
let child_7 = TableChildExampleViewController(style: .grouped, itemInfo: "Table View 4")
let child_8 = ChildExampleViewController(itemInfo: "View 3")
guard isReload else {
return [child_1, child_2, child_3, child_4, child_5, child_6, child_7, child_8]
}
var childViewControllers = [child_1, child_2, child_3, child_4, child_5, child_6, child_7, child_8]
for index in childViewControllers.indices {
let nElements = childViewControllers.count - index
let n = (Int(arc4random()) % nElements) + index
if n != index {
childViewControllers.swapAt(index, n)
}
}
let nItems = 1 + (arc4random() % 8)
return Array(childViewControllers.prefix(Int(nItems)))
}
override func reloadPagerTabStripView() {
isReload = true
if arc4random() % 2 == 0 {
pagerBehaviour = .progressive(skipIntermediateViewControllers: arc4random() % 2 == 0, elasticIndicatorLimit: arc4random() % 2 == 0 )
} else {
pagerBehaviour = .common(skipIntermediateViewControllers: arc4random() % 2 == 0)
}
super.reloadPagerTabStripView()
}
override func configureCell(_ cell: ButtonBarViewCell, indicatorInfo: IndicatorInfo) {
super.configureCell(cell, indicatorInfo: indicatorInfo)
cell.backgroundColor = .clear
}
}

View File

@ -0,0 +1,86 @@
// ReloadExampleViewController.swift
// XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip )
//
// Copyright (c) 2017 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import UIKit
import XLPagerTabStrip
class ReloadExampleViewController: UIViewController {
@IBOutlet lazy var titleLabel: UILabel! = {
let label = UILabel()
return label
}()
lazy var bigLabel: UILabel = {
let bigLabel = UILabel()
bigLabel.backgroundColor = .clear
bigLabel.textColor = .white
bigLabel.font = UIFont.boldSystemFont(ofSize: 20)
bigLabel.adjustsFontSizeToFitWidth = true
return bigLabel
}()
override func viewDidLoad() {
super.viewDidLoad()
if navigationController != nil {
navigationItem.titleView = bigLabel
bigLabel.sizeToFit()
}
if let pagerViewController = childViewControllers.first as? PagerTabStripViewController {
updateTitle(of: pagerViewController)
}
}
@IBAction func reloadTapped(_ sender: UIBarButtonItem) {
for childViewController in childViewControllers {
guard let child = childViewController as? PagerTabStripViewController else {
continue
}
child.reloadPagerTabStripView()
updateTitle(of: child)
break
}
}
@IBAction func closeTapped(_ sender: UIButton) {
dismiss(animated: true, completion: nil)
}
func updateTitle(of pagerTabStripViewController: PagerTabStripViewController) {
func stringFromBool(_ bool: Bool) -> String {
return bool ? "YES" : "NO"
}
titleLabel.text = "Progressive = \(stringFromBool(pagerTabStripViewController.pagerBehaviour.isProgressiveIndicator)) ElasticLimit = \(stringFromBool(pagerTabStripViewController.pagerBehaviour.isElasticIndicatorLimit))"
(navigationItem.titleView as? UILabel)?.text = titleLabel.text
navigationItem.titleView?.sizeToFit()
}
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
}

View File

@ -0,0 +1,69 @@
// SegmentedExampleViewController.swift
// XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip )
//
// Copyright (c) 2017 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import Foundation
import XLPagerTabStrip
class SegmentedExampleViewController: SegmentedPagerTabStripViewController {
var isReload = false
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
// change segmented style
settings.style.segmentedControlColor = .white
}
// MARK: - PagerTabStripDataSource
override func viewControllers(for 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")
let child_4 = ChildExampleViewController(itemInfo: "View 2")
guard isReload else {
return [child_1, child_2, child_3, child_4]
}
var childViewControllers = [child_1, child_2, child_3, child_4]
let count = childViewControllers.count
for index in childViewControllers.indices {
let nElements = count - index
let n = (Int(arc4random()) % nElements) + index
if n != index {
childViewControllers.swapAt(index, n)
}
}
let nItems = 1 + (arc4random() % 4)
return Array(childViewControllers.prefix(Int(nItems)))
}
@IBAction func reloadTapped(_ sender: UIBarButtonItem) {
isReload = true
pagerBehaviour = .common(skipIntermediateViewControllers: arc4random() % 2 == 0)
reloadPagerTabStripView()
}
}

View File

@ -0,0 +1,72 @@
// SpotifyExampleViewController.swift
// XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip )
//
// Copyright (c) 2017 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import Foundation
import XLPagerTabStrip
class SpotifyExampleViewController: ButtonBarPagerTabStripViewController {
@IBOutlet weak var shadowView: UIView!
let graySpotifyColor = UIColor(red: 21/255.0, green: 21/255.0, blue: 24/255.0, alpha: 1.0)
let darkGraySpotifyColor = UIColor(red: 19/255.0, green: 20/255.0, blue: 20/255.0, alpha: 1.0)
override func viewDidLoad() {
// change selected bar color
settings.style.buttonBarBackgroundColor = graySpotifyColor
settings.style.buttonBarItemBackgroundColor = graySpotifyColor
settings.style.selectedBarBackgroundColor = UIColor(red: 33/255.0, green: 174/255.0, blue: 67/255.0, alpha: 1.0)
settings.style.buttonBarItemFont = UIFont(name: "HelveticaNeue-Light", size:14) ?? UIFont.systemFont(ofSize: 14)
settings.style.selectedBarHeight = 3.0
settings.style.buttonBarMinimumLineSpacing = 0
settings.style.buttonBarItemTitleColor = .black
settings.style.buttonBarItemsShouldFillAvailableWidth = true
settings.style.buttonBarLeftContentInset = 20
settings.style.buttonBarRightContentInset = 20
changeCurrentIndexProgressive = { (oldCell: ButtonBarViewCell?, newCell: ButtonBarViewCell?, progressPercentage: CGFloat, changeCurrentIndex: Bool, animated: Bool) -> Void in
guard changeCurrentIndex == true else { return }
oldCell?.label.textColor = UIColor(red: 138/255.0, green: 138/255.0, blue: 144/255.0, alpha: 1.0)
newCell?.label.textColor = .white
}
super.viewDidLoad()
}
// MARK: - PagerTabStripDataSource
override func viewControllers(for 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"))
child_2.blackTheme = true
return [child_1, child_2]
}
// MARK: - Actions
@IBAction func closeAction(_ sender: UIButton) {
dismiss(animated: true, completion: nil)
}
}

View File

@ -0,0 +1,63 @@
// TwitterExampleViewController.swift
// XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip )
//
// Copyright (c) 2017 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import Foundation
import XLPagerTabStrip
class TwitterExampleViewController: TwitterPagerTabStripViewController {
var isReload = false
override func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> [UIViewController] {
let child_1 = TableChildExampleViewController(style: .plain, itemInfo: "TableView")
let child_2 = ChildExampleViewController(itemInfo: "View")
let child_3 = TableChildExampleViewController(style: .grouped, itemInfo: "TableView 2")
let child_4 = ChildExampleViewController(itemInfo: "View 2")
let child_5 = TableChildExampleViewController(style: .plain, itemInfo: "TableView 3")
let child_6 = ChildExampleViewController(itemInfo: "View 3")
let child_7 = TableChildExampleViewController(style: .grouped, itemInfo: "TableView 4")
let child_8 = ChildExampleViewController(itemInfo: "View 4")
guard isReload else {
return [child_1, child_2, child_3, child_4, child_5, child_6, child_7, child_8]
}
var childViewControllers = [child_1, child_2, child_3, child_4, child_5, child_6, child_7, child_8]
for index in childViewControllers.indices {
let nElements = childViewControllers.count - index
let n = (Int(arc4random()) % nElements) + index
if n != index {
childViewControllers.swapAt(index, n)
}
}
let nItems = 1 + (arc4random() % 8)
return Array(childViewControllers.prefix(Int(nItems)))
}
@IBAction func reloadTapped(_ sender: AnyObject) {
isReload = true
reloadPagerTabStripView()
}
}

View File

@ -0,0 +1,96 @@
// YoutubeExampleViewController.swift
// XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip )
//
// Copyright (c) 2017 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import Foundation
import XLPagerTabStrip
class YoutubeExampleViewController: BaseButtonBarPagerTabStripViewController<YoutubeIconCell> {
let redColor = UIColor(red: 221/255.0, green: 0/255.0, blue: 19/255.0, alpha: 1.0)
let unselectedIconColor = UIColor(red: 73/255.0, green: 8/255.0, blue: 10/255.0, alpha: 1.0)
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
buttonBarItemSpec = ButtonBarItemSpec.nibFile(nibName: "YoutubeIconCell", bundle: Bundle(for: YoutubeIconCell.self), width: { _ in
return 55.0
})
}
override func viewDidLoad() {
// change selected bar color
settings.style.buttonBarBackgroundColor = redColor
settings.style.buttonBarItemBackgroundColor = .clear
settings.style.selectedBarBackgroundColor = UIColor(red: 234/255.0, green: 234/255.0, blue: 234/255.0, alpha: 1.0)
settings.style.selectedBarHeight = 4.0
settings.style.buttonBarMinimumLineSpacing = 0
settings.style.buttonBarItemTitleColor = .black
settings.style.buttonBarItemsShouldFillAvailableWidth = true
settings.style.buttonBarLeftContentInset = 0
settings.style.buttonBarRightContentInset = 0
changeCurrentIndexProgressive = { [weak self] (oldCell: YoutubeIconCell?, newCell: YoutubeIconCell?, progressPercentage: CGFloat, changeCurrentIndex: Bool, animated: Bool) -> Void in
guard changeCurrentIndex == true else { return }
oldCell?.iconImage.tintColor = self?.unselectedIconColor
newCell?.iconImage.tintColor = .white
}
super.viewDidLoad()
navigationController?.navigationBar.shadowImage = UIImage()
navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
}
// MARK: - PagerTabStripDataSource
override func viewControllers(for 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")))
return [child_1, child_2, child_3]
}
override func configure(cell: YoutubeIconCell, for indicatorInfo: IndicatorInfo) {
cell.iconImage.image = indicatorInfo.image?.withRenderingMode(.alwaysTemplate)
}
override func updateIndicator(for viewController: PagerTabStripViewController, fromIndex: Int, toIndex: Int, withProgressPercentage progressPercentage: CGFloat, indexWasChanged: Bool) {
super.updateIndicator(for: viewController, fromIndex: fromIndex, toIndex: toIndex, withProgressPercentage: progressPercentage, indexWasChanged: indexWasChanged)
if indexWasChanged && toIndex > -1 && toIndex < viewControllers.count {
let child = viewControllers[toIndex] as! IndicatorInfoProvider // swiftlint:disable:this force_cast
UIView.performWithoutAnimation({ [weak self] () -> Void in
guard let me = self else { return }
me.navigationItem.leftBarButtonItem?.title = child.indicatorInfo(for: me).title
})
}
}
// MARK: - Actions
@IBAction func closeAction(_ sender: UIButton) {
dismiss(animated: true, completion: nil)
}
}

View File

@ -1,8 +1,7 @@
//
// AppDelegate.h
// YoutubeIconCell.swift
// XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip )
//
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2017 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -23,10 +22,11 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import <UIKit/UIKit.h>
import Foundation
import UIKit
@interface AppDelegate : UIResponder <UIApplicationDelegate>
class YoutubeIconCell: UICollectionViewCell {
@property (strong, nonatomic) UIWindow *window;
@IBOutlet weak var iconImage: UIImageView!
@end
}

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="2CI-9N-dP3" customClass="YoutubeIconCell" customModule="Example" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="74" height="50"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="74" height="50"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Tkn-VR-o25">
<rect key="frame" x="20" y="8" width="35" height="35"/>
<constraints>
<constraint firstAttribute="width" constant="35" id="EUF-rI-9Y8"/>
<constraint firstAttribute="height" constant="35" id="RoA-LT-AHV"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<constraints>
<constraint firstItem="Tkn-VR-o25" firstAttribute="centerX" secondItem="2CI-9N-dP3" secondAttribute="centerX" id="wav-eA-a2N"/>
<constraint firstItem="Tkn-VR-o25" firstAttribute="centerY" secondItem="2CI-9N-dP3" secondAttribute="centerY" id="xV4-vo-sZc"/>
</constraints>
<size key="customSize" width="74" height="50"/>
<connections>
<outlet property="iconImage" destination="Tkn-VR-o25" id="7DO-mm-BJX"/>
</connections>
<point key="canvasLocation" x="317" y="376"/>
</collectionViewCell>
</objects>
</document>

View File

@ -1,8 +1,7 @@
//
// TableChildExampleViewController.h
// YoutubeIconWithLabelCell.swift
// XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip )
//
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2017 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -23,10 +22,12 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import <UIKit/UIKit.h>
#import "XLPagerTabStripViewController.h"
import Foundation
import UIKit
@interface TableChildExampleViewController : UITableViewController <XLPagerTabStripChildItem>
class YoutubeIconWithLabelCell: UICollectionViewCell {
@IBOutlet weak var iconImage: UIImageView!
@IBOutlet weak var iconLabel: UILabel!
@end
}

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="2CI-9N-dP3" customClass="YoutubeIconWithLabelCell" customModule="Example" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="74" height="70"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="74" height="70"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Tkn-VR-o25">
<rect key="frame" x="20" y="10" width="35" height="35"/>
<constraints>
<constraint firstAttribute="width" constant="35" id="EUF-rI-9Y8"/>
<constraint firstAttribute="height" constant="35" id="RoA-LT-AHV"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rwk-fy-4KB">
<rect key="frame" x="0.0" y="45" width="74" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="kWi-HY-P6M"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="10"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</view>
<constraints>
<constraint firstItem="rwk-fy-4KB" firstAttribute="top" secondItem="Tkn-VR-o25" secondAttribute="bottom" id="A8G-Sk-d4C"/>
<constraint firstItem="Tkn-VR-o25" firstAttribute="top" secondItem="2CI-9N-dP3" secondAttribute="top" constant="10" id="DaW-j3-w2g"/>
<constraint firstItem="rwk-fy-4KB" firstAttribute="leading" secondItem="2CI-9N-dP3" secondAttribute="leading" id="HFm-qh-fCk"/>
<constraint firstAttribute="bottom" secondItem="rwk-fy-4KB" secondAttribute="bottom" constant="5" id="Q0g-pb-bbf"/>
<constraint firstAttribute="trailing" secondItem="rwk-fy-4KB" secondAttribute="trailing" id="YuE-x9-9EY"/>
<constraint firstItem="Tkn-VR-o25" firstAttribute="centerX" secondItem="2CI-9N-dP3" secondAttribute="centerX" id="wav-eA-a2N"/>
</constraints>
<size key="customSize" width="74" height="50"/>
<connections>
<outlet property="iconImage" destination="Tkn-VR-o25" id="7DO-mm-BJX"/>
<outlet property="iconLabel" destination="rwk-fy-4KB" id="76s-nG-weE"/>
</connections>
<point key="canvasLocation" x="317" y="376"/>
</collectionViewCell>
</objects>
</document>

View File

@ -0,0 +1,99 @@
// YoutubeWithLabelExampleViewController.swift
// XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip )
//
// Copyright (c) 2017 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import Foundation
import XLPagerTabStrip
class YoutubeWithLabelExampleViewController: BaseButtonBarPagerTabStripViewController<YoutubeIconWithLabelCell> {
let redColor = UIColor(red: 221/255.0, green: 0/255.0, blue: 19/255.0, alpha: 1.0)
let unselectedIconColor = UIColor(red: 73/255.0, green: 8/255.0, blue: 10/255.0, alpha: 1.0)
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
buttonBarItemSpec = ButtonBarItemSpec.nibFile(nibName: "YoutubeIconWithLabelCell", bundle: Bundle(for: YoutubeIconWithLabelCell.self), width: { _ in
return 70.0
})
}
override func viewDidLoad() {
// change selected bar color
settings.style.buttonBarBackgroundColor = redColor
settings.style.buttonBarItemBackgroundColor = .clear
settings.style.selectedBarBackgroundColor = UIColor(red: 234/255.0, green: 234/255.0, blue: 234/255.0, alpha: 1.0)
settings.style.selectedBarHeight = 4.0
settings.style.buttonBarMinimumLineSpacing = 0
settings.style.buttonBarItemTitleColor = .black
settings.style.buttonBarItemsShouldFillAvailableWidth = true
settings.style.buttonBarLeftContentInset = 0
settings.style.buttonBarRightContentInset = 0
changeCurrentIndexProgressive = { [weak self] (oldCell: YoutubeIconWithLabelCell?, newCell: YoutubeIconWithLabelCell?, progressPercentage: CGFloat, changeCurrentIndex: Bool, animated: Bool) -> Void in
guard changeCurrentIndex == true else { return }
oldCell?.iconImage.tintColor = self?.unselectedIconColor
oldCell?.iconLabel.textColor = self?.unselectedIconColor
newCell?.iconImage.tintColor = .white
newCell?.iconLabel.textColor = .white
}
super.viewDidLoad()
navigationController?.navigationBar.shadowImage = UIImage()
navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
}
// MARK: - PagerTabStripDataSource
override func viewControllers(for 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")))
return [child_1, child_2, child_3]
}
override func configure(cell: YoutubeIconWithLabelCell, for indicatorInfo: IndicatorInfo) {
cell.iconImage.image = indicatorInfo.image?.withRenderingMode(.alwaysTemplate)
cell.iconLabel.text = indicatorInfo.title?.trimmingCharacters(in: .whitespacesAndNewlines)
}
override func updateIndicator(for viewController: PagerTabStripViewController, fromIndex: Int, toIndex: Int, withProgressPercentage progressPercentage: CGFloat, indexWasChanged: Bool) {
super.updateIndicator(for: viewController, fromIndex: fromIndex, toIndex: toIndex, withProgressPercentage: progressPercentage, indexWasChanged: indexWasChanged)
if indexWasChanged && toIndex > -1 && toIndex < viewControllers.count {
let child = viewControllers[toIndex] as! IndicatorInfoProvider // swiftlint:disable:this force_cast
UIView.performWithoutAnimation({ [weak self] () -> Void in
guard let me = self else { return }
me.navigationItem.leftBarButtonItem?.title = child.indicatorInfo(for: me).title
})
}
}
// MARK: - Actions
@IBAction func closeAction(_ sender: UIButton) {
dismiss(animated: true, completion: nil)
}
}

View File

@ -0,0 +1,35 @@
//
// ExampleUITests.swift
// ExampleUITests
//
// Copyright © 2016 Xmartlabs SRL. All rights reserved.
//
import XCTest
class ExampleUITests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false
// UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
XCUIApplication().launch()
// In UI tests its important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// Use recording to get started writing UI tests.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
}

BIN
Example/bar.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

BIN
Example/barButton.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

BIN
Example/instagram.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
Example/navBarButton.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 KiB

BIN
Example/segmented.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

BIN
Example/spotify.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

BIN
Example/twitter.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

BIN
Example/youtube.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2014 XMARTLABS
Copyright (c) 2017 Xmartlabs SRL
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

21
Migration.md Normal file
View File

@ -0,0 +1,21 @@
## How to migrate from Swift 2 to Swift 3
To migrate from Swift 2 to Swift 3 you have to change the naming of some of the functions you call or override. These are the name changes for version 6.0+ in `PagerTabStripViewController`:
| Swift 2 function name | Swift 3 function name |
| --------------------- | --------------------- |
| `func viewControllersForPagerTabStrip(_ pagerTabStripController: PagerTabStripViewController) -> [UIViewController]` | `func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> [UIViewController]` |
| `func indicatorInfoForPagerTabStrip(_ pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo` | `func indicatorInfo(for pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo` |
| `func pagerTabStripViewController(_ pagerTabStripViewController: PagerTabStripViewController, updateIndicatorFromIndex fromIndex: Int, toIndex: Int)` | `func updateIndicator(for viewController: PagerTabStripViewController, fromIndex: Int, toIndex: Int)` |
| `func pagerTabStripViewController(_ pagerTabStripViewController: PagerTabStripViewController, updateIndicatorFromIndex fromIndex: Int, toIndex: Int, withProgressPercentage progressPercentage: CGFloat, indexWasChanged: Bool)` | `func updateIndicator(for viewController: PagerTabStripViewController, fromIndex: Int, toIndex: Int, withProgressPercentage progressPercentage: CGFloat, indexWasChanged: Bool)` |
| `func moveToViewControllerAtIndex(_ index: Int, animated: Bool = true)` | `func moveToViewController(at index: Int, animated: Bool = true)` |
| `func moveToViewController(_ viewController: UIViewController, animated: Bool = true)` | `func moveTo(viewController: UIViewController, animated: Bool = true)` |
| `func canMoveToIndex(index: Int) -> Bool` | `func canMoveTo(index: Int) -> Bool` |
| ` func pageOffsetForChildIndex(index: Int) -> CGFloat` | `func pageOffsetForChild(at index: Int) -> CGFloat` |
| `func offsetForChildIndex(_ index: Int) -> CGFloat` | `func offsetForChild(at index: Int) -> CGFloat` |
| `func offsetForChildViewController(_ viewController: UIViewController) throws -> CGFloat` | `func offsetForChild(viewController: UIViewController) throws -> CGFloat` |
| `func pageForContentOffset(_ contentOffset: CGFloat) -> Int` | `func pageFor(contentOffset: CGFloat) -> Int` |
| `func virtualPageForContentOffset(_ contentOffset: CGFloat) -> Int` | `func virtualPageFor(contentOffset: CGFloat) -> Int` |
| `func pageForVirtualPage(_ virtualPage: Int) -> Int` | `func pageFor(virtualPage: Int) -> Int` |
You can check all the changes in [this pull request](https://github.com/xmartlabs/XLPagerTabStrip/pull/226)

View File

@ -0,0 +1,13 @@
//
// Playground.playground
// XLPagerTabStrip
//
// Copyright © 2016 Xmartlabs SRL. All rights reserved.
//
//: Playground - noun: a place where people can play
import UIKit
import XLPagerTabStrip
var helloWorld = "Hello, playground"

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='5.0' target-platform='ios'>
<timeline fileName='timeline.xctimeline'/>
</playground>

384
README.md
View File

@ -1,145 +1,345 @@
XLPagerTabStrip
---------------
# XLPagerTabStrip
By [XMARTLABS](http://xmartlabs.com).
<p align="left">
<a href="https://travis-ci.org/xmartlabs/XLPagerTabStrip"><img src="https://travis-ci.org/xmartlabs/XLPagerTabStrip.svg?branch=master" alt="Build status" /></a>
<img src="https://img.shields.io/badge/platform-iOS-blue.svg?style=flat" alt="Platform iOS" />
<a href="https://developer.apple.com/swift"><img src="https://img.shields.io/badge/swift4-compatible-4BC51D.svg?style=flat" alt="Swift 3 compatible" /></a>
<a href="https://github.com/Carthage/Carthage"><img src="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat" alt="Carthage compatible" /></a>
<a href="https://cocoapods.org/pods/XLPagerTabStrip"><img src="https://img.shields.io/cocoapods/v/XLPagerTabStrip.svg" alt="CocoaPods compatible" /></a>
<a href="https://raw.githubusercontent.com/xmartlabs/XLPagerTabStrip/master/LICENSE"><img src="http://img.shields.io/badge/license-MIT-blue.svg?style=flat" alt="License: MIT" />
</a>
<!-- <a href="https://codebeat.co/projects/github-com-xmartlabs-xlpagertabstrip"><img alt="codebeat badge" src="https://codebeat.co/badges/f32c9ad3-0aa1-4b40-a632-9421211bd39e" /></a> -->
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/xmartlabs/XLPagerTabStrip/blob/master/LICENSE)
[![version](https://img.shields.io/badge/pod-3.0.0-blue.svg)](https://github.com/xmartlabs/XLPagerTabStrip/releases)
</p>
Made with ❤️ by [XMARTLABS](http://xmartlabs.com).
Android [PagerTabStrip](http://developer.android.com/reference/android/support/v4/view/PagerTabStrip.html) for iOS!
**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.
**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.
![Screenshot of native Calendar Event Example](XLPagerTabStrip/Demo/PagerSlidingTabStrip.gif)
<table>
<tr>
<th><img src="Example/instagram.gif" width="250"/></th>
<th><img src="Example/spotify.gif" width="250"/></th>
<th><img src="Example/youtube.gif" width="250"/></th>
<th><img src="Example/pagerTabStripTypes.gif" width="250"/></th>
</tr>
</table>
XLPagerTabStrip was originally inspired by [Tell market](http://about.tellmarket.com/) app.
## Getting involved
Purpose
--------
**XLPagerTabStrip** helps us deal with view controllers that have the same relevance for the user like Android PagerTabStrip and PageView do. Since you're able to navigate between a large amount of view controllers, XLPagerTabStrip is an scalable and nice solution for this problem.
* If you **want to contribute** please feel free to **submit pull requests**.
* If you **have a feature request** please **open an issue**.
* If you **found a bug** or **need help** please **check older issues, [FAQ](#faq) and threads on [StackOverflow](http://stackoverflow.com/questions/tagged/XLPagerTabStrip) (Tag 'XLPagerTabStrip') before submitting an issue**.
**Before contribute check the [CONTRIBUTING](CONTRIBUTING.md) file for more info.**
How to use it
--------------
If you use **XLPagerTabStrip** in your app We would love to hear about it! Drop us a line on [twitter](https://twitter.com/xmartlabs).
Integrate `XLPagerTabStrip` is as easy as following these steps:
## Pager Types
1. Create a UIViewController class that should extend from either `XLSegmentedPagerTabStripViewController`, `XLBarPagerTabStripViewController`, `XLButtonBarPagerTabStripViewController`, `XLTwitterPagerTabStripViewController`.
The library provides 4 different ways to show the view controllers.
2. The recently created concrete view controller should conform to `XLPagerTabStripViewControllerDataSource` implementing: `-(NSArray *)childViewControllersForPagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController;`
### Button Bar
3. (Recomended) Set up your view controllers using a nib file or a Storyboard. We need to connect some IBOutlets (take a look at the [Demo folder](XLPagerTabStrip/Demo)).
This is likely to be the most common pager type. It's used by many well known apps such as instagram, youtube, skype and many others.
4. Enjoy!
<img src="Example/barButton.gif" width="250"/>
For further details take a look at the [Demo folder](XLPagerTabStrip/Demo) to see the code of examples shown above.
### Bar
FAQ
----------------------
This mode doesn't show a title neither an image. It only shows a bar that indicates the current view controller.
#####How to change the visible child view controller programmatically
<img src="Example/bar.gif" width="250"/>
`XLPagerTabStripViewController` provides the following methods to programmatically change the visible child view controller:
### Twitter
```objc
-(void)moveToViewControllerAtIndex:(NSUInteger)index;
-(void)moveToViewControllerAtIndex:(NSUInteger)index animated:(BOOL)animated;
-(void)moveToViewController:(UIViewController *)viewController;
-(void)moveToViewController:(UIViewController *)viewController animated:(BOOL)animated;
Long time ago twitter app made use of this type of pager in the app main screen.
<img src="Example/twitter.gif" width="250"/>
### Segmented
This mode uses a `UISegmentedControl` to indicates which is the view controller being displayed.
<img src="Example/segmented.gif" width="250"/>
## Usage
Basically 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.
Let's see the steps to do this:
##### Choose which type of pager we want to create
First we should 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`.
> All these build-in pager controllers extend from the base class `PagerTabStripViewController`.
> You can also make your custom pager controller by extending directly from `PagerTabStripViewController` in case no pager menu type fits your needs.
```swift
import XLPagerTabStrip
class MyPagerTabStripName: ButtonBarPagerTabStripViewController {
..
}
```
#####How to change the selected tab (XLButtonBarViewCell) look and feel based on the selected state
##### Connect outlets and add layout constraints
`XLButtonBarPagerTabStripViewController` provides a flexible way to customize the look and feel of a `XLButtonBarViewCell` based on the selected state by using blocks. These blocks will be called each time the current cell index changes its value.
We strongly recommend to use IB to set up our page controller views.
```objc
@property (copy) void (^changeCurrentIndexProgressiveBlock)(XLButtonBarViewCell* oldCell, XLButtonBarViewCell *newCell, CGFloat progressPercentage, BOOL indexWasChanged, BOOL animated);
@property (copy) void (^changeCurrentIndexBlock)(XLButtonBarViewCell* oldCell, XLButtonBarViewCell *newCell, BOOL animated);
Drag into the storyboard a `UIViewController` and set up its class with your pager controller (`MyPagerTabStripName`).
Drag a `UIScrollView` into your view controller view and connect `PagerTabStripViewController` `containerView` outlet with the scroll view.
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. 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.
> 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 viewControllers(for: pagerTabStripController: PagerTabStripViewController) -> [UIViewController]` method.
```swift
override public func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> [UIViewController] {
return [MyEmbeddedViewController(), MySecondEmbeddedViewController()]
}
```
Since the collection cell (tab) is passed as a parameter you have full control on the look and fell change and animation.
Installation
--------------------------
The easiest way to use `XLPagerTabStrip` in your app is via [CocoaPods](http://cocoapods.org/ "CocoaPods").
1. Add the following line in the project's Podfile file:
`pod 'XLPagerTabStrip', '~> 2.0'`.
2. Run the command `pod install` from the Podfile folder directory.
> 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.
Customization
--------------
##### Provide information to show in each indicator
The most interesting customizable features are:
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 indicatorInfo(for pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo`
which provides the information required to show the PagerTabStrip menu (indicator) associated with the view controller.
* Ability to skip intermediate view controllers when tapped on a "tab" (using `skipIntermediateViewControllers` property)
* Indicators can be added at any position of the screen through storyboard layouts.
* Choose between progressive, non-progressive indicators (using isProgressiveIndicator property)
* Choose the alignment of the indicator as the user scrolls through tabs (using `barButtonView.selectedBarAlignment` property)
* Add space padding between view controllers
```swift
class MyEmbeddedViewController: UITableViewController, IndicatorInfoProvider {
func indicatorInfo(for pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo {
return IndicatorInfo(title: "My Child title")
}
}
```
**For a detailed step by step guide about how to use the library, please check out this community [blog post](https://medium.com/michaeladeyeri/how-to-implement-android-like-tab-layouts-in-ios-using-swift-3-578516c3aa9).**
That's it! We're done! 🍻🍻
## Customization
##### Pager Behaviour
The pager indicator can be updated progressive as we swipe or at once in the middle of the transition between the view controllers.
By setting up `pagerBehaviour` property we can choose how the indicator should be updated.
```swift
public var pagerBehaviour: PagerTabStripBehaviour
```
```swift
public enum PagerTabStripBehaviour {
case common(skipIntermediteViewControllers: Bool)
case progressive(skipIntermediteViewControllers: Bool, elasticIndicatorLimit: Bool)
}
```
Default Values:
```swift
// Twitter Type
PagerTabStripBehaviour.common(skipIntermediateViewControllers: true)
// Segmented Type
PagerTabStripBehaviour.common(skipIntermediateViewControllers: true)
// Bar Type
PagerTabStripBehaviour.progressive(skipIntermediateViewControllers: true, elasticIndicatorLimit: true)
// ButtonBar Type
PagerTabStripBehaviour.progressive(skipIntermediateViewControllers: true, elasticIndicatorLimit: true)
```
As you might have noticed `common` and `progressive` enumeration cases has `skipIntermediateViewControllers` and `elasticIndicatorLimit` associated values.
`skipIntermediateViewControllers` allows us to skip intermediate view controllers when a tab indicator is tapped.
`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.
##### PagerTabStripDelegate & PagerTabStripIsProgressiveDelegate
Normally we don't need to implement these protocols because each pager type already conforms to it in order to properly update its indicator. Anyway there may be some scenarios when overriding a method come come in handy.
```swift
public protocol PagerTabStripDelegate: class {
func updateIndicator(for viewController: PagerTabStripViewController, fromIndex: Int, toIndex: Int)
}
public protocol PagerTabStripIsProgressiveDelegate : PagerTabStripDelegate {
func updateIndicator(for viewController: PagerTabStripViewController, fromIndex: Int, toIndex: Int, withProgressPercentage progressPercentage: CGFloat, indexWasChanged: Bool)
}
```
> Again, The method invoked by the library depends on the `pagerBehaviour` value.
Requirements
-----------------------------
* ARC
* iOS 7.0 and above
### ButtonBar Customization
```swift
settings.style.buttonBarBackgroundColor: UIColor?
// buttonBar minimumInteritemSpacing value, note that button bar extends from UICollectionView
settings.style.buttonBarMinimumInteritemSpacing: CGFloat?
// buttonBar minimumLineSpacing value
settings.style.buttonBarMinimumLineSpacing: CGFloat?
// buttonBar flow layout left content inset value
settings.style.buttonBarLeftContentInset: CGFloat?
// buttonBar flow layout right content inset value
settings.style.buttonBarRightContentInset: CGFloat?
// selected bar view is created programmatically so it's important to set up the following 2 properties properly
settings.style.selectedBarBackgroundColor = UIColor.black
settings.style.selectedBarHeight: CGFloat = 5
// each buttonBar item is a UICollectionView cell of type ButtonBarViewCell
settings.style.buttonBarItemBackgroundColor: UIColor?
settings.style.buttonBarItemFont = UIFont.systemFont(ofSize: 18)
// helps to determine the cell width, it represent the space before and after the title label
settings.style.buttonBarItemLeftRightMargin: CGFloat = 8
settings.style.buttonBarItemTitleColor: UIColor?
// in case the barView items do not fill the screen width this property stretch the cells to fill the screen
settings.style.buttonBarItemsShouldFillAvailiableWidth = true
// only used if button bar is created programmatically and not using storyboards or nib files as recommended.
public var buttonBarHeight: CGFloat?
```
**Important:** Settings should be called before `viewDidLoad` is called.
```swift
override func viewDidLoad() {
self.settings.style.selectedBarHeight = 2
self.settings.style.selectedBarBackgroundColor = UIColor.white
super.viewDidLoad()
}
```
##### Update cells when selected indicator changes
We 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`.
```swift
public var changeCurrentIndex: ((oldCell: ButtonBarViewCell?, newCell: ButtonBarViewCell?, animated: Bool) -> Void)?
public var changeCurrentIndexProgressive: ((oldCell: ButtonBarViewCell?, newCell: ButtonBarViewCell?, progressPercentage: CGFloat, changeCurrentIndex: Bool, animated: Bool) -> Void)?
```
Let's see an example:
```swift
changeCurrentIndexProgressive = { (oldCell: ButtonBarViewCell?, newCell: ButtonBarViewCell?, progressPercentage: CGFloat, changeCurrentIndex: Bool, animated: Bool) -> Void in
guard changeCurrentIndex == true else { return }
oldCell?.label.textColor = UIColor(white: 1, alpha: 0.6)
newCell?.label.textColor = UIColor.white
if animated {
UIView.animate(withDuration: 0.1, animations: { () -> Void in
newCell?.transform = CGAffineTransform(scaleX: 1.0, y: 1.0)
oldCell?.transform = CGAffineTransform(scaleX: 0.8, y: 0.8)
})
}
else {
newCell?.transform = CGAffineTransform(scaleX: 1.0, y: 1.0)
oldCell?.transform = CGAffineTransform(scaleX: 0.8, y: 0.8)
}
}
```
### Bar Type Customization
```swift
settings.style.barBackgroundColor: UIColor?
settings.style.selectedBarBackgroundColor: UIColor?
// barHeight is only set up when the bar is created programmatically and not using storyboards or xib files as recommended.
settings.style.barHeight: CGFloat = 5
```
### Twitter Type Customization
```swift
settings.style.dotColor = UIColor(white: 1, alpha: 0.4)
settings.style.selectedDotColor = UIColor.white
settings.style.portraitTitleFont = UIFont.systemFont(ofSize: 18)
settings.style.landscapeTitleFont = UIFont.systemFont(ofSize: 15)
settings.style.titleColor = UIColor.white
```
### Segmented Type Customization
```swift
settings.style.segmentedControlColor: UIColor?
```
Release Notes
--------------
Version 3.0.0
## Requirements
* `selectedBarAlignment` added to `XLButtonBarView`.
* `shouldCellsFillAvailableWidth` added to `XLButtonBarView`.
* Bug fixes and Stability improvements.
* iOS 8.0+
* Xcode 9.3+
Version 2.0.0
## Examples
* Added ability to change look and feel of selected tab.
* `changeCurrentIndexProgressiveBlock` added to `XLButtonBarPagerTabStripViewController`.
* `changeCurrentIndexBlock` added to `XLButtonBarPagerTabStripViewController`.
* indxWasChanged parameter was added to `-(void)pagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController updateIndicatorFromIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex withProgressPercentage:(CGFloat)progressPercentage indexWasChanged:(BOOL)indexWasChanged;`
* Bug Fix Issue #45: When the current tab is tapped by the user, and later swiping to another tab, the indicator now changes as expected.
* Bug Fix: When scrolling between tabs with progressive indicator, the indicator now scrolls swiftly. It used to jump for an instant.
* Bug Fix Issue #54: Twitter PagerTabStrip wasn't loading the navigation title correctly.
* Bug Fix Issue #32: Demo for Nav Button Bar Example fix.
* Bug Fix Issue #32: Twitter Pager white dots that mark which tab is currently selected is non selectable now.
* Bug Fix Issue #22: moveToViewControllerAtIndex: in viewDidLoad or viewWillAppear is not reflected in buttonBarView.
Follow these 3 steps to run Example project: Clone XLPagerTabStrip repository, open XLPagerTabStrip workspace and run the *Example* project.
Version 1.1.1
## Installation
* Nav Button example added
* Support for iOS 7.0 and above
### CocoaPods
Version 1.1.0
[CocoaPods](https://cocoapods.org/) is a dependency manager for Cocoa projects.
* Twitter pager added
* Bug fixes and stability improvements
To install XLPagerTabStrip, simply add the following line to your Podfile:
Version 1.0.0
```ruby
pod 'XLPagerTabStrip', '~> 8.0'
```
* Initial release
### Carthage
Author
-----------------
[Carthage](https://github.com/Carthage/Carthage) is a simple, decentralized dependency manager for Cocoa.
[Martin Barreto](https://www.github.com/mtnBarreto "Martin Barreto Github") ([@mtnBarreto](http://twitter.com/mtnBarreto "@mtnBarreto"))
To install XLPagerTabStrip, simply add the following line to your Cartfile:
Contributors
----------------
```ogdl
github "xmartlabs/XLPagerTabStrip" ~> 8.0
```
* Washington Miranda
* Martin Pastorin ([@dmpastorin](http://twitter.com/dmpastorin "@dmpastorin"))
* [Full contributors list](https://github.com/xmartlabs/XLPagerTabStrip/graphs/contributors)
## FAQ
Contact
----------------
#### How to change the visible child view controller programmatically
Any suggestion or question? Please create a Github issue or reach us out.
`PagerTabStripViewController` provides the following methods to programmatically change the visible child view controller:
[xmartlabs.com](http://xmartlabs.com).
[@xmartlabs](http://twitter.com/xmartlabs "@xmartlabs")
```swift
func moveToViewController(at index: Int)
func moveToViewController(at index: Int, animated: Bool)
func moveTo(viewController: UIViewController)
func moveTo(viewController: UIViewController, animated: Bool)
```
#### How to migrate from Swift 2 to Swift 3 <a name="migrate"></a>
Check out [our migration guide](https://github.com/xmartlabs/XLPagerTabStrip/blob/master/Migration.md)
## Author
* [Martin Barreto](https://github.com/mtnBarreto) ([@mtnBarreto](https://twitter.com/mtnBarreto))
## Change Log
This can be found in the [CHANGELOG.md](CHANGELOG.md) file.

View File

@ -0,0 +1,98 @@
// BarPagerTabStripViewController.swift
// XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip )
//
// Copyright (c) 2017 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import Foundation
import UIKit
public struct BarPagerTabStripSettings {
public struct Style {
public var barBackgroundColor: UIColor?
public var selectedBarBackgroundColor: UIColor?
public var barHeight: CGFloat = 5 // barHeight is ony set up when the bar is created programatically and not using storyboards or xib files.
}
public var style = Style()
}
open class BarPagerTabStripViewController: PagerTabStripViewController, PagerTabStripDataSource, PagerTabStripIsProgressiveDelegate {
public var settings = BarPagerTabStripSettings()
@IBOutlet weak public var barView: BarView!
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
delegate = self
datasource = self
}
public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
delegate = self
datasource = self
}
open override func viewDidLoad() {
super.viewDidLoad()
barView = barView ?? {
let barView = BarView(frame: CGRect(x: 0, y: 0, width: view.frame.size.width, height: settings.style.barHeight))
barView.autoresizingMask = .flexibleWidth
barView.backgroundColor = .black
barView.selectedBar.backgroundColor = .white
return barView
}()
barView.backgroundColor = settings.style.barBackgroundColor ?? barView.backgroundColor
barView.selectedBar.backgroundColor = settings.style.selectedBarBackgroundColor ?? barView.selectedBar.backgroundColor
}
open override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if barView.superview == nil {
view.addSubview(barView)
}
barView.optionsCount = viewControllers.count
barView.moveTo(index: currentIndex, animated: false)
}
open override func reloadPagerTabStripView() {
super.reloadPagerTabStripView()
barView.optionsCount = viewControllers.count
if isViewLoaded {
barView.moveTo(index: currentIndex, animated: false)
}
}
// MARK: - PagerTabStripDelegate
open func updateIndicator(for viewController: PagerTabStripViewController, fromIndex: Int, toIndex: Int, withProgressPercentage progressPercentage: CGFloat, indexWasChanged: Bool) {
barView.move(fromIndex: fromIndex, toIndex: toIndex, progressPercentage: progressPercentage)
}
open func updateIndicator(for viewController: PagerTabStripViewController, fromIndex: Int, toIndex: Int) {
barView.moveTo(index: toIndex, animated: true)
}
}

91
Sources/BarView.swift Normal file
View File

@ -0,0 +1,91 @@
// BarView.swift
// XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip )
//
// Copyright (c) 2017 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import Foundation
open class BarView: UIView {
open lazy var selectedBar: UIView = { [unowned self] in
let selectedBar = UIView(frame: CGRect(x: 0, y: 0, width: self.frame.size.width, height: self.frame.size.height))
return selectedBar
}()
var optionsCount = 1 {
willSet(newOptionsCount) {
if newOptionsCount <= selectedIndex {
selectedIndex = optionsCount - 1
}
}
}
var selectedIndex = 0
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
addSubview(selectedBar)
}
override init(frame: CGRect) {
super.init(frame: frame)
addSubview(selectedBar)
}
// MARK: - Helpers
private func updateSelectedBarPosition(with animation: Bool) {
var frame = selectedBar.frame
frame.size.width = self.frame.size.width / CGFloat(optionsCount)
frame.origin.x = frame.size.width * CGFloat(selectedIndex)
if animation {
UIView.animate(withDuration: 0.3, animations: { [weak self] in
self?.selectedBar.frame = frame
})
} else {
selectedBar.frame = frame
}
}
open func moveTo(index: Int, animated: Bool) {
selectedIndex = index
updateSelectedBarPosition(with: animated)
}
open func move(fromIndex: Int, toIndex: Int, progressPercentage: CGFloat) {
selectedIndex = (progressPercentage > 0.5) ? toIndex : fromIndex
var newFrame = selectedBar.frame
newFrame.size.width = frame.size.width / CGFloat(optionsCount)
var fromFrame = newFrame
fromFrame.origin.x = newFrame.size.width * CGFloat(fromIndex)
var toFrame = newFrame
toFrame.origin.x = toFrame.size.width * CGFloat(toIndex)
var targetFrame = fromFrame
targetFrame.origin.x += (toFrame.origin.x - targetFrame.origin.x) * CGFloat(progressPercentage)
selectedBar.frame = targetFrame
}
open override func layoutSubviews() {
super.layoutSubviews()
updateSelectedBarPosition(with: false)
}
}

Some files were not shown because too many files have changed in this diff Show More