Compare commits
188 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
fb7397a961 | |
|
|
a691ba2010 | |
|
|
73ffb21720 | |
|
|
813e74e466 | |
|
|
f664c9c21c | |
|
|
f0a0c37c76 | |
|
|
8f3afd76e4 | |
|
|
56acdd9401 | |
|
|
7fedf7172a | |
|
|
4ad6b8ac56 | |
|
|
17e7cc1c0a | |
|
|
8a5b93556c | |
|
|
1619ad4fe1 | |
|
|
7268f0afec | |
|
|
2f2afb62d9 | |
|
|
7647974075 | |
|
|
2351f06987 | |
|
|
372e819812 | |
|
|
b56f4ad7e1 | |
|
|
95f96be31d | |
|
|
3f7b234593 | |
|
|
83735ac5a5 | |
|
|
04f02d9148 | |
|
|
64a8ef8920 | |
|
|
04212ea5e7 | |
|
|
a974e6b11a | |
|
|
2964d27c44 | |
|
|
5f398ceb89 | |
|
|
1896e6873d | |
|
|
d0b0d76725 | |
|
|
4fe566f187 | |
|
|
ae722325b0 | |
|
|
9bf01d7d0e | |
|
|
2b9877dc68 | |
|
|
ce3a0034d3 | |
|
|
a98448beb2 | |
|
|
248b2cbe5a | |
|
|
5be0da1c43 | |
|
|
9bcd7cc559 | |
|
|
835570c855 | |
|
|
30b9e41f0c | |
|
|
44cefabc12 | |
|
|
b67f31b237 | |
|
|
342bdecce7 | |
|
|
07198bbb9b | |
|
|
711a0cf6e4 | |
|
|
3dc83770c3 | |
|
|
df0840af3c | |
|
|
6aede6891a | |
|
|
0b7dc7fe8c | |
|
|
21ca6cc08a | |
|
|
77da46e1fd | |
|
|
a0c75eb245 | |
|
|
6d4b55ce79 | |
|
|
89b5086ad1 | |
|
|
2089092533 | |
|
|
3f5b7b103e | |
|
|
e86bef5108 | |
|
|
6c1cc20c9f | |
|
|
1bda17f09a | |
|
|
b77a9a72ce | |
|
|
7ff9ed7554 | |
|
|
7849d0cc96 | |
|
|
4c609a92b1 | |
|
|
6a761b395c | |
|
|
2f2a4fc4de | |
|
|
6340728fa9 | |
|
|
d1ae7d2175 | |
|
|
ccb76e2fa7 | |
|
|
d42269e5ab | |
|
|
4f2d9d9838 | |
|
|
7f0ca677a4 | |
|
|
4431b20e0d | |
|
|
7225a45c96 | |
|
|
bf8edc820b | |
|
|
3ecbb5665d | |
|
|
87d6a5a96e | |
|
|
14d0788779 | |
|
|
93bbb990a5 | |
|
|
357d6c7bc6 | |
|
|
9da3e6c32b | |
|
|
3f6534c494 | |
|
|
2514be218f | |
|
|
42d25afadf | |
|
|
a4bbb9b209 | |
|
|
77fd23c637 | |
|
|
cb42bfb00c | |
|
|
91250ed6b0 | |
|
|
df6c3ebdd9 | |
|
|
9f7d4a1517 | |
|
|
8c9acaff30 | |
|
|
ca06917a77 | |
|
|
d9fae65d26 | |
|
|
c66b8ba441 | |
|
|
79a4ecc685 | |
|
|
d18a243045 | |
|
|
9bdd6acfbc | |
|
|
e00a90b671 | |
|
|
d12b4fa6c5 | |
|
|
eca167e0e3 | |
|
|
8cd01639b6 | |
|
|
0b3f3244c9 | |
|
|
d0f9fd1a84 | |
|
|
794f085a63 | |
|
|
9d80d2011b | |
|
|
1e73449c46 | |
|
|
49f963b687 | |
|
|
d6011fe0fb | |
|
|
0dc64e6110 | |
|
|
dd31ec30fc | |
|
|
53fee18254 | |
|
|
0fb6e8c6dc | |
|
|
c8bcc9a0c9 | |
|
|
f9c767f1b8 | |
|
|
ea31f3f7e7 | |
|
|
38e58c3bf6 | |
|
|
54380c5f19 | |
|
|
f37bb7e26a | |
|
|
9cd3fa7f9c | |
|
|
3e71120c76 | |
|
|
be30eda5fc | |
|
|
34b8186e0c | |
|
|
29ee45fb17 | |
|
|
0aa17bb08a | |
|
|
877c51ae67 | |
|
|
326074ca4d | |
|
|
3d589a0a76 | |
|
|
0e0fc16e07 | |
|
|
cd188e1ec9 | |
|
|
06699b84c0 | |
|
|
9f61cc978e | |
|
|
bf13f8387d | |
|
|
860e2c3715 | |
|
|
e06ba8eea2 | |
|
|
afea837092 | |
|
|
4d82d99a1c | |
|
|
a666b0b943 | |
|
|
9e0a6930d2 | |
|
|
e6366ac68b | |
|
|
ac7e6a2b9a | |
|
|
e4ce51a18b | |
|
|
241dc2d442 | |
|
|
0262ac5ab4 | |
|
|
945d6eab5b | |
|
|
f57d272980 | |
|
|
9782a0293e | |
|
|
0c1964475a | |
|
|
65c1546adf | |
|
|
aefbb66e57 | |
|
|
aaeabaaa4a | |
|
|
7575cdd59b | |
|
|
4976a329b3 | |
|
|
77080ea162 | |
|
|
6e4a319bb6 | |
|
|
17f2e05ae4 | |
|
|
2c88f947fb | |
|
|
8784865790 | |
|
|
0811a95ada | |
|
|
a088f9fcdd | |
|
|
5616059712 | |
|
|
4b10bcf317 | |
|
|
bcd395c2a6 | |
|
|
9018f78c81 | |
|
|
c6446c72b9 | |
|
|
76642790d5 | |
|
|
50ccdaa4b8 | |
|
|
55ce6cdfa8 | |
|
|
c8a83a27c4 | |
|
|
cc9a67157d | |
|
|
bcaeb4bf89 | |
|
|
b515bafd33 | |
|
|
e0b461e53e | |
|
|
a581db7f0c | |
|
|
89457994ba | |
|
|
0ce8b56f82 | |
|
|
81ce7a11f4 | |
|
|
e7dedcd42c | |
|
|
aec1610fcb | |
|
|
71f664fe44 | |
|
|
6f5bde2413 | |
|
|
bc124e2068 | |
|
|
2b620d9578 | |
|
|
1a31d5a938 | |
|
|
16c617f21a | |
|
|
b5478a2037 | |
|
|
7265c46b20 | |
|
|
ceb6f843fd | |
|
|
c0d57d970b |
|
|
@ -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.
|
||||||
|
|
@ -1,6 +1,11 @@
|
||||||
# Xcode
|
## OS X Finder
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
## Build generated
|
||||||
build/
|
build/
|
||||||
|
DerivedData
|
||||||
|
|
||||||
|
## Various settings
|
||||||
*.pbxuser
|
*.pbxuser
|
||||||
!default.pbxuser
|
!default.pbxuser
|
||||||
*.mode1v3
|
*.mode1v3
|
||||||
|
|
@ -10,17 +15,40 @@ build/
|
||||||
*.perspectivev3
|
*.perspectivev3
|
||||||
!default.perspectivev3
|
!default.perspectivev3
|
||||||
xcuserdata
|
xcuserdata
|
||||||
|
|
||||||
|
## Other
|
||||||
*.xccheckout
|
*.xccheckout
|
||||||
*.moved-aside
|
*.moved-aside
|
||||||
DerivedData
|
*.xcuserstate
|
||||||
|
*.xcscmblueprint
|
||||||
|
|
||||||
|
## Obj-C/Swift specific
|
||||||
*.hmap
|
*.hmap
|
||||||
*.ipa
|
*.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
|
# CocoaPods
|
||||||
#
|
#
|
||||||
# We recommend against adding the Pods directory to your .gitignore. However
|
# We recommend against adding the Pods directory to your .gitignore. However
|
||||||
# you should judge for yourself, the pros and cons are mentioned at:
|
# 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/
|
# Pods/
|
||||||
|
|
||||||
|
# Carthage
|
||||||
|
#
|
||||||
|
# Add this line if you want to avoid checking in source code from Carthage dependencies.
|
||||||
|
# Carthage/Checkouts
|
||||||
|
|
||||||
|
Carthage/Build
|
||||||
|
|
||||||
|
.swift-version
|
||||||
|
|
@ -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)
|
||||||
|
|
@ -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
|
||||||
|
|
@ -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
|
||||||
|
|
@ -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.
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
github "Quick/Quick"
|
||||||
|
github "Quick/Nimble"
|
||||||
|
|
@ -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 */;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "self:Example.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
||||||
|
|
@ -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:.
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,21 +1,38 @@
|
||||||
{
|
{
|
||||||
"images" : [
|
"images" : [
|
||||||
{
|
{
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"size" : "20x20",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"size" : "20x20",
|
||||||
|
"scale" : "3x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "iphone",
|
||||||
"size" : "29x29",
|
"size" : "29x29",
|
||||||
"idiom" : "iphone",
|
|
||||||
"filename" : "xl_appicon_58.png",
|
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"size" : "29x29",
|
||||||
|
"scale" : "3x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "iphone",
|
||||||
"size" : "40x40",
|
"size" : "40x40",
|
||||||
"idiom" : "iphone",
|
|
||||||
"filename" : "xl_appicon_80.png",
|
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"size" : "60x60",
|
|
||||||
"idiom" : "iphone",
|
"idiom" : "iphone",
|
||||||
"filename" : "xl_appicon_120.png",
|
"size" : "40x40",
|
||||||
|
"scale" : "3x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"size" : "60x60",
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 7.9 KiB |
|
|
@ -2,8 +2,8 @@
|
||||||
"images" : [
|
"images" : [
|
||||||
{
|
{
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
"scale" : "1x",
|
"filename" : "Apu_Nahasapeemapetilon.png",
|
||||||
"filename" : "Apu_Nahasapeemapetilon.png"
|
"scale" : "1x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.1 KiB |
|
|
@ -2,8 +2,8 @@
|
||||||
"images" : [
|
"images" : [
|
||||||
{
|
{
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
"scale" : "1x",
|
"filename" : "Bart_Simpsons.png",
|
||||||
"filename" : "Lisa_Simpsons.png"
|
"scale" : "1x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
"images" : [
|
"images" : [
|
||||||
{
|
{
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
"scale" : "1x",
|
"filename" : "Homer_Simpsons.png",
|
||||||
"filename" : "Homer_Simpsons.png"
|
"scale" : "1x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
|
@ -2,8 +2,8 @@
|
||||||
"images" : [
|
"images" : [
|
||||||
{
|
{
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
"scale" : "1x",
|
"filename" : "Lisa_Simpsons.png",
|
||||||
"filename" : "Bart_Simpsons.png"
|
"scale" : "1x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
|
@ -2,8 +2,8 @@
|
||||||
"images" : [
|
"images" : [
|
||||||
{
|
{
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
"scale" : "1x",
|
"filename" : "Maggie_Simpsons.png",
|
||||||
"filename" : "Maggie_Simpsons.png"
|
"scale" : "1x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
|
@ -2,8 +2,8 @@
|
||||||
"images" : [
|
"images" : [
|
||||||
{
|
{
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
"scale" : "1x",
|
"filename" : "Marge_Simpsons.png",
|
||||||
"filename" : "Marge_Simpsons.png"
|
"scale" : "1x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
21
Example/Example/Assets.xcassets/Simpsons/Montgomery_Burns.imageset/Contents.json
vendored
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
|
@ -2,8 +2,8 @@
|
||||||
"images" : [
|
"images" : [
|
||||||
{
|
{
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
"scale" : "1x",
|
"filename" : "Ned_Flanders.png",
|
||||||
"filename" : "Ned_Flanders.png"
|
"scale" : "1x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
|
@ -2,8 +2,8 @@
|
||||||
"images" : [
|
"images" : [
|
||||||
{
|
{
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
"scale" : "1x",
|
"filename" : "Otto_Mann.png",
|
||||||
"filename" : "Otto_Mann.png"
|
"scale" : "1x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
21
Example/Example/Assets.xcassets/Simpsons/default-avatar.imageset/Contents.json
vendored
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 244 B After Width: | Height: | Size: 244 B |
|
Before Width: | Height: | Size: 293 B After Width: | Height: | Size: 293 B |
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 282 B After Width: | Height: | Size: 282 B |
|
Before Width: | Height: | Size: 342 B After Width: | Height: | Size: 342 B |
22
Example/Example/Assets.xcassets/TabBar/icon_segmented.imageset/Contents.json
vendored
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 274 B After Width: | Height: | Size: 274 B |
|
Before Width: | Height: | Size: 388 B After Width: | Height: | Size: 388 B |
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 421 B After Width: | Height: | Size: 421 B |
|
Before Width: | Height: | Size: 700 B After Width: | Height: | Size: 700 B |
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 946 B |
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
Example/Example/Assets.xcassets/Youtube/more_options.imageset/more_options@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 684 B |
BIN
Example/Example/Assets.xcassets/Youtube/more_options.imageset/more_options@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 1.2 KiB |
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 2.0 KiB |
|
|
@ -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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
//
|
// PostCell.swift
|
||||||
// XLPagerTabStripTests.m
|
|
||||||
// XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip )
|
// 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
|
// 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
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
// THE SOFTWARE.
|
// THE SOFTWARE.
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
import UIKit
|
||||||
#import <XCTest/XCTest.h>
|
|
||||||
|
|
||||||
@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 {
|
func configureWithData(_ data: NSDictionary) {
|
||||||
[super setUp];
|
if let post = data["post"] as? NSDictionary, let user = post["user"] as? NSDictionary {
|
||||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
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
|
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
//
|
// YoutubeIconCell.swift
|
||||||
// AppDelegate.h
|
|
||||||
// XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip )
|
// 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
|
// 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
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
// THE SOFTWARE.
|
// 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
|
}
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
//
|
// YoutubeIconWithLabelCell.swift
|
||||||
// TableChildExampleViewController.h
|
|
||||||
// XLPagerTabStrip ( https://github.com/xmartlabs/XLPagerTabStrip )
|
// 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
|
// 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
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
// THE SOFTWARE.
|
// THE SOFTWARE.
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
import Foundation
|
||||||
#import "XLPagerTabStripViewController.h"
|
import UIKit
|
||||||
|
|
||||||
@interface TableChildExampleViewController : UITableViewController <XLPagerTabStripChildItem>
|
class YoutubeIconWithLabelCell: UICollectionViewCell {
|
||||||
|
|
||||||
|
@IBOutlet weak var iconImage: UIImageView!
|
||||||
|
@IBOutlet weak var iconLabel: UILabel!
|
||||||
|
|
||||||
@end
|
}
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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 it’s 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.
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 133 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 110 KiB |
|
After Width: | Height: | Size: 438 KiB |
|
After Width: | Height: | Size: 147 KiB |
|
After Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 182 KiB |
3
LICENSE
|
|
@ -1,6 +1,6 @@
|
||||||
The MIT License (MIT)
|
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
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
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,
|
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
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
@ -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"
|
||||||
|
|
@ -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>
|
||||||
382
README.md
|
|
@ -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> -->
|
||||||
|
|
||||||
[](https://github.com/xmartlabs/XLPagerTabStrip/blob/master/LICENSE)
|
</p>
|
||||||
[](https://github.com/xmartlabs/XLPagerTabStrip/releases)
|
|
||||||
|
Made with ❤️ by [XMARTLABS](http://xmartlabs.com).
|
||||||
|
|
||||||
Android [PagerTabStrip](http://developer.android.com/reference/android/support/v4/view/PagerTabStrip.html) for iOS!
|
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.
|
||||||
|
|
||||||

|
<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
|
* If you **want to contribute** please feel free to **submit pull requests**.
|
||||||
--------
|
* If you **have a feature request** please **open an issue**.
|
||||||
**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 **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
|
Long time ago twitter app made use of this type of pager in the app main screen.
|
||||||
-(void)moveToViewControllerAtIndex:(NSUInteger)index;
|
|
||||||
-(void)moveToViewControllerAtIndex:(NSUInteger)index animated:(BOOL)animated;
|
<img src="Example/twitter.gif" width="250"/>
|
||||||
-(void)moveToViewController:(UIViewController *)viewController;
|
|
||||||
-(void)moveToViewController:(UIViewController *)viewController animated:(BOOL)animated;
|
### 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
|
Drag into the storyboard a `UIViewController` and set up its class with your pager controller (`MyPagerTabStripName`).
|
||||||
@property (copy) void (^changeCurrentIndexProgressiveBlock)(XLButtonBarViewCell* oldCell, XLButtonBarViewCell *newCell, CGFloat progressPercentage, BOOL indexWasChanged, BOOL animated);
|
Drag a `UIScrollView` into your view controller view and connect `PagerTabStripViewController` `containerView` outlet with the scroll view.
|
||||||
@property (copy) void (^changeCurrentIndexBlock)(XLButtonBarViewCell* oldCell, XLButtonBarViewCell *newCell, BOOL animated);
|
|
||||||
|
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 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.
|
||||||
--------------------------
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
|
|
||||||
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)
|
```swift
|
||||||
* Indicators can be added at any position of the screen through storyboard layouts.
|
class MyEmbeddedViewController: UITableViewController, IndicatorInfoProvider {
|
||||||
* 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)
|
func indicatorInfo(for pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo {
|
||||||
* Add space padding between view controllers
|
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
|
### ButtonBar Customization
|
||||||
* iOS 7.0 and above
|
|
||||||
|
```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`.
|
* iOS 8.0+
|
||||||
* `shouldCellsFillAvailableWidth` added to `XLButtonBarView`.
|
* Xcode 9.3+
|
||||||
* Bug fixes and Stability improvements.
|
|
||||||
|
|
||||||
Version 2.0.0
|
## Examples
|
||||||
|
|
||||||
* Added ability to change look and feel of selected tab.
|
Follow these 3 steps to run Example project: Clone XLPagerTabStrip repository, open XLPagerTabStrip workspace and run the *Example* project.
|
||||||
* `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.
|
|
||||||
|
|
||||||
Version 1.1.1
|
## Installation
|
||||||
|
|
||||||
* Nav Button example added
|
### CocoaPods
|
||||||
* Support for iOS 7.0 and above
|
|
||||||
|
|
||||||
Version 1.1.0
|
[CocoaPods](https://cocoapods.org/) is a dependency manager for Cocoa projects.
|
||||||
|
|
||||||
* Twitter pager added
|
To install XLPagerTabStrip, simply add the following line to your Podfile:
|
||||||
* Bug fixes and stability improvements
|
|
||||||
|
|
||||||
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
|
## FAQ
|
||||||
* Martin Pastorin ([@dmpastorin](http://twitter.com/dmpastorin "@dmpastorin"))
|
|
||||||
* [Full contributors list](https://github.com/xmartlabs/XLPagerTabStrip/graphs/contributors)
|
|
||||||
|
|
||||||
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).
|
```swift
|
||||||
[@xmartlabs](http://twitter.com/xmartlabs "@xmartlabs")
|
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.
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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)
|
||||||
|
}
|
||||||
|
}
|
||||||