Compare commits

...

49 Commits

Author SHA1 Message Date
Igor Kislyuk 7473ff0b1d Fix. Add more space for label 2017-03-30 17:53:14 +03:00
Serhii Butenko 8a21e29e89 Fix word overbounds (closes #16) 2017-01-17 08:46:08 +02:00
Boris Vinogradov 51f08913fb Update README.md 2017-01-13 12:42:25 +02:00
Boris Vinogradov 8042192731 Update LICENSE 2017-01-13 12:42:00 +02:00
Serhii Butenko 80d911795c Merge pull request #36 from piechart/master
Code examples updated to Swift 3 syntax
2016-12-21 22:52:05 +02:00
Michael Galperin e14c5c0b16 Code examples updated to Swift 3 2016-12-21 23:44:54 +03:00
Serhii Butenko cf3f6aaba0 Merge pull request #32 from maxcampolo/fix/reload
Fix/reload
2016-12-09 18:20:55 +02:00
Serhii Butenko dd65378ed5 Merge pull request #30 from maxcampolo/dev
SegmentioItem public getters
2016-12-09 18:20:28 +02:00
Max Campolo 05fb10bee7 Reload collection view in reloadSegmentio method 2016-12-09 10:49:16 -05:00
Max Campolo 50ecb102e7 Remove private setter 2016-12-06 09:22:06 -05:00
Max Campolo 6b542845f3 Make getter public for SegmentioItem variables 2016-12-05 11:47:17 -05:00
Serhii Butenko 06f6b0056b Merge pull request #29 from Yalantis/feature/28
Feature/28
2016-12-01 14:52:43 +02:00
Serhii Butenko 13494d9f38
Bump version 2016-12-01 14:52:09 +02:00
Serhii Butenko 790e466868
Make items property public 2016-12-01 14:51:46 +02:00
Serhii Butenko 715b851ca0 Update ISSUE_TEMPLATE.md 2016-11-24 13:29:01 +02:00
Dmitriy Demchenko a71ab5ecca [Update] Segmentio.podspec 2016-11-24 12:29:38 +02:00
Dmitriy Demchenko 75aa08272e [Update] Carthage: info.plist, project.pbxproj 2016-11-24 12:20:05 +02:00
Dmitriy Demchenko 73e1dd3402 [Update] plist.info 2016-11-24 12:17:03 +02:00
Dmitriy Demchenko fab49af07c [Update] project.pbxproj, Segmentio-Example.xcscheme 2016-11-24 12:15:46 +02:00
Dmitriy Demchenko eeda04fffb [Update] README.md 2016-11-24 12:14:08 +02:00
Dmitriy Demchenko 07f7d884fc [Add] SegmentioBuilder
[Update] ExampleViewController: moved setup segmentioView logic to SegmentioBuilder
[Fix] Autolayout issue using Segmentio programtically
[Update] SegmentioItem, SegmentioCell: minor updates
2016-11-14 13:07:54 +02:00
Dmitriy Demchenko e85b4ccb95 [Update] LICENSE file
[Add] ExampleViewController: overrided viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator)
[Add] Segmentio: added function interfaceOrientationDidChange
[Remove] Segmentio: removed var cachedOrientation
2016-11-11 17:05:00 +02:00
Dmitriy Demchenko f93e6be578 [Update] LaunchScreen.storyboard: updated constraints for Xcode 8
[Update] Main.storyboard: updated constraints for Xcode 8
[Fix] ExampleViewController: fixed segmentioOptions function
2016-11-09 13:22:34 +02:00
Igor Muzyka a97be5838e Merge pull request #17 from IgorMuzyka/master
Fixes issue #1
2016-11-07 16:55:53 +02:00
Igor Muzyka ac9cf49b69 Fixes issue #1 2016-11-07 16:55:21 +02:00
Igor Muzyka 848dfe4d32 Merge pull request #13 from kobylyanets/master
Added animationDuration and numberOfLines of segmentTitleLabel to SegmentioOptions.
2016-11-07 16:52:00 +02:00
Edward Kobylyanets 2808a754eb Add animationDuration and numberOfLines of segmentTitleLabel to SegmentioOptions. Update README.md. 2016-10-19 09:56:52 +03:00
Serhii Butenko 34cf755361 Merge pull request #11 from Yalantis/swift3
Swift3
2016-10-10 08:23:15 +03:00
Serhii Butenko 20ff7d7b66 Bump version 2016-10-10 08:17:32 +03:00
Serhii Butenko 854cc9c302 Specify swift version 2016-10-10 08:17:23 +03:00
Serhii Butenko 6e640d921b Add missed files for Carthage 2016-10-10 08:16:05 +03:00
Serhii Butenko 5dae83d735 Update due to swift 3 guidelines 2016-10-10 08:13:24 +03:00
Serhii Butenko 92cbd32517 Automigration to swift 3 2016-10-05 11:32:49 +03:00
Eugene Pravda b6a1249532 Merge branch 'master' of https://github.com/Yalantis/Segmentio 2016-10-04 12:07:41 +03:00
Serhii Butenko 860f2d85f5 Create ISSUE_TEMPLATE.md 2016-10-04 08:33:38 +03:00
Eugene Pravda ff761f2d61 add container for ImageView 2016-09-30 13:32:38 +03:00
Eugene Pravda 9ff63144d1 update version 2016-09-29 14:06:56 +03:00
Eugene Pravda b4414eb712 update podspec 2016-09-29 13:59:21 +03:00
Eugene Pravda 138636651d ашч сщььутеы 2016-09-28 19:13:21 +03:00
Eugene Pravda 031d470c9a version fix 2016-09-28 18:51:00 +03:00
Eugene Pravda aaeba61117 specupdate 2016-09-28 18:48:11 +03:00
Eugene Pravda 8de3f98187 update podspec 2016-09-28 18:36:54 +03:00
Eugene Pravda ab30cc5329 fix podspec 2016-09-28 18:15:50 +03:00
Eugene Pravda cf206f8184 pod spec update 2016-09-28 18:07:44 +03:00
Eugene Pravda 621957e338 add badges 2016-09-28 17:50:32 +03:00
Eugene Pravda 6eee837927 update constraints 2016-09-28 17:42:48 +03:00
Eugene Pravda 0a537b62d9 add container for titleLable 2016-09-22 18:12:02 +03:00
Eugene Pravda 8a00fe0d90 add start logic for badges appearance 2016-09-22 16:27:21 +03:00
Eugene Pravda 8064c6d8e8 update constraints for text field 2016-09-22 16:26:14 +03:00
60 changed files with 1789 additions and 1385 deletions

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

@ -0,0 +1,43 @@
# Report
> The more information you provide, the faster we can help you.
⚠️ Select what you want - **a feature request** or **report a bug**. Please remove the section you aren't interested in.
## A feature request
### What do you want to add?
> Please describe what you want to add to the component.
### How should it look like?
> Please add images.
## Report a bug
### What did you do?
> Please replace this with what you did.
### What did you expect to happen?
> Please replace this with what you expected to happen.
### What happened instead?
> Please replace this with what happened instead.
### Your Environment
- Version of the component: _insert here_
- Swift version: _insert here_
- iOS version: _insert here_
- Device: _insert here_
- Xcode version: _insert here_
- If you use Cocoapods: _run `pod env | pbcopy` and insert here_
- If you use Carthage: _run `carthage version | pbcopy` and insert here_
### Project that demonstrates the bug
> Please add a link to a project we can download that reproduces the bug.

1
.swift-version Normal file
View File

@ -0,0 +1 @@
3.0

View File

@ -3,10 +3,4 @@ use_frameworks!
target 'Segmentio_Example' do target 'Segmentio_Example' do
pod 'Segmentio', :path => '../' pod 'Segmentio', :path => '../'
target 'Segmentio_Tests' do
inherit! :search_paths
end
end end

View File

@ -1,16 +1,16 @@
PODS: PODS:
- Segmentio (0.1.0) - Segmentio (1.1.3)
DEPENDENCIES: DEPENDENCIES:
- Segmentio (from `../`) - Segmentio (from `../`)
EXTERNAL SOURCES: EXTERNAL SOURCES:
Segmentio: Segmentio:
:path: ../ :path: "../"
SPEC CHECKSUMS: SPEC CHECKSUMS:
Segmentio: 8a27ead74e53d7617c3130eb511ea4c965b0798f Segmentio: f784171237bcbb4854f338aef8162e312f4ac5b8
PODFILE CHECKSUM: 191147ab57f909dd239f59b5bebde4bcab89243e PODFILE CHECKSUM: 761653fe0a6001fe4076ba25b04e279672ecc970
COCOAPODS: 1.0.1 COCOAPODS: 1.1.0.rc.2

View File

@ -1,9 +1,9 @@
{ {
"name": "Segmentio", "name": "Segmentio",
"version": "0.1.0", "version": "1.1.3",
"homepage": "https://github.com/Yalantis/Segmentio", "homepage": "https://github.com/Yalantis/Segmentio",
"summary": "Animated top/bottom segmented control written in Swift!", "summary": "Animated top/bottom segmented control written in Swift!",
"screenshots": "https://raw.githubusercontent.com/Yalantis/Persei/master/Assets/animation.gif", "screenshots": "https://raw.githubusercontent.com/Yalantis/Segmentio/master/Assets/animation.gif",
"authors": "Yalantis", "authors": "Yalantis",
"license": { "license": {
"type": "MIT", "type": "MIT",
@ -15,9 +15,13 @@
}, },
"source": { "source": {
"git": "https://github.com/Yalantis/Segmentio.git", "git": "https://github.com/Yalantis/Segmentio.git",
"tag": "0.1.0" "tag": "1.1.3"
}, },
"source_files": "Segmentio/Source/**/*.swift", "source_files": "Segmentio/Source/**/*.swift",
"resources": "Segmentio/Source/Badge/Views/*.xib",
"resource_bundles": {
"Segmentio": "Segmentio/Source/Badge/Views/*.xib"
},
"module_name": "Segmentio", "module_name": "Segmentio",
"requires_arc": true "requires_arc": true
} }

View File

@ -1,16 +1,16 @@
PODS: PODS:
- Segmentio (0.1.0) - Segmentio (1.1.3)
DEPENDENCIES: DEPENDENCIES:
- Segmentio (from `../`) - Segmentio (from `../`)
EXTERNAL SOURCES: EXTERNAL SOURCES:
Segmentio: Segmentio:
:path: ../ :path: "../"
SPEC CHECKSUMS: SPEC CHECKSUMS:
Segmentio: 8a27ead74e53d7617c3130eb511ea4c965b0798f Segmentio: f784171237bcbb4854f338aef8162e312f4ac5b8
PODFILE CHECKSUM: 191147ab57f909dd239f59b5bebde4bcab89243e PODFILE CHECKSUM: 761653fe0a6001fe4076ba25b04e279672ecc970
COCOAPODS: 1.0.1 COCOAPODS: 1.1.0.rc.2

View File

@ -7,25 +7,30 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
08F3ADCD6D2B9007082089826E712007 /* UIView+Appearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0F88F99DAA1420A4448E3F028F0C8E7F /* UIView+Appearance.swift */; }; 0906DB2204F3DA0B929ED2B2FD92C3BE /* SegmentioCellWithImageOverLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71AC7FDBBA82CCF64068DC1436B7C44C /* SegmentioCellWithImageOverLabel.swift */; };
0BC7695D61D9046BFBE6CFD6B47FFFE1 /* Pods-Segmentio_Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 556AA0B62BF4398859D56C7F281F05FD /* Pods-Segmentio_Example-dummy.m */; }; 0BC7695D61D9046BFBE6CFD6B47FFFE1 /* Pods-Segmentio_Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 8758BAC37EDDE6390078CCD596B97C99 /* Pods-Segmentio_Example-dummy.m */; };
124C21C2A8B015C1BB87D30F4EEA0214 /* SegmentioCellWithImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = F42697752DA8A65CBAB3CC0BB442A8C6 /* SegmentioCellWithImage.swift */; }; 0BC8A81C32C10C3EB2DDF82EAD33481D /* SegmentioCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9034CEC1DC6A90954C69B5CF0A879E9D /* SegmentioCell.swift */; };
1B164D4FADAAAD401CDAFB8541C7AC00 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */; }; 11E7945679FA0D80B96BC5DA4B1D00D0 /* SegmentioOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1224468BD5929E62BFF27E1C11853D24 /* SegmentioOptions.swift */; };
386B142514D75786C9544322094E00BB /* Pods-Segmentio_Tests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 7F52E8E5326A4E61091A05424A66750B /* Pods-Segmentio_Tests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 1E8DCF6AD4051E3F7CFD9B55341DD455 /* Segmentio-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = C56AE5AC5779B7D4F6468D2AB474D9E7 /* Segmentio-dummy.m */; };
5DE5F4B816F4E062B3C9278607C5E632 /* SegmentioCellWithImageUnderLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC4EC586E74DCFF8232A11FFEA0592BC /* SegmentioCellWithImageUnderLabel.swift */; }; 1F40A33F3F753FF73C5F80F006E14410 /* Segmentio.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 2AAAF5E594CC994BE5AD10F8928BC48A /* Segmentio.bundle */; };
639A4D6A5BD89BFDD5ED7603F1D18262 /* SegmentioCellWithImageOverLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D491E2303B96AB5AB9AACDBDD0D96BA1 /* SegmentioCellWithImageOverLabel.swift */; }; 20218D2C75E1CA8E41531E94BA06C129 /* SegmentioCellWithImageUnderLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 917595D61BE778C2053B6C375292B042 /* SegmentioCellWithImageUnderLabel.swift */; };
7535676B6DAAED27C9E51F128BA31498 /* SegmentioOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1E1181660922799D84A9AC7A93E4C17 /* SegmentioOptions.swift */; }; 2DA5CD5E23B0E19B8FA2F11146E4A0E5 /* SegmentioCellWithLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A4666D5034926280B3C39CB8CA59319 /* SegmentioCellWithLabel.swift */; };
8B2E8009B9692DF362678E6FE094A084 /* SegmentioCellWithImageAfterLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89381DA5973AFCAEDD65131B6F801D80 /* SegmentioCellWithImageAfterLabel.swift */; }; 4E01C978EC149C600FF7658A6757204A /* SegmentioCellWithImageAfterLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 564D3D18F6E439E721C7D49AC8379559 /* SegmentioCellWithImageAfterLabel.swift */; };
8C08B2CAFA57AFB848065BA4E7CA8F27 /* Segmentio-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 5720677F504FDAE0BB2FF236B2A89893 /* Segmentio-dummy.m */; }; 5BE82675DB7F0C7671EADA9CF99A3C1B /* Segmentio.swift in Sources */ = {isa = PBXBuildFile; fileRef = D91D0C0018887EA8F91F91162FF71F60 /* Segmentio.swift */; };
933D56EF2ECC35F1387B739170AFE07B /* Segmentio-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 588D0BD8821CEBC9689C137D843FA812 /* Segmentio-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 655C575E9623729978F286F79E4EAEB8 /* BadgeWithCounterViewStandardSized.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6E90ECA263F832D2C77F806A4581AE25 /* BadgeWithCounterViewStandardSized.xib */; };
9E50E7327C0F6358FC61855C0205CC8E /* Pods-Segmentio_Tests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = EF8DA8F49FD19F4BD6429F5AA0267180 /* Pods-Segmentio_Tests-dummy.m */; }; 8F726950BDA00432603D2B6B01881D59 /* BadgeWithCounterViewBigSized.xib in Resources */ = {isa = PBXBuildFile; fileRef = 11C011383E55FDF0C1CFAA8E1E01F52C /* BadgeWithCounterViewBigSized.xib */; };
933D56EF2ECC35F1387B739170AFE07B /* Segmentio-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 80BC1DC599A5ED2C131F4E6D0D020D88 /* Segmentio-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
9EE6B5FE2A8EA2C0612C11D34596B7EB /* BadgeViewPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3C9CACA5CC49ABD89BB5C0082B56F17 /* BadgeViewPresenter.swift */; };
BC2B9C2A1711F5583A80C1FA7F6F195F /* SegmentioCellWithImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BF90D3EF6772ECC6F43EF17AAB5C916 /* SegmentioCellWithImage.swift */; };
C1518E27E6C853C813006C349427A4CC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */; }; C1518E27E6C853C813006C349427A4CC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */; };
C5C3FE3FCC48A1460787D130DF0CF12E /* Segmentio.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D794DA325FA95310FAD589F0A6A3BC8 /* Segmentio.swift */; }; C3DB5E9DDBA27211C6E8654A363CA0BC /* UIView+Appearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38BC6E8817CCBFF23555995D47BF0848 /* UIView+Appearance.swift */; };
C4EFEC716055615A27A3D1338426807D /* BadgeWithCounterViewBigSized.xib in Resources */ = {isa = PBXBuildFile; fileRef = 11C011383E55FDF0C1CFAA8E1E01F52C /* BadgeWithCounterViewBigSized.xib */; };
C917381BC4E7C5EFBC2CD2C898C1C8E4 /* SegmentioCellWithImageBeforeLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56D84AE8DDC577C7E7499059038BABBC /* SegmentioCellWithImageBeforeLabel.swift */; };
D29DE39BAA26D8E4DA7534F05DFB78F4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */; }; D29DE39BAA26D8E4DA7534F05DFB78F4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */; };
DC7CDA37564D49D1443EFF857FB8B794 /* SegmentioCellWithImageBeforeLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08337E1EFCACB5981A6FB8F0A5F1D05D /* SegmentioCellWithImageBeforeLabel.swift */; }; D9EBCEA1512D4B307726BFEB5F29EF70 /* BadgeWithCounterViewStandardSized.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6E90ECA263F832D2C77F806A4581AE25 /* BadgeWithCounterViewStandardSized.xib */; };
E0F68CB059B49448534FFDCF5267CCD0 /* SegmentioCellWithLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C30B1407F4DECA9198B795A4C2F8942 /* SegmentioCellWithLabel.swift */; }; E6E0179AF8247CB20CB77A1E33C88C7F /* RoundImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A561B2B4C70B40E0E028301D454D3EBF /* RoundImageView.swift */; };
E15160B05BBD4763B9DD87EAFA105B3B /* SegmentioCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F0CCCB5EF6793D4D584AEF64499C9CC /* SegmentioCell.swift */; }; EA89BD32CAE3C825C749261B9D4A2031 /* Pods-Segmentio_Example-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = FCCE72372A4C77BEF387923951E588F2 /* Pods-Segmentio_Example-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
EA89BD32CAE3C825C749261B9D4A2031 /* Pods-Segmentio_Example-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 401FE729B830FF723B647781804D1F85 /* Pods-Segmentio_Example-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; F6814CD90D68BE2911E97CE7F62E5DA1 /* BadgeWithCounterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64BE9AEFB42AAAC25501C181FF72B653 /* BadgeWithCounterView.swift */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
@ -36,58 +41,60 @@
remoteGlobalIDString = D69CC732EFB91EE42BE73E5030BD387C; remoteGlobalIDString = D69CC732EFB91EE42BE73E5030BD387C;
remoteInfo = Segmentio; remoteInfo = Segmentio;
}; };
B485C2D39BE98A2AA0F4993CC65D306C /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */;
proxyType = 1;
remoteGlobalIDString = D8AEF8C76AD2A8E5BDCDA4CC1BD107B6;
remoteInfo = "Segmentio-Segmentio";
};
/* End PBXContainerItemProxy section */ /* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
08337E1EFCACB5981A6FB8F0A5F1D05D /* SegmentioCellWithImageBeforeLabel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SegmentioCellWithImageBeforeLabel.swift; sourceTree = "<group>"; }; 052C95F5D6DA625FB41DB8135B2A4DE1 /* Pods-Segmentio_Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Segmentio_Example-frameworks.sh"; sourceTree = "<group>"; };
0C30B1407F4DECA9198B795A4C2F8942 /* SegmentioCellWithLabel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SegmentioCellWithLabel.swift; sourceTree = "<group>"; }; 11C011383E55FDF0C1CFAA8E1E01F52C /* BadgeWithCounterViewBigSized.xib */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = file.xib; path = BadgeWithCounterViewBigSized.xib; sourceTree = "<group>"; };
0F88F99DAA1420A4448E3F028F0C8E7F /* UIView+Appearance.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "UIView+Appearance.swift"; sourceTree = "<group>"; }; 1224468BD5929E62BFF27E1C11853D24 /* SegmentioOptions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SegmentioOptions.swift; sourceTree = "<group>"; };
16922E380BC9D1F07E81271A1F0B9F27 /* Pods-Segmentio_Tests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Segmentio_Tests-frameworks.sh"; sourceTree = "<group>"; }; 1BF90D3EF6772ECC6F43EF17AAB5C916 /* SegmentioCellWithImage.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SegmentioCellWithImage.swift; sourceTree = "<group>"; };
268A02043997F7B259BA6A6642A97BFB /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 2AAAF5E594CC994BE5AD10F8928BC48A /* Segmentio.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Segmentio.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
2C6B3BD660EA40765EA46F0735002B06 /* Pods_Segmentio_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Segmentio_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 37602088D7DDBEBF54BCE7CAF18CB105 /* Pods-Segmentio_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Segmentio_Example.debug.xcconfig"; sourceTree = "<group>"; };
401FE729B830FF723B647781804D1F85 /* Pods-Segmentio_Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-Segmentio_Example-umbrella.h"; sourceTree = "<group>"; }; 38BC6E8817CCBFF23555995D47BF0848 /* UIView+Appearance.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "UIView+Appearance.swift"; sourceTree = "<group>"; };
419FF94288A2110D00FAA1CE571FE9FC /* Pods-Segmentio_Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Segmentio_Example-frameworks.sh"; sourceTree = "<group>"; }; 39CC3133DEC50AE996B30883B4A76CFC /* Segmentio-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Segmentio-prefix.pch"; sourceTree = "<group>"; };
4938DA306399C05E56EDBA62544340BE /* Pods-Segmentio_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Segmentio_Tests.debug.xcconfig"; sourceTree = "<group>"; }; 428DB76E87B8795FDAD056914F0EB8BD /* Pods-Segmentio_Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-Segmentio_Example-acknowledgements.markdown"; sourceTree = "<group>"; };
556AA0B62BF4398859D56C7F281F05FD /* Pods-Segmentio_Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-Segmentio_Example-dummy.m"; sourceTree = "<group>"; }; 4DA45A534C62C7379DB6EF50F3B4DBFA /* Segmentio.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Segmentio.modulemap; sourceTree = "<group>"; };
5720677F504FDAE0BB2FF236B2A89893 /* Segmentio-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Segmentio-dummy.m"; sourceTree = "<group>"; }; 5152D5684BA571B16D3CBB78B9F81B75 /* Pods-Segmentio_Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-Segmentio_Example-acknowledgements.plist"; sourceTree = "<group>"; };
588D0BD8821CEBC9689C137D843FA812 /* Segmentio-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Segmentio-umbrella.h"; sourceTree = "<group>"; }; 564D3D18F6E439E721C7D49AC8379559 /* SegmentioCellWithImageAfterLabel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SegmentioCellWithImageAfterLabel.swift; sourceTree = "<group>"; };
5F0CCCB5EF6793D4D584AEF64499C9CC /* SegmentioCell.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SegmentioCell.swift; sourceTree = "<group>"; }; 56D84AE8DDC577C7E7499059038BABBC /* SegmentioCellWithImageBeforeLabel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SegmentioCellWithImageBeforeLabel.swift; sourceTree = "<group>"; };
658964FCFD27351CDFF8EBE97B8459B6 /* Pods-Segmentio_Tests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-Segmentio_Tests.modulemap"; sourceTree = "<group>"; }; 5D4E8D49DE85EE73865F0FFAE93ACDA8 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
67714CDF4FF7EE5C90A0F1AB1AAAD011 /* Pods-Segmentio_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Segmentio_Example.release.xcconfig"; sourceTree = "<group>"; }; 64BE9AEFB42AAAC25501C181FF72B653 /* BadgeWithCounterView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = BadgeWithCounterView.swift; sourceTree = "<group>"; };
7400982A0FA63A0BBCEAC3AC177EAD2E /* Segmentio-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Segmentio-prefix.pch"; sourceTree = "<group>"; }; 6A4666D5034926280B3C39CB8CA59319 /* SegmentioCellWithLabel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SegmentioCellWithLabel.swift; sourceTree = "<group>"; };
78A7E87C7803313F0A7310B468DFFCEA /* Segmentio.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Segmentio.xcconfig; sourceTree = "<group>"; }; 6E90ECA263F832D2C77F806A4581AE25 /* BadgeWithCounterViewStandardSized.xib */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = file.xib; path = BadgeWithCounterViewStandardSized.xib; sourceTree = "<group>"; };
7F52E8E5326A4E61091A05424A66750B /* Pods-Segmentio_Tests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-Segmentio_Tests-umbrella.h"; sourceTree = "<group>"; }; 71AC7FDBBA82CCF64068DC1436B7C44C /* SegmentioCellWithImageOverLabel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SegmentioCellWithImageOverLabel.swift; sourceTree = "<group>"; };
89381DA5973AFCAEDD65131B6F801D80 /* SegmentioCellWithImageAfterLabel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SegmentioCellWithImageAfterLabel.swift; sourceTree = "<group>"; }; 808E8A2F66FEF9BFA423C8B51FEB3FD3 /* Pods-Segmentio_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Segmentio_Example.release.xcconfig"; sourceTree = "<group>"; };
8D794DA325FA95310FAD589F0A6A3BC8 /* Segmentio.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Segmentio.swift; sourceTree = "<group>"; }; 80BC1DC599A5ED2C131F4E6D0D020D88 /* Segmentio-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Segmentio-umbrella.h"; sourceTree = "<group>"; };
8758BAC37EDDE6390078CCD596B97C99 /* Pods-Segmentio_Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-Segmentio_Example-dummy.m"; sourceTree = "<group>"; };
9034CEC1DC6A90954C69B5CF0A879E9D /* SegmentioCell.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SegmentioCell.swift; sourceTree = "<group>"; };
917595D61BE778C2053B6C375292B042 /* SegmentioCellWithImageUnderLabel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SegmentioCellWithImageUnderLabel.swift; sourceTree = "<group>"; };
93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
982EB7C450661AE87828BC4011C51E5B /* Pods-Segmentio_Tests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-Segmentio_Tests-acknowledgements.plist"; sourceTree = "<group>"; }; 9D06B7FD5EDA771583A3CF08D0F68DE9 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9E0F52B6EE035F8DC32250C8800B6878 /* Pods_Segmentio_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Segmentio_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A561B2B4C70B40E0E028301D454D3EBF /* RoundImageView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = RoundImageView.swift; sourceTree = "<group>"; };
9E292B4C29D95C54CEC5B8BC3C6C9189 /* Pods-Segmentio_Example-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Segmentio_Example-resources.sh"; sourceTree = "<group>"; }; AAF3441A43AA58E58A7340FA1E66271B /* Segmentio.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Segmentio.xcconfig; sourceTree = "<group>"; };
A0A2FACDEADFA4A30C47F0C37BCE0211 /* Pods-Segmentio_Tests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-Segmentio_Tests-acknowledgements.markdown"; sourceTree = "<group>"; }; AE666A58F4294719B8B89D33423889C4 /* Pods-Segmentio_Example-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Segmentio_Example-resources.sh"; sourceTree = "<group>"; };
ADC48C4E9F258114BD508838EF31778D /* Pods-Segmentio_Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-Segmentio_Example-acknowledgements.plist"; sourceTree = "<group>"; }; B07FA81FE6C58F8096D157CF2D32550A /* Pods_Segmentio_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Segmentio_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
AF767C5305A74E237D044DB939285A7E /* Pods-Segmentio_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Segmentio_Tests.release.xcconfig"; sourceTree = "<group>"; }; B2527411739A24C97909490FC5C54F10 /* Pods-Segmentio_Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-Segmentio_Example.modulemap"; sourceTree = "<group>"; };
C332BBDBF329D75B42E3D4DFBC367750 /* Segmentio.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Segmentio.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B5ED1F4A55A82441D24099184B5077B5 /* ResourceBundle-Segmentio-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "ResourceBundle-Segmentio-Info.plist"; sourceTree = "<group>"; };
C373AAC9C68346B42AC567AD943825F7 /* Segmentio.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Segmentio.framework; sourceTree = BUILT_PRODUCTS_DIR; };
C56AE5AC5779B7D4F6468D2AB474D9E7 /* Segmentio-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Segmentio-dummy.m"; sourceTree = "<group>"; };
CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
D173F1BEABAEE16C03D2454763755F7F /* Pods-Segmentio_Tests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Segmentio_Tests-resources.sh"; sourceTree = "<group>"; }; D91D0C0018887EA8F91F91162FF71F60 /* Segmentio.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Segmentio.swift; sourceTree = "<group>"; };
D39DD292AD471BA3FE7A27E198143BD8 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; E3C9CACA5CC49ABD89BB5C0082B56F17 /* BadgeViewPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = BadgeViewPresenter.swift; sourceTree = "<group>"; };
D491E2303B96AB5AB9AACDBDD0D96BA1 /* SegmentioCellWithImageOverLabel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SegmentioCellWithImageOverLabel.swift; sourceTree = "<group>"; }; FCCE72372A4C77BEF387923951E588F2 /* Pods-Segmentio_Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-Segmentio_Example-umbrella.h"; sourceTree = "<group>"; };
DC4EC586E74DCFF8232A11FFEA0592BC /* SegmentioCellWithImageUnderLabel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SegmentioCellWithImageUnderLabel.swift; sourceTree = "<group>"; };
E1E1181660922799D84A9AC7A93E4C17 /* SegmentioOptions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SegmentioOptions.swift; sourceTree = "<group>"; };
ED9CA87F92ABA496B1E37F56B1948C95 /* Pods-Segmentio_Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-Segmentio_Example.modulemap"; sourceTree = "<group>"; };
EF8DA8F49FD19F4BD6429F5AA0267180 /* Pods-Segmentio_Tests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-Segmentio_Tests-dummy.m"; sourceTree = "<group>"; };
F14C0898393B1E9176017283D91269D8 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
F19F298463BD01E9E89AB6CF25EA81A5 /* Pods-Segmentio_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Segmentio_Example.debug.xcconfig"; sourceTree = "<group>"; };
F3B2A210AED19F381858EA69A5588808 /* Segmentio.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Segmentio.modulemap; sourceTree = "<group>"; };
F42697752DA8A65CBAB3CC0BB442A8C6 /* SegmentioCellWithImage.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SegmentioCellWithImage.swift; sourceTree = "<group>"; };
F4C7373D0CC433083738F6FFB0808DDD /* Pods-Segmentio_Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-Segmentio_Example-acknowledgements.markdown"; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
99B28BB930C96B4D06CABF8D3B8832D5 /* Frameworks */ = { CF0100512E0E927F05DB406E0E01DF38 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
1B164D4FADAAAD401CDAFB8541C7AC00 /* Foundation.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -110,25 +117,42 @@
/* End PBXFrameworksBuildPhase section */ /* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */ /* Begin PBXGroup section */
262CA74000605615391CA6EC4293E986 /* Segmentio */ = { 00A2FBBF1263542044856398E75BAA76 /* Extensions */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
E3C287FD31CE5425024C393185997E3E /* Segmentio */, A561B2B4C70B40E0E028301D454D3EBF /* RoundImageView.swift */,
B301CE3581EA441B88CE7A4817B8D17E /* Support Files */, 38BC6E8817CCBFF23555995D47BF0848 /* UIView+Appearance.swift */,
);
path = Extensions;
sourceTree = "<group>";
};
093352DB8919FB70FCBB908FAD994FCF /* Resources */ = {
isa = PBXGroup;
children = (
D99857A2684E0E97D1E32D0B130B5366 /* Segmentio */,
);
name = Resources;
sourceTree = "<group>";
};
1C2ABA084F34F1E71EB56C0EA2DD4699 /* Badge */ = {
isa = PBXGroup;
children = (
C65C2B1DCC149D19571A5F7FAE3D31AF /* Views */,
);
path = Badge;
sourceTree = "<group>";
};
31B6F91EE13CA09F760DFFB67BF7137A /* Segmentio */ = {
isa = PBXGroup;
children = (
093352DB8919FB70FCBB908FAD994FCF /* Resources */,
AF8947D7DBED0C96C3826FC2B0ED8A3A /* Segmentio */,
413F9187DDE34CC36B0E06866BC84500 /* Support Files */,
); );
name = Segmentio; name = Segmentio;
path = ../..; path = ../..;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
31FE64FF9D2E3D0D88D47DB5DEFE398A /* Targets Support Files */ = {
isa = PBXGroup;
children = (
545652130C56132D6876397F52E283C4 /* Pods-Segmentio_Example */,
9FD684E4FD33C116E64DE188DB108EB9 /* Pods-Segmentio_Tests */,
);
name = "Targets Support Files";
sourceTree = "<group>";
};
3DCAB2B7CDE207B3958B6CB957FCC758 /* iOS */ = { 3DCAB2B7CDE207B3958B6CB957FCC758 /* iOS */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@ -137,60 +161,65 @@
name = iOS; name = iOS;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
47DD221E11AD5E3ABBE22D1B01521963 /* Extensions */ = { 413F9187DDE34CC36B0E06866BC84500 /* Support Files */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
0F88F99DAA1420A4448E3F028F0C8E7F /* UIView+Appearance.swift */, 5D4E8D49DE85EE73865F0FFAE93ACDA8 /* Info.plist */,
B5ED1F4A55A82441D24099184B5077B5 /* ResourceBundle-Segmentio-Info.plist */,
4DA45A534C62C7379DB6EF50F3B4DBFA /* Segmentio.modulemap */,
AAF3441A43AA58E58A7340FA1E66271B /* Segmentio.xcconfig */,
C56AE5AC5779B7D4F6468D2AB474D9E7 /* Segmentio-dummy.m */,
39CC3133DEC50AE996B30883B4A76CFC /* Segmentio-prefix.pch */,
80BC1DC599A5ED2C131F4E6D0D020D88 /* Segmentio-umbrella.h */,
); );
path = Extensions; name = "Support Files";
path = "Example/Pods/Target Support Files/Segmentio";
sourceTree = "<group>"; sourceTree = "<group>";
}; };
545652130C56132D6876397F52E283C4 /* Pods-Segmentio_Example */ = { 635B6B346CBAAB1DB0593E0D25A25ED9 /* Views */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
268A02043997F7B259BA6A6642A97BFB /* Info.plist */, 64BE9AEFB42AAAC25501C181FF72B653 /* BadgeWithCounterView.swift */,
ED9CA87F92ABA496B1E37F56B1948C95 /* Pods-Segmentio_Example.modulemap */, );
F4C7373D0CC433083738F6FFB0808DDD /* Pods-Segmentio_Example-acknowledgements.markdown */, path = Views;
ADC48C4E9F258114BD508838EF31778D /* Pods-Segmentio_Example-acknowledgements.plist */, sourceTree = "<group>";
556AA0B62BF4398859D56C7F281F05FD /* Pods-Segmentio_Example-dummy.m */, };
419FF94288A2110D00FAA1CE571FE9FC /* Pods-Segmentio_Example-frameworks.sh */, 6706DE9909DD65117E2381108D4EC33E /* Pods-Segmentio_Example */ = {
9E292B4C29D95C54CEC5B8BC3C6C9189 /* Pods-Segmentio_Example-resources.sh */, isa = PBXGroup;
401FE729B830FF723B647781804D1F85 /* Pods-Segmentio_Example-umbrella.h */, children = (
F19F298463BD01E9E89AB6CF25EA81A5 /* Pods-Segmentio_Example.debug.xcconfig */, 9D06B7FD5EDA771583A3CF08D0F68DE9 /* Info.plist */,
67714CDF4FF7EE5C90A0F1AB1AAAD011 /* Pods-Segmentio_Example.release.xcconfig */, B2527411739A24C97909490FC5C54F10 /* Pods-Segmentio_Example.modulemap */,
428DB76E87B8795FDAD056914F0EB8BD /* Pods-Segmentio_Example-acknowledgements.markdown */,
5152D5684BA571B16D3CBB78B9F81B75 /* Pods-Segmentio_Example-acknowledgements.plist */,
8758BAC37EDDE6390078CCD596B97C99 /* Pods-Segmentio_Example-dummy.m */,
052C95F5D6DA625FB41DB8135B2A4DE1 /* Pods-Segmentio_Example-frameworks.sh */,
AE666A58F4294719B8B89D33423889C4 /* Pods-Segmentio_Example-resources.sh */,
FCCE72372A4C77BEF387923951E588F2 /* Pods-Segmentio_Example-umbrella.h */,
37602088D7DDBEBF54BCE7CAF18CB105 /* Pods-Segmentio_Example.debug.xcconfig */,
808E8A2F66FEF9BFA423C8B51FEB3FD3 /* Pods-Segmentio_Example.release.xcconfig */,
); );
name = "Pods-Segmentio_Example"; name = "Pods-Segmentio_Example";
path = "Target Support Files/Pods-Segmentio_Example"; path = "Target Support Files/Pods-Segmentio_Example";
sourceTree = "<group>"; sourceTree = "<group>";
}; };
5938CEA6F620530E483550DA66B62AC9 /* Products */ = { 6D3F4095995BEF98F4DD0129A4F3C3E6 /* Development Pods */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
9E0F52B6EE035F8DC32250C8800B6878 /* Pods_Segmentio_Example.framework */, 31B6F91EE13CA09F760DFFB67BF7137A /* Segmentio */,
2C6B3BD660EA40765EA46F0735002B06 /* Pods_Segmentio_Tests.framework */,
C332BBDBF329D75B42E3D4DFBC367750 /* Segmentio.framework */,
);
name = Products;
sourceTree = "<group>";
};
5F203D3D23230D83E76F47D6F1912013 /* Development Pods */ = {
isa = PBXGroup;
children = (
262CA74000605615391CA6EC4293E986 /* Segmentio */,
); );
name = "Development Pods"; name = "Development Pods";
sourceTree = "<group>"; sourceTree = "<group>";
}; };
6A17966A17091F11F4DC34B63A2A4ED4 /* Cells */ = { 71680BC21E0B1ABC000B38795FC22CBC /* Cells */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
5F0CCCB5EF6793D4D584AEF64499C9CC /* SegmentioCell.swift */, 9034CEC1DC6A90954C69B5CF0A879E9D /* SegmentioCell.swift */,
F42697752DA8A65CBAB3CC0BB442A8C6 /* SegmentioCellWithImage.swift */, 1BF90D3EF6772ECC6F43EF17AAB5C916 /* SegmentioCellWithImage.swift */,
89381DA5973AFCAEDD65131B6F801D80 /* SegmentioCellWithImageAfterLabel.swift */, 564D3D18F6E439E721C7D49AC8379559 /* SegmentioCellWithImageAfterLabel.swift */,
08337E1EFCACB5981A6FB8F0A5F1D05D /* SegmentioCellWithImageBeforeLabel.swift */, 56D84AE8DDC577C7E7499059038BABBC /* SegmentioCellWithImageBeforeLabel.swift */,
D491E2303B96AB5AB9AACDBDD0D96BA1 /* SegmentioCellWithImageOverLabel.swift */, 71AC7FDBBA82CCF64068DC1436B7C44C /* SegmentioCellWithImageOverLabel.swift */,
DC4EC586E74DCFF8232A11FFEA0592BC /* SegmentioCellWithImageUnderLabel.swift */, 917595D61BE778C2053B6C375292B042 /* SegmentioCellWithImageUnderLabel.swift */,
0C30B1407F4DECA9198B795A4C2F8942 /* SegmentioCellWithLabel.swift */, 6A4666D5034926280B3C39CB8CA59319 /* SegmentioCellWithLabel.swift */,
); );
path = Cells; path = Cells;
sourceTree = "<group>"; sourceTree = "<group>";
@ -199,43 +228,39 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */,
5F203D3D23230D83E76F47D6F1912013 /* Development Pods */, 6D3F4095995BEF98F4DD0129A4F3C3E6 /* Development Pods */,
BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */, BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */,
5938CEA6F620530E483550DA66B62AC9 /* Products */, CA35ACABAF7AD76B04DF424D7DFFDD0A /* Products */,
31FE64FF9D2E3D0D88D47DB5DEFE398A /* Targets Support Files */, 8AFABA1177FBDA07E425A37E906123B5 /* Targets Support Files */,
); );
sourceTree = "<group>"; sourceTree = "<group>";
}; };
9FD684E4FD33C116E64DE188DB108EB9 /* Pods-Segmentio_Tests */ = { 8AFABA1177FBDA07E425A37E906123B5 /* Targets Support Files */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
F14C0898393B1E9176017283D91269D8 /* Info.plist */, 6706DE9909DD65117E2381108D4EC33E /* Pods-Segmentio_Example */,
658964FCFD27351CDFF8EBE97B8459B6 /* Pods-Segmentio_Tests.modulemap */,
A0A2FACDEADFA4A30C47F0C37BCE0211 /* Pods-Segmentio_Tests-acknowledgements.markdown */,
982EB7C450661AE87828BC4011C51E5B /* Pods-Segmentio_Tests-acknowledgements.plist */,
EF8DA8F49FD19F4BD6429F5AA0267180 /* Pods-Segmentio_Tests-dummy.m */,
16922E380BC9D1F07E81271A1F0B9F27 /* Pods-Segmentio_Tests-frameworks.sh */,
D173F1BEABAEE16C03D2454763755F7F /* Pods-Segmentio_Tests-resources.sh */,
7F52E8E5326A4E61091A05424A66750B /* Pods-Segmentio_Tests-umbrella.h */,
4938DA306399C05E56EDBA62544340BE /* Pods-Segmentio_Tests.debug.xcconfig */,
AF767C5305A74E237D044DB939285A7E /* Pods-Segmentio_Tests.release.xcconfig */,
); );
name = "Pods-Segmentio_Tests"; name = "Targets Support Files";
path = "Target Support Files/Pods-Segmentio_Tests";
sourceTree = "<group>"; sourceTree = "<group>";
}; };
B301CE3581EA441B88CE7A4817B8D17E /* Support Files */ = { A4FF14891748501365A9790ED2BDF024 /* Source */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
D39DD292AD471BA3FE7A27E198143BD8 /* Info.plist */, D91D0C0018887EA8F91F91162FF71F60 /* Segmentio.swift */,
F3B2A210AED19F381858EA69A5588808 /* Segmentio.modulemap */, 1224468BD5929E62BFF27E1C11853D24 /* SegmentioOptions.swift */,
78A7E87C7803313F0A7310B468DFFCEA /* Segmentio.xcconfig */, C9D021905A86A0FDCE4747A23BF6ADE4 /* Badge */,
5720677F504FDAE0BB2FF236B2A89893 /* Segmentio-dummy.m */, 71680BC21E0B1ABC000B38795FC22CBC /* Cells */,
7400982A0FA63A0BBCEAC3AC177EAD2E /* Segmentio-prefix.pch */, 00A2FBBF1263542044856398E75BAA76 /* Extensions */,
588D0BD8821CEBC9689C137D843FA812 /* Segmentio-umbrella.h */,
); );
name = "Support Files"; path = Source;
path = "Example/Pods/Target Support Files/Segmentio"; sourceTree = "<group>";
};
AF8947D7DBED0C96C3826FC2B0ED8A3A /* Segmentio */ = {
isa = PBXGroup;
children = (
A4FF14891748501365A9790ED2BDF024 /* Source */,
);
path = Segmentio;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */ = { BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */ = {
@ -246,21 +271,46 @@
name = Frameworks; name = Frameworks;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
E3C287FD31CE5425024C393185997E3E /* Segmentio */ = { C65C2B1DCC149D19571A5F7FAE3D31AF /* Views */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
E7168896F6A0EF9FBB759CB16C1ED3C5 /* Source */, 11C011383E55FDF0C1CFAA8E1E01F52C /* BadgeWithCounterViewBigSized.xib */,
6E90ECA263F832D2C77F806A4581AE25 /* BadgeWithCounterViewStandardSized.xib */,
);
path = Views;
sourceTree = "<group>";
};
C9D021905A86A0FDCE4747A23BF6ADE4 /* Badge */ = {
isa = PBXGroup;
children = (
E3C9CACA5CC49ABD89BB5C0082B56F17 /* BadgeViewPresenter.swift */,
635B6B346CBAAB1DB0593E0D25A25ED9 /* Views */,
);
path = Badge;
sourceTree = "<group>";
};
CA35ACABAF7AD76B04DF424D7DFFDD0A /* Products */ = {
isa = PBXGroup;
children = (
B07FA81FE6C58F8096D157CF2D32550A /* Pods_Segmentio_Example.framework */,
2AAAF5E594CC994BE5AD10F8928BC48A /* Segmentio.bundle */,
C373AAC9C68346B42AC567AD943825F7 /* Segmentio.framework */,
);
name = Products;
sourceTree = "<group>";
};
D99857A2684E0E97D1E32D0B130B5366 /* Segmentio */ = {
isa = PBXGroup;
children = (
F1249F9ED37CBEF49B81DE98EA2709C1 /* Source */,
); );
path = Segmentio; path = Segmentio;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
E7168896F6A0EF9FBB759CB16C1ED3C5 /* Source */ = { F1249F9ED37CBEF49B81DE98EA2709C1 /* Source */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
8D794DA325FA95310FAD589F0A6A3BC8 /* Segmentio.swift */, 1C2ABA084F34F1E71EB56C0EA2DD4699 /* Badge */,
E1E1181660922799D84A9AC7A93E4C17 /* SegmentioOptions.swift */,
6A17966A17091F11F4DC34B63A2A4ED4 /* Cells */,
47DD221E11AD5E3ABBE22D1B01521963 /* Extensions */,
); );
path = Source; path = Source;
sourceTree = "<group>"; sourceTree = "<group>";
@ -268,14 +318,6 @@
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */ /* Begin PBXHeadersBuildPhase section */
1CABCEA6C1BC88EB07B535ECF534A9AD /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
386B142514D75786C9544322094E00BB /* Pods-Segmentio_Tests-umbrella.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
5ADAE197C16A9C5A10D0C5F779D181D8 /* Headers */ = { 5ADAE197C16A9C5A10D0C5F779D181D8 /* Headers */ = {
isa = PBXHeadersBuildPhase; isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
@ -310,42 +352,44 @@
); );
name = "Pods-Segmentio_Example"; name = "Pods-Segmentio_Example";
productName = "Pods-Segmentio_Example"; productName = "Pods-Segmentio_Example";
productReference = 9E0F52B6EE035F8DC32250C8800B6878 /* Pods_Segmentio_Example.framework */; productReference = B07FA81FE6C58F8096D157CF2D32550A /* Pods_Segmentio_Example.framework */;
productType = "com.apple.product-type.framework"; productType = "com.apple.product-type.framework";
}; };
D69CC732EFB91EE42BE73E5030BD387C /* Segmentio */ = { D69CC732EFB91EE42BE73E5030BD387C /* Segmentio */ = {
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 785D3215E776BE829EB1D98F89F1A8C1 /* Build configuration list for PBXNativeTarget "Segmentio" */; buildConfigurationList = 785D3215E776BE829EB1D98F89F1A8C1 /* Build configuration list for PBXNativeTarget "Segmentio" */;
buildPhases = ( buildPhases = (
BF3D1C157A9652275CB130825D8E7120 /* Sources */, F9B7581237D6E81DE197B72773B36420 /* Sources */,
FD59EF5B4845512C0FE01CF908756FB5 /* Frameworks */, FD59EF5B4845512C0FE01CF908756FB5 /* Frameworks */,
F167B0867D416B414A778DE5486644A6 /* Resources */,
5ADAE197C16A9C5A10D0C5F779D181D8 /* Headers */, 5ADAE197C16A9C5A10D0C5F779D181D8 /* Headers */,
); );
buildRules = ( buildRules = (
); );
dependencies = ( dependencies = (
7EE0160D6232AE6A93308C253B5E48D6 /* PBXTargetDependency */,
); );
name = Segmentio; name = Segmentio;
productName = Segmentio; productName = Segmentio;
productReference = C332BBDBF329D75B42E3D4DFBC367750 /* Segmentio.framework */; productReference = C373AAC9C68346B42AC567AD943825F7 /* Segmentio.framework */;
productType = "com.apple.product-type.framework"; productType = "com.apple.product-type.framework";
}; };
E4CEDB3D980134198684315F99D1F345 /* Pods-Segmentio_Tests */ = { D8AEF8C76AD2A8E5BDCDA4CC1BD107B6 /* Segmentio-Segmentio */ = {
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 1796B5A3A489231D28C16CDA0DBD7F52 /* Build configuration list for PBXNativeTarget "Pods-Segmentio_Tests" */; buildConfigurationList = BD0B4F1676768CCD5A8C4B0E5B53427F /* Build configuration list for PBXNativeTarget "Segmentio-Segmentio" */;
buildPhases = ( buildPhases = (
A579A79AB96EA13266CB18A28A23753F /* Sources */, BECDA7466A3F2048BD0D16982C6C441A /* Sources */,
99B28BB930C96B4D06CABF8D3B8832D5 /* Frameworks */, CF0100512E0E927F05DB406E0E01DF38 /* Frameworks */,
1CABCEA6C1BC88EB07B535ECF534A9AD /* Headers */, 2DA0271DF525DE03AD9084DEC244781A /* Resources */,
); );
buildRules = ( buildRules = (
); );
dependencies = ( dependencies = (
); );
name = "Pods-Segmentio_Tests"; name = "Segmentio-Segmentio";
productName = "Pods-Segmentio_Tests"; productName = "Segmentio-Segmentio";
productReference = 2C6B3BD660EA40765EA46F0735002B06 /* Pods_Segmentio_Tests.framework */; productReference = 2AAAF5E594CC994BE5AD10F8928BC48A /* Segmentio.bundle */;
productType = "com.apple.product-type.framework"; productType = "com.apple.product-type.bundle";
}; };
/* End PBXNativeTarget section */ /* End PBXNativeTarget section */
@ -364,17 +408,39 @@
en, en,
); );
mainGroup = 7DB346D0F39D3F0E887471402A8071AB; mainGroup = 7DB346D0F39D3F0E887471402A8071AB;
productRefGroup = 5938CEA6F620530E483550DA66B62AC9 /* Products */; productRefGroup = CA35ACABAF7AD76B04DF424D7DFFDD0A /* Products */;
projectDirPath = ""; projectDirPath = "";
projectRoot = ""; projectRoot = "";
targets = ( targets = (
1773C65AAC9F8837BB8142660D7320E0 /* Pods-Segmentio_Example */, 1773C65AAC9F8837BB8142660D7320E0 /* Pods-Segmentio_Example */,
E4CEDB3D980134198684315F99D1F345 /* Pods-Segmentio_Tests */,
D69CC732EFB91EE42BE73E5030BD387C /* Segmentio */, D69CC732EFB91EE42BE73E5030BD387C /* Segmentio */,
D8AEF8C76AD2A8E5BDCDA4CC1BD107B6 /* Segmentio-Segmentio */,
); );
}; };
/* End PBXProject section */ /* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
2DA0271DF525DE03AD9084DEC244781A /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8F726950BDA00432603D2B6B01881D59 /* BadgeWithCounterViewBigSized.xib in Resources */,
655C575E9623729978F286F79E4EAEB8 /* BadgeWithCounterViewStandardSized.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
F167B0867D416B414A778DE5486644A6 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
C4EFEC716055615A27A3D1338426807D /* BadgeWithCounterViewBigSized.xib in Resources */,
D9EBCEA1512D4B307726BFEB5F29EF70 /* BadgeWithCounterViewStandardSized.xib in Resources */,
1F40A33F3F753FF73C5F80F006E14410 /* Segmentio.bundle in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */
5B2B601769FDD1B81F6ECD3FBC7CAF20 /* Sources */ = { 5B2B601769FDD1B81F6ECD3FBC7CAF20 /* Sources */ = {
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
@ -384,35 +450,43 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
A579A79AB96EA13266CB18A28A23753F /* Sources */ = { BECDA7466A3F2048BD0D16982C6C441A /* Sources */ = {
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
9E50E7327C0F6358FC61855C0205CC8E /* Pods-Segmentio_Tests-dummy.m in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
BF3D1C157A9652275CB130825D8E7120 /* Sources */ = { F9B7581237D6E81DE197B72773B36420 /* Sources */ = {
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
8C08B2CAFA57AFB848065BA4E7CA8F27 /* Segmentio-dummy.m in Sources */, 9EE6B5FE2A8EA2C0612C11D34596B7EB /* BadgeViewPresenter.swift in Sources */,
C5C3FE3FCC48A1460787D130DF0CF12E /* Segmentio.swift in Sources */, F6814CD90D68BE2911E97CE7F62E5DA1 /* BadgeWithCounterView.swift in Sources */,
7535676B6DAAED27C9E51F128BA31498 /* SegmentioOptions.swift in Sources */, E6E0179AF8247CB20CB77A1E33C88C7F /* RoundImageView.swift in Sources */,
08F3ADCD6D2B9007082089826E712007 /* UIView+Appearance.swift in Sources */, 1E8DCF6AD4051E3F7CFD9B55341DD455 /* Segmentio-dummy.m in Sources */,
E15160B05BBD4763B9DD87EAFA105B3B /* SegmentioCell.swift in Sources */, 5BE82675DB7F0C7671EADA9CF99A3C1B /* Segmentio.swift in Sources */,
124C21C2A8B015C1BB87D30F4EEA0214 /* SegmentioCellWithImage.swift in Sources */, 0BC8A81C32C10C3EB2DDF82EAD33481D /* SegmentioCell.swift in Sources */,
8B2E8009B9692DF362678E6FE094A084 /* SegmentioCellWithImageAfterLabel.swift in Sources */, BC2B9C2A1711F5583A80C1FA7F6F195F /* SegmentioCellWithImage.swift in Sources */,
DC7CDA37564D49D1443EFF857FB8B794 /* SegmentioCellWithImageBeforeLabel.swift in Sources */, 4E01C978EC149C600FF7658A6757204A /* SegmentioCellWithImageAfterLabel.swift in Sources */,
639A4D6A5BD89BFDD5ED7603F1D18262 /* SegmentioCellWithImageOverLabel.swift in Sources */, C917381BC4E7C5EFBC2CD2C898C1C8E4 /* SegmentioCellWithImageBeforeLabel.swift in Sources */,
5DE5F4B816F4E062B3C9278607C5E632 /* SegmentioCellWithImageUnderLabel.swift in Sources */, 0906DB2204F3DA0B929ED2B2FD92C3BE /* SegmentioCellWithImageOverLabel.swift in Sources */,
E0F68CB059B49448534FFDCF5267CCD0 /* SegmentioCellWithLabel.swift in Sources */, 20218D2C75E1CA8E41531E94BA06C129 /* SegmentioCellWithImageUnderLabel.swift in Sources */,
2DA5CD5E23B0E19B8FA2F11146E4A0E5 /* SegmentioCellWithLabel.swift in Sources */,
11E7945679FA0D80B96BC5DA4B1D00D0 /* SegmentioOptions.swift in Sources */,
C3DB5E9DDBA27211C6E8654A363CA0BC /* UIView+Appearance.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
/* End PBXSourcesBuildPhase section */ /* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */ /* Begin PBXTargetDependency section */
7EE0160D6232AE6A93308C253B5E48D6 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "Segmentio-Segmentio";
target = D8AEF8C76AD2A8E5BDCDA4CC1BD107B6 /* Segmentio-Segmentio */;
targetProxy = B485C2D39BE98A2AA0F4993CC65D306C /* PBXContainerItemProxy */;
};
D49BEB0E5AAF16F8BE48EA55C820C1A4 /* PBXTargetDependency */ = { D49BEB0E5AAF16F8BE48EA55C820C1A4 /* PBXTargetDependency */ = {
isa = PBXTargetDependency; isa = PBXTargetDependency;
name = Segmentio; name = Segmentio;
@ -422,40 +496,7 @@
/* End PBXTargetDependency section */ /* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */ /* Begin XCBuildConfiguration section */
34F3882D28F8CE61245C5A12E47EE64E /* Debug */ = { 015A368F878AC3E2CEAE21DDE8026304 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 4938DA306399C05E56EDBA62544340BE /* Pods-Segmentio_Tests.debug.xcconfig */;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "Target Support Files/Pods-Segmentio_Tests/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MODULEMAP_FILE = "Target Support Files/Pods-Segmentio_Tests/Pods-Segmentio_Tests.modulemap";
MTL_ENABLE_DEBUG_INFO = YES;
OTHER_LDFLAGS = "";
OTHER_LIBTOOLFLAGS = "";
PODS_ROOT = "$(SRCROOT)";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = Pods_Segmentio_Tests;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
47BEF9D903506B003EA5C2B249729489 /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
@ -473,6 +514,7 @@
CLANG_WARN_OBJC_ROOT_CLASS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES;
CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGNING_REQUIRED = NO;
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
ENABLE_TESTABILITY = YES; ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99; GCC_C_LANGUAGE_STANDARD = gnu99;
@ -492,112 +534,13 @@
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 8.0;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/;
STRIP_INSTALLED_PRODUCT = NO; STRIP_INSTALLED_PRODUCT = NO;
SYMROOT = "${SRCROOT}/../build"; SYMROOT = "${SRCROOT}/../build";
}; };
name = Debug; name = Debug;
}; };
6A27E340E24D615063AB597774F259B4 /* Release */ = { 44CDBB6D11DE06DB64D6268622BDC47E /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = AF767C5305A74E237D044DB939285A7E /* Pods-Segmentio_Tests.release.xcconfig */;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "Target Support Files/Pods-Segmentio_Tests/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MODULEMAP_FILE = "Target Support Files/Pods-Segmentio_Tests/Pods-Segmentio_Tests.modulemap";
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_LDFLAGS = "";
OTHER_LIBTOOLFLAGS = "";
PODS_ROOT = "$(SRCROOT)";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = Pods_Segmentio_Tests;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
6A88DE4855BF46A99DED1138AC50611B /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = F19F298463BD01E9E89AB6CF25EA81A5 /* Pods-Segmentio_Example.debug.xcconfig */;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "Target Support Files/Pods-Segmentio_Example/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MODULEMAP_FILE = "Target Support Files/Pods-Segmentio_Example/Pods-Segmentio_Example.modulemap";
MTL_ENABLE_DEBUG_INFO = YES;
OTHER_LDFLAGS = "";
OTHER_LIBTOOLFLAGS = "";
PODS_ROOT = "$(SRCROOT)";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = Pods_Segmentio_Example;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
847944553F66C9C9C8CF5EA5A12838E5 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 67714CDF4FF7EE5C90A0F1AB1AAAD011 /* Pods-Segmentio_Example.release.xcconfig */;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "Target Support Files/Pods-Segmentio_Example/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MODULEMAP_FILE = "Target Support Files/Pods-Segmentio_Example/Pods-Segmentio_Example.modulemap";
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_LDFLAGS = "";
OTHER_LIBTOOLFLAGS = "";
PODS_ROOT = "$(SRCROOT)";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = Pods_Segmentio_Example;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
AAF678CED40D3499169D10F63CA0719E /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
@ -615,6 +558,7 @@
CLANG_WARN_OBJC_ROOT_CLASS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES;
CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGNING_REQUIRED = NO;
COPY_PHASE_STRIP = YES; COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO; ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu99; GCC_C_LANGUAGE_STANDARD = gnu99;
@ -629,17 +573,20 @@
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 8.0;
PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/;
STRIP_INSTALLED_PRODUCT = NO; STRIP_INSTALLED_PRODUCT = NO;
SYMROOT = "${SRCROOT}/../build"; SYMROOT = "${SRCROOT}/../build";
VALIDATE_PRODUCT = YES; VALIDATE_PRODUCT = YES;
}; };
name = Release; name = Release;
}; };
B54261FEDDC960542CA187AA5E14BC7D /* Debug */ = { 6939D89BCF3CB71D8A0CB554AEAC1779 /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 78A7E87C7803313F0A7310B468DFFCEA /* Segmentio.xcconfig */; baseConfigurationReference = AAF3441A43AA58E58A7340FA1E66271B /* Segmentio.xcconfig */;
buildSettings = { buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf; DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
@ -659,17 +606,125 @@
SDKROOT = iphoneos; SDKROOT = iphoneos;
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = ""; VERSION_INFO_PREFIX = "";
}; };
name = Debug; name = Debug;
}; };
F03A1D5CC9DD916A3B05610779B9C8F0 /* Release */ = { 69F41B3AE04E5DCE90065CD8E029712C /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 78A7E87C7803313F0A7310B468DFFCEA /* Segmentio.xcconfig */; baseConfigurationReference = 808E8A2F66FEF9BFA423C8B51FEB3FD3 /* Pods-Segmentio_Example.release.xcconfig */;
buildSettings = { buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "Target Support Files/Pods-Segmentio_Example/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MODULEMAP_FILE = "Target Support Files/Pods-Segmentio_Example/Pods-Segmentio_Example.modulemap";
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_LDFLAGS = "";
OTHER_LIBTOOLFLAGS = "";
PODS_ROOT = "$(SRCROOT)";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = Pods_Segmentio_Example;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
A6D8F8AC9425BACBC3621CFD7597790C /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = AAF3441A43AA58E58A7340FA1E66271B /* Segmentio.xcconfig */;
buildSettings = {
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Segmentio";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "Target Support Files/Segmentio/ResourceBundle-Segmentio-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
PRODUCT_NAME = Segmentio;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
WRAPPER_EXTENSION = bundle;
};
name = Debug;
};
B39C8A659F54F5D7007A70CE400454EA /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = AAF3441A43AA58E58A7340FA1E66271B /* Segmentio.xcconfig */;
buildSettings = {
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Segmentio";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "Target Support Files/Segmentio/ResourceBundle-Segmentio-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
PRODUCT_NAME = Segmentio;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
WRAPPER_EXTENSION = bundle;
};
name = Release;
};
BF58FEE71132386297AFD4D409190547 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 37602088D7DDBEBF54BCE7CAF18CB105 /* Pods-Segmentio_Example.debug.xcconfig */;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "Target Support Files/Pods-Segmentio_Example/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MODULEMAP_FILE = "Target Support Files/Pods-Segmentio_Example/Pods-Segmentio_Example.modulemap";
MTL_ENABLE_DEBUG_INFO = YES;
OTHER_LDFLAGS = "";
OTHER_LIBTOOLFLAGS = "";
PODS_ROOT = "$(SRCROOT)";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = Pods_Segmentio_Example;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
E8435E0DCC8F7A80386C452616DACB34 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = AAF3441A43AA58E58A7340FA1E66271B /* Segmentio.xcconfig */;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
@ -688,6 +743,7 @@
PRODUCT_NAME = Segmentio; PRODUCT_NAME = Segmentio;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = ""; VERSION_INFO_PREFIX = "";
@ -697,20 +753,11 @@
/* End XCBuildConfiguration section */ /* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */ /* Begin XCConfigurationList section */
1796B5A3A489231D28C16CDA0DBD7F52 /* Build configuration list for PBXNativeTarget "Pods-Segmentio_Tests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
34F3882D28F8CE61245C5A12E47EE64E /* Debug */,
6A27E340E24D615063AB597774F259B4 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
47BEF9D903506B003EA5C2B249729489 /* Debug */, 015A368F878AC3E2CEAE21DDE8026304 /* Debug */,
AAF678CED40D3499169D10F63CA0719E /* Release */, 44CDBB6D11DE06DB64D6268622BDC47E /* Release */,
); );
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Release;
@ -718,8 +765,17 @@
785D3215E776BE829EB1D98F89F1A8C1 /* Build configuration list for PBXNativeTarget "Segmentio" */ = { 785D3215E776BE829EB1D98F89F1A8C1 /* Build configuration list for PBXNativeTarget "Segmentio" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
B54261FEDDC960542CA187AA5E14BC7D /* Debug */, 6939D89BCF3CB71D8A0CB554AEAC1779 /* Debug */,
F03A1D5CC9DD916A3B05610779B9C8F0 /* Release */, E8435E0DCC8F7A80386C452616DACB34 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
BD0B4F1676768CCD5A8C4B0E5B53427F /* Build configuration list for PBXNativeTarget "Segmentio-Segmentio" */ = {
isa = XCConfigurationList;
buildConfigurations = (
A6D8F8AC9425BACBC3621CFD7597790C /* Debug */,
B39C8A659F54F5D7007A70CE400454EA /* Release */,
); );
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Release;
@ -727,8 +783,8 @@
CC37EAE0F58FC2B11F123B84FE6B0FAC /* Build configuration list for PBXNativeTarget "Pods-Segmentio_Example" */ = { CC37EAE0F58FC2B11F123B84FE6B0FAC /* Build configuration list for PBXNativeTarget "Pods-Segmentio_Example" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
6A88DE4855BF46A99DED1138AC50611B /* Debug */, BF58FEE71132386297AFD4D409190547 /* Debug */,
847944553F66C9C9C8CF5EA5A12838E5 /* Release */, 69F41B3AE04E5DCE90065CD8E029712C /* Release */,
); );
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Release;

View File

@ -2,25 +2,25 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>en</string> <string>en</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string> <string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string> <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>${PRODUCT_NAME}</string> <string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>0.1.3</string> <string>1.0.0</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string> <string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key> <key>NSPrincipalClass</key>
<string></string> <string></string>
</dict> </dict>
</plist> </plist>

View File

@ -35,6 +35,8 @@ 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 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.</string> THE SOFTWARE.</string>
<key>License</key>
<string>MIT</string>
<key>Title</key> <key>Title</key>
<string>Segmentio</string> <string>Segmentio</string>
<key>Type</key> <key>Type</key>

View File

@ -1,3 +1,4 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Segmentio" FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Segmentio"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1

View File

@ -1,3 +1,4 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Segmentio" FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Segmentio"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1

View File

@ -1,3 +0,0 @@
# Acknowledgements
This application makes use of the following third party libraries:
Generated by CocoaPods - https://cocoapods.org

View File

@ -1,29 +0,0 @@
<?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>PreferenceSpecifiers</key>
<array>
<dict>
<key>FooterText</key>
<string>This application makes use of the following third party libraries:</string>
<key>Title</key>
<string>Acknowledgements</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>Generated by CocoaPods - https://cocoapods.org</string>
<key>Title</key>
<string></string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
</array>
<key>StringsTable</key>
<string>Acknowledgements</string>
<key>Title</key>
<string>Acknowledgements</string>
</dict>
</plist>

View File

@ -1,5 +0,0 @@
#import <Foundation/Foundation.h>
@interface PodsDummy_Pods_Segmentio_Tests : NSObject
@end
@implementation PodsDummy_Pods_Segmentio_Tests
@end

View File

@ -1,84 +0,0 @@
#!/bin/sh
set -e
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
local source="${BUILT_PRODUCTS_DIR}/$1"
elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
elif [ -r "$1" ]; then
local source="$1"
fi
local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi
# use filter instead of exclude so missing patterns dont' throw errors
echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
local basename
basename="$(basename -s .framework "$1")"
binary="${destination}/${basename}.framework/${basename}"
if ! [ -r "$binary" ]; then
binary="${destination}/${basename}"
fi
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
strip_invalid_archs "$binary"
fi
# Resign the code if required by the build settings to avoid unstable apps
code_sign_if_enabled "${destination}/$(basename "$1")"
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
local swift_runtime_libs
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
for lib in $swift_runtime_libs; do
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
code_sign_if_enabled "${destination}/${lib}"
done
fi
}
# Signs a framework with the provided identity
code_sign_if_enabled() {
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
# Use the current code_sign_identitiy
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\""
/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1"
fi
}
# Strip invalid architectures
strip_invalid_archs() {
binary="$1"
# Get architectures for current file
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
stripped=""
for arch in $archs; do
if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
stripped="$stripped $arch"
fi
done
if [[ "$stripped" ]]; then
echo "Stripped $binary of architectures:$stripped"
fi
}

View File

@ -1,102 +0,0 @@
#!/bin/sh
set -e
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
> "$RESOURCES_TO_COPY"
XCASSET_FILES=()
case "${TARGETED_DEVICE_FAMILY}" in
1,2)
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
;;
1)
TARGET_DEVICE_ARGS="--target-device iphone"
;;
2)
TARGET_DEVICE_ARGS="--target-device ipad"
;;
*)
TARGET_DEVICE_ARGS="--target-device mac"
;;
esac
realpath() {
DIRECTORY="$(cd "${1%/*}" && pwd)"
FILENAME="${1##*/}"
echo "$DIRECTORY/$FILENAME"
}
install_resource()
{
if [[ "$1" = /* ]] ; then
RESOURCE_PATH="$1"
else
RESOURCE_PATH="${PODS_ROOT}/$1"
fi
if [[ ! -e "$RESOURCE_PATH" ]] ; then
cat << EOM
error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
EOM
exit 1
fi
case $RESOURCE_PATH in
*.storyboard)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.xib)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.framework)
echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
*.xcdatamodel)
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
;;
*.xcdatamodeld)
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
;;
*.xcmappingmodel)
echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
;;
*.xcassets)
ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH")
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
;;
*)
echo "$RESOURCE_PATH"
echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
;;
esac
}
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
rm -f "$RESOURCES_TO_COPY"
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
then
# Find all other xcassets (this unfortunately includes those of path pods and other targets).
OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
while read line; do
if [[ $line != "`realpath $PODS_ROOT`*" ]]; then
XCASSET_FILES+=("$line")
fi
done <<<"$OTHER_XCASSETS"
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi

View File

@ -1,6 +0,0 @@
#import <UIKit/UIKit.h>
FOUNDATION_EXPORT double Pods_Segmentio_TestsVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_Segmentio_TestsVersionString[];

View File

@ -1,7 +0,0 @@
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Segmentio"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Segmentio/Segmentio.framework/Headers"
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}/Pods

View File

@ -1,6 +0,0 @@
framework module Pods_Segmentio_Tests {
umbrella header "Pods-Segmentio_Tests-umbrella.h"
export *
module * { export * }
}

View File

@ -1,7 +0,0 @@
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Segmentio"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Segmentio/Segmentio.framework/Headers"
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}/Pods

View File

@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>0.1.0</string> <string>1.1.3</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>

View File

@ -4,8 +4,6 @@
<dict> <dict>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>en</string> <string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string> <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
@ -13,13 +11,13 @@
<key>CFBundleName</key> <key>CFBundleName</key>
<string>${PRODUCT_NAME}</string> <string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>BNDL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.0.0</string> <string>1.1.3</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string> <string>1</string>
<key>NSPrincipalClass</key> <key>NSPrincipalClass</key>
<string></string> <string></string>
</dict> </dict>

View File

@ -24,6 +24,7 @@
327AF5EA1D1ABEC100534355 /* HomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 327AF5CB1D1ABEC100534355 /* HomeViewController.swift */; }; 327AF5EA1D1ABEC100534355 /* HomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 327AF5CB1D1ABEC100534355 /* HomeViewController.swift */; };
327AF5EB1D1ABEC100534355 /* SideMenuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 327AF5CC1D1ABEC100534355 /* SideMenuViewController.swift */; }; 327AF5EB1D1ABEC100534355 /* SideMenuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 327AF5CC1D1ABEC100534355 /* SideMenuViewController.swift */; };
327AF6041D1AC0FE00534355 /* ColorPalette.swift in Sources */ = {isa = PBXBuildFile; fileRef = 327AF6031D1AC0FE00534355 /* ColorPalette.swift */; }; 327AF6041D1AC0FE00534355 /* ColorPalette.swift in Sources */ = {isa = PBXBuildFile; fileRef = 327AF6031D1AC0FE00534355 /* ColorPalette.swift */; };
32C3706C1DD9C4FA001A39CB /* SegmentioBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32C3706B1DD9C4FA001A39CB /* SegmentioBuilder.swift */; };
5B9491B14F42A77448746E9B /* Pods_Segmentio_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 74E8553D39ECFE4883F1D2CA /* Pods_Segmentio_Example.framework */; }; 5B9491B14F42A77448746E9B /* Pods_Segmentio_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 74E8553D39ECFE4883F1D2CA /* Pods_Segmentio_Example.framework */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
@ -49,6 +50,7 @@
327AF5CB1D1ABEC100534355 /* HomeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeViewController.swift; sourceTree = "<group>"; }; 327AF5CB1D1ABEC100534355 /* HomeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeViewController.swift; sourceTree = "<group>"; };
327AF5CC1D1ABEC100534355 /* SideMenuViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SideMenuViewController.swift; sourceTree = "<group>"; }; 327AF5CC1D1ABEC100534355 /* SideMenuViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SideMenuViewController.swift; sourceTree = "<group>"; };
327AF6031D1AC0FE00534355 /* ColorPalette.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorPalette.swift; sourceTree = "<group>"; }; 327AF6031D1AC0FE00534355 /* ColorPalette.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorPalette.swift; sourceTree = "<group>"; };
32C3706B1DD9C4FA001A39CB /* SegmentioBuilder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SegmentioBuilder.swift; sourceTree = "<group>"; };
32C3A9241D2BB3B5004C0FC9 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; }; 32C3A9241D2BB3B5004C0FC9 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
607FACD01AFB9204008FA782 /* Segmentio_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Segmentio_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 607FACD01AFB9204008FA782 /* Segmentio_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Segmentio_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@ -136,6 +138,14 @@
path = ViewControllers; path = ViewControllers;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
32C3706A1DD9C4EC001A39CB /* Builders */ = {
isa = PBXGroup;
children = (
32C3706B1DD9C4FA001A39CB /* SegmentioBuilder.swift */,
);
path = Builders;
sourceTree = "<group>";
};
45CA913E13914443DB2552B6 /* Pods */ = { 45CA913E13914443DB2552B6 /* Pods */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@ -169,6 +179,7 @@
607FACD21AFB9204008FA782 /* Example for Segmentio */ = { 607FACD21AFB9204008FA782 /* Example for Segmentio */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
32C3706A1DD9C4EC001A39CB /* Builders */,
327AF5A71D1ABEC100534355 /* Application */, 327AF5A71D1ABEC100534355 /* Application */,
327AF5A91D1ABEC100534355 /* Extensions */, 327AF5A91D1ABEC100534355 /* Extensions */,
327AF5AD1D1ABEC100534355 /* Helpers */, 327AF5AD1D1ABEC100534355 /* Helpers */,
@ -239,11 +250,12 @@
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastSwiftUpdateCheck = 0720; LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0720; LastUpgradeCheck = 0810;
ORGANIZATIONNAME = CocoaPods; ORGANIZATIONNAME = CocoaPods;
TargetAttributes = { TargetAttributes = {
607FACCF1AFB9204008FA782 = { 607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1; CreatedOnToolsVersion = 6.3.1;
LastSwiftMigration = 0800;
}; };
}; };
}; };
@ -321,7 +333,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */
@ -336,6 +348,7 @@
327AF5CF1D1ABEC100534355 /* AppDelegate.swift in Sources */, 327AF5CF1D1ABEC100534355 /* AppDelegate.swift in Sources */,
327AF5EB1D1ABEC100534355 /* SideMenuViewController.swift in Sources */, 327AF5EB1D1ABEC100534355 /* SideMenuViewController.swift in Sources */,
327AF5E81D1ABEC100534355 /* EmbedContainerViewController.swift in Sources */, 327AF5E81D1ABEC100534355 /* EmbedContainerViewController.swift in Sources */,
32C3706C1DD9C4FA001A39CB /* SegmentioBuilder.swift in Sources */,
327AF5D41D1ABEC100534355 /* Disaster.swift in Sources */, 327AF5D41D1ABEC100534355 /* Disaster.swift in Sources */,
327AF5D31D1ABEC100534355 /* AppearanceConfigurator.swift in Sources */, 327AF5D31D1ABEC100534355 /* AppearanceConfigurator.swift in Sources */,
327AF5EA1D1ABEC100534355 /* HomeViewController.swift in Sources */, 327AF5EA1D1ABEC100534355 /* HomeViewController.swift in Sources */,
@ -364,8 +377,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@ -388,7 +403,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.3; IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES; MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos; SDKROOT = iphoneos;
@ -409,8 +424,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@ -426,9 +443,10 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.3; IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
VALIDATE_PRODUCT = YES; VALIDATE_PRODUCT = YES;
}; };
name = Release; name = Release;
@ -437,6 +455,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 031FB43EDAB25B02B2FB7406 /* Pods-Segmentio_Example.debug.xcconfig */; baseConfigurationReference = 031FB43EDAB25B02B2FB7406 /* Pods-Segmentio_Example.debug.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = ""; CODE_SIGN_IDENTITY = "";
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -450,6 +469,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
}; };
name = Debug; name = Debug;
@ -458,6 +478,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 1667ACAF5594F75E244C8E1B /* Pods-Segmentio_Example.release.xcconfig */; baseConfigurationReference = 1667ACAF5594F75E244C8E1B /* Pods-Segmentio_Example.release.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = ""; CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
@ -472,6 +493,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
}; };
name = Release; name = Release;

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "0720" LastUpgradeVersion = "0810"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"

View File

@ -13,10 +13,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow? var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
UIDevice.currentDevice().beginGeneratingDeviceOrientationNotifications() UIDevice.current.beginGeneratingDeviceOrientationNotifications()
AppearanceConfigurator.configureNavigationBar() AppearanceConfigurator.configureNavigationBar()
return true return true
} }
} }

View File

@ -0,0 +1,118 @@
//
// SegmentioBuilder.swift
// Segmentio
//
// Created by Dmitriy Demchenko on 11/14/16.
// Copyright © 2016 CocoaPods. All rights reserved.
//
import Segmentio
import UIKit
struct SegmentioBuilder {
static func setupBadgeCountForIndex(_ segmentioView: Segmentio, index: Int) {
segmentioView.addBadge(
at: index,
count: 10,
color: ColorPalette.coral
)
}
static func buildSegmentioView(segmentioView: Segmentio, segmentioStyle: SegmentioStyle) {
segmentioView.setup(
content: segmentioContent(),
style: segmentioStyle,
options: segmentioOptions(segmentioStyle: segmentioStyle)
)
}
private static func segmentioContent() -> [SegmentioItem] {
return [
SegmentioItem(title: "Tornado", image: UIImage(named: "tornado")),
SegmentioItem(title: "Earthquakes", image: UIImage(named: "earthquakes")),
SegmentioItem(title: "Extreme heat", image: UIImage(named: "heat")),
SegmentioItem(title: "Eruption", image: UIImage(named: "eruption")),
SegmentioItem(title: "Floods", image: UIImage(named: "floods")),
SegmentioItem(title: "Wildfires", image: UIImage(named: "wildfires"))
]
}
private static func segmentioOptions(segmentioStyle: SegmentioStyle) -> SegmentioOptions {
var imageContentMode = UIViewContentMode.center
switch segmentioStyle {
case .imageBeforeLabel, .imageAfterLabel:
imageContentMode = .scaleAspectFit
default:
break
}
return SegmentioOptions(
backgroundColor: ColorPalette.white,
maxVisibleItems: 3,
scrollEnabled: true,
indicatorOptions: segmentioIndicatorOptions(),
horizontalSeparatorOptions: segmentioHorizontalSeparatorOptions(),
verticalSeparatorOptions: segmentioVerticalSeparatorOptions(),
imageContentMode: imageContentMode,
labelTextAlignment: .center,
labelTextNumberOfLines: 1,
segmentStates: segmentioStates(),
animationDuration: 0.3
)
}
private static func segmentioStates() -> SegmentioStates {
let font = UIFont.exampleAvenirMedium(ofSize: 13)
return SegmentioStates(
defaultState: segmentioState(
backgroundColor: .clear,
titleFont: font,
titleTextColor: ColorPalette.grayChateau
),
selectedState: segmentioState(
backgroundColor: .cyan,
titleFont: font,
titleTextColor: ColorPalette.black
),
highlightedState: segmentioState(
backgroundColor: ColorPalette.whiteSmoke,
titleFont: font,
titleTextColor: ColorPalette.grayChateau
)
)
}
private static func segmentioState(backgroundColor: UIColor, titleFont: UIFont, titleTextColor: UIColor) -> SegmentioState {
return SegmentioState(
backgroundColor: backgroundColor,
titleFont: titleFont,
titleTextColor: titleTextColor
)
}
private static func segmentioIndicatorOptions() -> SegmentioIndicatorOptions {
return SegmentioIndicatorOptions(
type: .bottom,
ratio: 1,
height: 5,
color: ColorPalette.coral
)
}
private static func segmentioHorizontalSeparatorOptions() -> SegmentioHorizontalSeparatorOptions {
return SegmentioHorizontalSeparatorOptions(
type: .topAndBottom,
height: 1,
color: ColorPalette.whiteSmoke
)
}
private static func segmentioVerticalSeparatorOptions() -> SegmentioVerticalSeparatorOptions {
return SegmentioVerticalSeparatorOptions(
ratio: 1,
color: ColorPalette.whiteSmoke
)
}
}

View File

@ -12,16 +12,15 @@ extension String {
func stringFromCamelCase() -> String { func stringFromCamelCase() -> String {
var string = self var string = self
string = string.stringByReplacingOccurrencesOfString( string = string.replacingOccurrences(
"([a-z])([A-Z])", of: "([a-z])([A-Z])",
withString: "$1 $2", with: "$1 $2",
options: .RegularExpressionSearch, options: .regularExpression,
range: Range<String.Index>(string.startIndex..<string.endIndex) range: nil
) )
string.replaceSubrange(startIndex...startIndex, with: String(self[startIndex]))
string.replaceRange(startIndex...startIndex, with: String(self[startIndex])) return String(string.characters.prefix(1)).capitalized + String(string.lowercased().characters.dropFirst())
return String(string.characters.prefix(1)).capitalizedString + String(string.lowercaseString.characters.dropFirst())
} }
} }

View File

@ -10,12 +10,12 @@ import UIKit
extension UIFont { extension UIFont {
class func exampleAvenirMediumWithSize(size: CGFloat) -> UIFont { class func exampleAvenirMedium(ofSize size: CGFloat) -> UIFont {
return UIFont(name: "Avenir-Book", size: size) ?? UIFont.systemFontOfSize(size) return UIFont(name: "Avenir-Book", size: size) ?? UIFont.systemFont(ofSize: size)
} }
class func exampleAvenirLightWithSize(size: CGFloat) -> UIFont { class func exampleAvenirLight(ofSize size: CGFloat) -> UIFont {
return UIFont(name: "Avenir-Light", size: size) ?? UIFont.systemFontOfSize(size) return UIFont(name: "Avenir-Light", size: size) ?? UIFont.systemFont(ofSize: size)
} }
} }

View File

@ -28,15 +28,15 @@ private var flatAssociatedObjectKey: UInt8 = 0
set { set {
if (newValue) { if (newValue) {
let void = UIImage() let void = UIImage()
setBackgroundImage(void, forBarPosition: .Any, barMetrics: .Default) setBackgroundImage(void, for: .any, barMetrics: .default)
shadowImage = void shadowImage = void
} else { } else {
setBackgroundImage(nil, forBarPosition: .Any, barMetrics: .Default) setBackgroundImage(nil, for: .any, barMetrics: .default)
shadowImage = nil shadowImage = nil
} }
objc_setAssociatedObject(self, &flatAssociatedObjectKey, NSNumber(bool: newValue), objc_setAssociatedObject(self, &flatAssociatedObjectKey, NSNumber(value: newValue as Bool),
objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC) objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC)
} }
} }
} }

View File

@ -11,16 +11,16 @@ import UIKit
class AppearanceConfigurator { class AppearanceConfigurator {
class func configureNavigationBar() { class func configureNavigationBar() {
UIApplication.sharedApplication().statusBarStyle = UIStatusBarStyle.LightContent UIApplication.shared.statusBarStyle = .lightContent
UINavigationBar.appearance().barTintColor = ColorPalette.WhiteColor UINavigationBar.appearance().barTintColor = ColorPalette.white
UINavigationBar.appearance().translucent = false UINavigationBar.appearance().isTranslucent = false
UINavigationBar.appearance().tintColor = ColorPalette.BlackColor UINavigationBar.appearance().tintColor = ColorPalette.black
let attributes = [ let attributes = [
NSFontAttributeName : UIFont.exampleAvenirMediumWithSize(17), NSFontAttributeName : UIFont.exampleAvenirMedium(ofSize: 17),
NSForegroundColorAttributeName : ColorPalette.BlackColor NSForegroundColorAttributeName : ColorPalette.black
] ]
UINavigationBar.appearance().titleTextAttributes = attributes UINavigationBar.appearance().titleTextAttributes = attributes
} }
} }

View File

@ -15,11 +15,11 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>0.1.5</string> <string>2.1</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>25</string> <string>26</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>

View File

@ -9,9 +9,11 @@
import UIKit import UIKit
struct ColorPalette { struct ColorPalette {
static let WhiteColor = UIColor(red: 255, green: 255, blue: 255)
static let BlackColor = UIColor(red: 3, green: 3, blue: 3) static let white = UIColor(red: 255, green: 255, blue: 255)
static let CoralColor = UIColor(red: 244, green: 111, blue: 96) static let black = UIColor(red: 3, green: 3, blue: 3)
static let WhiteSmokeColor = UIColor(red: 245, green: 245, blue: 245) static let coral = UIColor(red: 244, green: 111, blue: 96)
static let GrayChateauColor = UIColor(red: 163, green: 164, blue: 168) static let whiteSmoke = UIColor(red: 245, green: 245, blue: 245)
} static let grayChateau = UIColor(red: 163, green: 164, blue: 168)
}

View File

@ -7,35 +7,35 @@
// //
struct Hints { struct Hints {
static let Tornado = [ static let tornado = [
"1. Move immediately to the special underground shelter whenever possible.", "1. Move immediately to the special underground shelter whenever possible.",
"2. If unable to go underground, stay in a windowless, interior room on the lowest possible floor.", "2. If unable to go underground, stay in a windowless, interior room on the lowest possible floor.",
"3. Remain in your shelter until the danger of tornadoes has passed.", "3. Remain in your shelter until the danger of tornadoes has passed.",
"4. Exit your shelter carefully, and exercise caution moving around in a tornado stricken area." "4. Exit your shelter carefully, and exercise caution moving around in a tornado stricken area."
] ]
static let Earthquakes = [ static let earthquakes = [
"1. Make sure you have a fire extinguisher, first aid kit, a battery-powered radio, a flashlight, and extra batteries at home.", "1. Make sure you have a fire extinguisher, first aid kit, a battery-powered radio, a flashlight, and extra batteries at home.",
"2. Learn how to turn off the gas, water, and electricity.", "2. Learn how to turn off the gas, water, and electricity.",
"3. Make up a plan of where to meet your family after an earthquake. Don't leave heavy objects on shelves.", "3. Make up a plan of where to meet your family after an earthquake. Don't leave heavy objects on shelves.",
"4. Dont panic." "4. Dont panic."
] ]
static let ExtremeHeat = [ static let extremeHeat = [
"1. Know the Terms: Heat Wave, Heat Index, Heat Cramps, Heat Exhaustion, Heat Stroke, Sun Stroke.", "1. Know the Terms: Heat Wave, Heat Index, Heat Cramps, Heat Exhaustion, Heat Stroke, Sun Stroke.",
"2. Install window air conditioners snugly; insulate if necessary.", "2. Install window air conditioners snugly; insulate if necessary.",
"3. Check air-conditioning ducts for proper insulation.", "3. Check air-conditioning ducts for proper insulation.",
"4. Install temporary window reflectors (for use between windows and drapes), such as aluminum foil-covered cardboard, to reflect heat back outside." "4. Install temporary window reflectors (for use between windows and drapes), such as aluminum foil-covered cardboard, to reflect heat back outside."
] ]
static let Eruption = [ static let eruption = [
"1. Know your community's warning system.", "1. Know your community's warning system.",
"2. Get familiar with the evacuation procedures.", "2. Get familiar with the evacuation procedures.",
"3. Develop a household evacuation plan. Figure out what you'll need to do if you hear the sirens go off.", "3. Develop a household evacuation plan. Figure out what you'll need to do if you hear the sirens go off.",
"4. Stock up on necessities. Store at least a three-day supply of food and portable water at your home." "4. Stock up on necessities. Store at least a three-day supply of food and portable water at your home."
] ]
static let Floods = [ static let floods = [
"1. Be aware of your area's flood risk before the expected rain is going to hit.", "1. Be aware of your area's flood risk before the expected rain is going to hit.",
"2. Check to see if you have insurance that covers flooding.", "2. Check to see if you have insurance that covers flooding.",
"3. Keep insurance policies, documents, and other valuables in a safe-deposit box, that is located up high and out of harm's way.", "3. Keep insurance policies, documents, and other valuables in a safe-deposit box, that is located up high and out of harm's way.",
@ -43,11 +43,11 @@ struct Hints {
"5. Identify where you could go if told to evacuate." "5. Identify where you could go if told to evacuate."
] ]
static let Wildfires = [ static let wildfires = [
"1. Make a disaster supply kit and have a family plan.", "1. Make a disaster supply kit and have a family plan.",
"2. Design and landscape your home with wildfire safety in mind: select materials and plants that can help contain fire rather than fuel it.", "2. Design and landscape your home with wildfire safety in mind: select materials and plants that can help contain fire rather than fuel it.",
"3. Teach each family member how to use a fire extinguisher (ABC type) and show them where it's kept.", "3. Teach each family member how to use a fire extinguisher (ABC type) and show them where it's kept.",
"4. Dont panic." "4. Dont panic."
] ]
} }

View File

@ -1,8 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11542" systemVersion="16B2555" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<scenes> <scenes>
<!--View Controller--> <!--View Controller-->
@ -14,21 +18,21 @@
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/> <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides> </layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Y" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zdV-II-bEc"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Y" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zdV-II-bEc">
<rect key="frame" x="270" y="255" width="60" height="90"/> <rect key="frame" x="157.5" y="288.5" width="60" height="90"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="60" id="15m-sK-BMc"/> <constraint firstAttribute="width" constant="60" id="15m-sK-BMc"/>
<constraint firstAttribute="height" constant="90" id="pHT-4Q-Z9L"/> <constraint firstAttribute="height" constant="90" id="pHT-4Q-Z9L"/>
</constraints> </constraints>
<fontDescription key="fontDescription" name="Avenir-Medium" family="Avenir" pointSize="90"/> <fontDescription key="fontDescription" name="Avenir-Medium" family="Avenir" pointSize="90"/>
<color key="textColor" red="0.95294117647058818" green="0.40000000000000002" blue="0.33333333333333331" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.95294117647058818" green="0.40000000000000002" blue="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
</subviews> </subviews>
<color key="backgroundColor" red="0.96078431372549022" green="0.96078431372549022" blue="0.96078431372549022" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.96078431372549022" green="0.96078431372549022" blue="0.96078431372549022" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstItem="zdV-II-bEc" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="7C2-HE-YjU"/> <constraint firstItem="zdV-II-bEc" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="7C2-HE-YjU"/>
<constraint firstItem="zdV-II-bEc" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="Eur-FL-asR"/> <constraint firstItem="zdV-II-bEc" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="Eur-FL-asR"/>
@ -37,7 +41,7 @@
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="53" y="375"/> <point key="canvasLocation" x="-36" y="268"/>
</scene> </scene>
</scenes> </scenes>
</document> </document>

View File

@ -1,8 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="Sgi-ow-Mpv"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11542" systemVersion="16B2555" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="Sgi-ow-Mpv">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<scenes> <scenes>
<!--Disaster's guide--> <!--Disaster's guide-->
@ -14,17 +18,17 @@
<viewControllerLayoutGuide type="bottom" id="Cxz-xC-i78"/> <viewControllerLayoutGuide type="bottom" id="Cxz-xC-i78"/>
</layoutGuides> </layoutGuides>
<view key="view" contentMode="scaleToFill" id="6th-V5-ZMU"> <view key="view" contentMode="scaleToFill" id="6th-V5-ZMU">
<rect key="frame" x="0.0" y="64" width="600" height="536"/> <rect key="frame" x="0.0" y="64" width="375" height="603"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="j4J-17-RS0"> <containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="j4J-17-RS0">
<rect key="frame" x="0.0" y="0.0" width="600" height="536"/> <rect key="frame" x="0.0" y="0.0" width="375" height="603"/>
<connections> <connections>
<segue destination="nnH-xc-bez" kind="embed" identifier="EmbedContainerViewController" id="39a-pg-Pje"/> <segue destination="nnH-xc-bez" kind="embed" identifier="EmbedContainerViewController" id="39a-pg-Pje"/>
</connections> </connections>
</containerView> </containerView>
</subviews> </subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstItem="j4J-17-RS0" firstAttribute="top" secondItem="RuD-xI-nzV" secondAttribute="bottom" id="6TL-ta-XXo"/> <constraint firstItem="j4J-17-RS0" firstAttribute="top" secondItem="RuD-xI-nzV" secondAttribute="bottom" id="6TL-ta-XXo"/>
<constraint firstAttribute="trailing" secondItem="j4J-17-RS0" secondAttribute="trailing" id="7vA-9i-p0o"/> <constraint firstAttribute="trailing" secondItem="j4J-17-RS0" secondAttribute="trailing" id="7vA-9i-p0o"/>
@ -54,46 +58,46 @@
<viewControllerLayoutGuide type="bottom" id="d6b-iV-EUm"/> <viewControllerLayoutGuide type="bottom" id="d6b-iV-EUm"/>
</layoutGuides> </layoutGuides>
<view key="view" contentMode="scaleToFill" id="aho-PV-db8" userLabel="Content View"> <view key="view" contentMode="scaleToFill" id="aho-PV-db8" userLabel="Content View">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="cards" translatesAutoresizingMaskIntoConstraints="NO" id="EGM-zw-1hI"> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="cards" translatesAutoresizingMaskIntoConstraints="NO" id="EGM-zw-1hI">
<rect key="frame" x="25" y="24" width="550" height="553"/> <rect key="frame" x="25" y="24" width="325" height="620"/>
<constraints> <constraints>
<constraint firstAttribute="height" priority="900" constant="553" id="ffK-Ju-lZo"/> <constraint firstAttribute="height" priority="900" constant="553" id="ffK-Ju-lZo"/>
</constraints> </constraints>
</imageView> </imageView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="pyy-sw-hGC" userLabel="Separator"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="pyy-sw-hGC" userLabel="Separator">
<rect key="frame" x="32" y="101" width="536" height="1"/> <rect key="frame" x="32" y="101" width="311" height="1"/>
<color key="backgroundColor" red="0.96078431372549022" green="0.96078431372549022" blue="0.96078431372549022" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.96078431372549022" green="0.96078431372549022" blue="0.96078431372549022" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="1" id="89l-q6-tQe"/> <constraint firstAttribute="height" constant="1" id="89l-q6-tQe"/>
</constraints> </constraints>
</view> </view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Before" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aoy-p7-Csf"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Before" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aoy-p7-Csf">
<rect key="frame" x="32" y="75" width="536" height="19"/> <rect key="frame" x="32" y="75" width="311" height="19"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="19" id="x6o-JU-9JP"/> <constraint firstAttribute="height" constant="19" id="x6o-JU-9JP"/>
</constraints> </constraints>
<fontDescription key="fontDescription" name="Avenir-Medium" family="Avenir" pointSize="18"/> <fontDescription key="fontDescription" name="Avenir-Medium" family="Avenir" pointSize="18"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" allowsSelection="NO" showsSelectionImmediatelyOnTouchBegin="NO" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="f8N-44-bJn"> <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" allowsSelection="NO" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="f8N-44-bJn">
<rect key="frame" x="32" y="160" width="536" height="400"/> <rect key="frame" x="32" y="160" width="311" height="467"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<color key="separatorColor" red="0.96078431606292725" green="0.96078431606292725" blue="0.96078431606292725" alpha="1" colorSpace="calibratedRGB"/> <color key="separatorColor" red="0.96078431606292725" green="0.96078431606292725" blue="0.96078431606292725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<inset key="separatorInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/> <inset key="separatorInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
<prototypes> <prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="Cell" id="C9g-Ij-gNT" customClass="ExampleTableViewCell" customModule="Segmentio_Example" customModuleProvider="target"> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="Cell" id="C9g-Ij-gNT" customClass="ExampleTableViewCell" customModule="Segmentio_Example" customModuleProvider="target">
<rect key="frame" x="0.0" y="28" width="536" height="44"/> <rect key="frame" x="0.0" y="28" width="311" height="44"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="C9g-Ij-gNT" id="3tu-UK-HZb"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="C9g-Ij-gNT" id="3tu-UK-HZb">
<rect key="frame" x="0.0" y="0.0" width="536" height="44"/> <rect key="frame" x="0.0" y="0.0" width="311" height="44"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uyX-0h-rHd"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uyX-0h-rHd">
<rect key="frame" x="25" y="10" width="486" height="24"/> <rect key="frame" x="25" y="10" width="261" height="24"/>
<fontDescription key="fontDescription" name="Avenir-Light" family="Avenir" pointSize="13"/> <fontDescription key="fontDescription" name="Avenir-Light" family="Avenir" pointSize="13"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/> <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
@ -118,14 +122,14 @@
</connections> </connections>
</tableView> </tableView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="oval" translatesAutoresizingMaskIntoConstraints="NO" id="t46-Uj-4Ci"> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="oval" translatesAutoresizingMaskIntoConstraints="NO" id="t46-Uj-4Ci">
<rect key="frame" x="291" y="122" width="18" height="18"/> <rect key="frame" x="178.5" y="122" width="18" height="18"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="18" id="Gki-L9-gmb"/> <constraint firstAttribute="height" constant="18" id="Gki-L9-gmb"/>
<constraint firstAttribute="width" constant="18" id="HcY-Je-7ti"/> <constraint firstAttribute="width" constant="18" id="HcY-Je-7ti"/>
</constraints> </constraints>
</imageView> </imageView>
</subviews> </subviews>
<color key="backgroundColor" red="0.85490196078431369" green="0.85490196078431369" blue="0.85490196078431369" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.85490196078431369" green="0.85490196078431369" blue="0.85490196078431369" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstItem="d6b-iV-EUm" firstAttribute="top" secondItem="EGM-zw-1hI" secondAttribute="bottom" constant="23" id="5uZ-0s-poK"/> <constraint firstItem="d6b-iV-EUm" firstAttribute="top" secondItem="EGM-zw-1hI" secondAttribute="bottom" constant="23" id="5uZ-0s-poK"/>
<constraint firstItem="f8N-44-bJn" firstAttribute="trailing" secondItem="EGM-zw-1hI" secondAttribute="trailing" constant="-7" id="961-ZU-5yh"/> <constraint firstItem="f8N-44-bJn" firstAttribute="trailing" secondItem="EGM-zw-1hI" secondAttribute="trailing" constant="-7" id="961-ZU-5yh"/>
@ -165,7 +169,7 @@
<navigationBar key="navigationBar" contentMode="scaleToFill" id="A36-fE-w8g"> <navigationBar key="navigationBar" contentMode="scaleToFill" id="A36-fE-w8g">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/> <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<color key="barTintColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="barTintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<userDefinedRuntimeAttributes> <userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="flat" value="YES"/> <userDefinedRuntimeAttribute type="boolean" keyPath="flat" value="YES"/>
</userDefinedRuntimeAttributes> </userDefinedRuntimeAttributes>
@ -188,43 +192,43 @@
<viewControllerLayoutGuide type="bottom" id="Lh0-b2-Lg9"/> <viewControllerLayoutGuide type="bottom" id="Lh0-b2-Lg9"/>
</layoutGuides> </layoutGuides>
<view key="view" contentMode="scaleToFill" id="3on-2h-KRG"> <view key="view" contentMode="scaleToFill" id="3on-2h-KRG">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dwd-YU-7oV" userLabel="Shadow View"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dwd-YU-7oV" userLabel="Shadow View">
<rect key="frame" x="420" y="0.0" width="180" height="600"/> <rect key="frame" x="262" y="0.0" width="113" height="667"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
</view> </view>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="Ufo-LN-tbg"> <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="Ufo-LN-tbg">
<rect key="frame" x="0.0" y="0.0" width="420" height="600"/> <rect key="frame" x="0.0" y="0.0" width="262" height="667"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="420" id="1Fe-0J-akh"/> <constraint firstAttribute="width" constant="262" id="1Fe-0J-akh"/>
</constraints> </constraints>
<color key="separatorColor" red="0.96078431369999995" green="0.96078431369999995" blue="0.96078431369999995" alpha="1" colorSpace="calibratedRGB"/> <color key="separatorColor" red="0.96078431369999995" green="0.96078431369999995" blue="0.96078431369999995" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<inset key="separatorInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/> <inset key="separatorInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
<view key="tableHeaderView" contentMode="scaleToFill" id="Jjd-1j-efW" userLabel="Header"> <view key="tableHeaderView" contentMode="scaleToFill" id="Jjd-1j-efW" userLabel="Header">
<rect key="frame" x="0.0" y="0.0" width="420" height="66"/> <rect key="frame" x="0.0" y="0.0" width="262" height="66"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="IOF-iR-GOe" userLabel="Separator View"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="IOF-iR-GOe" userLabel="Separator View">
<rect key="frame" x="0.0" y="65" width="420" height="1"/> <rect key="frame" x="0.0" y="65" width="262" height="1"/>
<color key="backgroundColor" red="0.95686274509803915" green="0.43529411764705883" blue="0.37647058823529411" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.95686274509803915" green="0.43529411764705883" blue="0.37647058823529411" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="1" id="ipJ-LO-nfb"/> <constraint firstAttribute="height" constant="1" id="ipJ-LO-nfb"/>
</constraints> </constraints>
</view> </view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Segmentio" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ON6-SS-qxO"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Segmentio" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ON6-SS-qxO">
<rect key="frame" x="16" y="35" width="388" height="22"/> <rect key="frame" x="16" y="35" width="230" height="22"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="22" id="2GY-JW-I97"/> <constraint firstAttribute="height" constant="22" id="2GY-JW-I97"/>
</constraints> </constraints>
<fontDescription key="fontDescription" name="Avenir-Medium" family="Avenir" pointSize="17"/> <fontDescription key="fontDescription" name="Avenir-Medium" family="Avenir" pointSize="17"/>
<color key="textColor" red="0.95686274510000002" green="0.43529411759999997" blue="0.37647058820000001" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.95686274510000002" green="0.43529411759999997" blue="0.37647058820000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
</subviews> </subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstItem="ON6-SS-qxO" firstAttribute="leading" secondItem="Jjd-1j-efW" secondAttribute="leading" constant="16" id="1dw-Yl-bgI"/> <constraint firstItem="ON6-SS-qxO" firstAttribute="leading" secondItem="Jjd-1j-efW" secondAttribute="leading" constant="16" id="1dw-Yl-bgI"/>
<constraint firstAttribute="trailing" secondItem="IOF-iR-GOe" secondAttribute="trailing" id="AQi-XF-2bn"/> <constraint firstAttribute="trailing" secondItem="IOF-iR-GOe" secondAttribute="trailing" id="AQi-XF-2bn"/>
@ -236,17 +240,17 @@
</view> </view>
<prototypes> <prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="Cell" textLabel="bIG-dp-uan" imageView="f8N-oJ-egW" style="IBUITableViewCellStyleDefault" id="k0c-n4-4H9"> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="Cell" textLabel="bIG-dp-uan" imageView="f8N-oJ-egW" style="IBUITableViewCellStyleDefault" id="k0c-n4-4H9">
<rect key="frame" x="0.0" y="94" width="420" height="44"/> <rect key="frame" x="0.0" y="94" width="262" height="44"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="k0c-n4-4H9" id="9bd-UY-udW"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="k0c-n4-4H9" id="9bd-UY-udW">
<rect key="frame" x="0.0" y="0.0" width="420" height="43"/> <rect key="frame" x="0.0" y="0.0" width="262" height="43"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<subviews> <subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="bIG-dp-uan"> <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="bIG-dp-uan">
<rect key="frame" x="42" y="0.0" width="363" height="43"/> <rect key="frame" x="42" y="0.0" width="205" height="43"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="Avenir-Medium" family="Avenir" pointSize="13"/> <fontDescription key="fontDescription" name="Avenir-Medium" family="Avenir" pointSize="13"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" image="defaultCheckbox" id="f8N-oJ-egW"> <imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" image="defaultCheckbox" id="f8N-oJ-egW">
@ -264,7 +268,7 @@
</connections> </connections>
</tableView> </tableView>
</subviews> </subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstItem="dwd-YU-7oV" firstAttribute="leading" secondItem="Ufo-LN-tbg" secondAttribute="trailing" id="STr-vP-7id"/> <constraint firstItem="dwd-YU-7oV" firstAttribute="leading" secondItem="Ufo-LN-tbg" secondAttribute="trailing" id="STr-vP-7id"/>
<constraint firstItem="Lh0-b2-Lg9" firstAttribute="top" secondItem="Ufo-LN-tbg" secondAttribute="bottom" id="ap0-3r-aiS"/> <constraint firstItem="Lh0-b2-Lg9" firstAttribute="top" secondItem="Ufo-LN-tbg" secondAttribute="bottom" id="ap0-3r-aiS"/>
@ -275,8 +279,6 @@
<constraint firstAttribute="trailing" secondItem="dwd-YU-7oV" secondAttribute="trailing" id="tIN-F6-Jaf"/> <constraint firstAttribute="trailing" secondItem="dwd-YU-7oV" secondAttribute="trailing" id="tIN-F6-Jaf"/>
</constraints> </constraints>
</view> </view>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<size key="freeformSize" width="600" height="600"/>
<connections> <connections>
<outlet property="menuTableView" destination="Ufo-LN-tbg" id="MLh-5f-jgM"/> <outlet property="menuTableView" destination="Ufo-LN-tbg" id="MLh-5f-jgM"/>
<outlet property="menuTableViewWidthConstraint" destination="1Fe-0J-akh" id="m5l-sp-fm3"/> <outlet property="menuTableViewWidthConstraint" destination="1Fe-0J-akh" id="m5l-sp-fm3"/>
@ -296,27 +298,27 @@
<viewControllerLayoutGuide type="bottom" id="qlN-Ul-M6a"/> <viewControllerLayoutGuide type="bottom" id="qlN-Ul-M6a"/>
</layoutGuides> </layoutGuides>
<view key="view" contentMode="scaleToFill" id="cqi-F1-zxi"> <view key="view" contentMode="scaleToFill" id="cqi-F1-zxi">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Vkr-KO-SOm" customClass="Segmentio" customModule="Segmentio"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Vkr-KO-SOm" customClass="Segmentio" customModule="Segmentio">
<rect key="frame" x="0.0" y="0.0" width="600" height="125"/> <rect key="frame" x="0.0" y="0.0" width="375" height="125"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="125" id="MbU-cC-j02"/> <constraint firstAttribute="height" constant="125" id="MbU-cC-j02"/>
</constraints> </constraints>
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aMO-Fm-zcR" userLabel="Container"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aMO-Fm-zcR" userLabel="Container">
<rect key="frame" x="0.0" y="125" width="600" height="475"/> <rect key="frame" x="0.0" y="125" width="375" height="542"/>
<subviews> <subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" bounces="NO" pagingEnabled="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" delaysContentTouches="NO" canCancelContentTouches="NO" bouncesZoom="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bPK-CN-TXA"> <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" bounces="NO" pagingEnabled="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" delaysContentTouches="NO" canCancelContentTouches="NO" bouncesZoom="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bPK-CN-TXA">
<rect key="frame" x="0.0" y="0.0" width="600" height="475"/> <rect key="frame" x="0.0" y="0.0" width="375" height="542"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<connections> <connections>
<outlet property="delegate" destination="hoe-Iv-t0i" id="tIm-r4-G4D"/> <outlet property="delegate" destination="hoe-Iv-t0i" id="tIm-r4-G4D"/>
</connections> </connections>
</scrollView> </scrollView>
</subviews> </subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstItem="bPK-CN-TXA" firstAttribute="top" secondItem="aMO-Fm-zcR" secondAttribute="top" id="83n-Aq-y36"/> <constraint firstItem="bPK-CN-TXA" firstAttribute="top" secondItem="aMO-Fm-zcR" secondAttribute="top" id="83n-Aq-y36"/>
<constraint firstAttribute="trailing" secondItem="bPK-CN-TXA" secondAttribute="trailing" id="AzX-r5-bQP"/> <constraint firstAttribute="trailing" secondItem="bPK-CN-TXA" secondAttribute="trailing" id="AzX-r5-bQP"/>
@ -325,13 +327,13 @@
</constraints> </constraints>
</view> </view>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="shadow" translatesAutoresizingMaskIntoConstraints="NO" id="i1Z-h8-Bjj"> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="shadow" translatesAutoresizingMaskIntoConstraints="NO" id="i1Z-h8-Bjj">
<rect key="frame" x="0.0" y="125" width="600" height="9"/> <rect key="frame" x="0.0" y="125" width="375" height="9"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="9" id="2DA-Ym-fL4"/> <constraint firstAttribute="height" constant="9" id="2DA-Ym-fL4"/>
</constraints> </constraints>
</imageView> </imageView>
</subviews> </subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstItem="aMO-Fm-zcR" firstAttribute="top" secondItem="Vkr-KO-SOm" secondAttribute="bottom" id="ABa-Nj-ipD"/> <constraint firstItem="aMO-Fm-zcR" firstAttribute="top" secondItem="Vkr-KO-SOm" secondAttribute="bottom" id="ABa-Nj-ipD"/>
<constraint firstItem="aMO-Fm-zcR" firstAttribute="leading" secondItem="cqi-F1-zxi" secondAttribute="leading" id="VS6-Ut-9kj"/> <constraint firstItem="aMO-Fm-zcR" firstAttribute="leading" secondItem="cqi-F1-zxi" secondAttribute="leading" id="VS6-Ut-9kj"/>
@ -375,19 +377,19 @@
<viewControllerLayoutGuide type="bottom" id="riu-eD-uzK"/> <viewControllerLayoutGuide type="bottom" id="riu-eD-uzK"/>
</layoutGuides> </layoutGuides>
<view key="view" contentMode="scaleToFill" id="8VE-5b-uC6"> <view key="view" contentMode="scaleToFill" id="8VE-5b-uC6">
<rect key="frame" x="0.0" y="0.0" width="600" height="536"/> <rect key="frame" x="0.0" y="0.0" width="375" height="603"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view> </view>
<extendedEdge key="edgesForExtendedLayout" bottom="YES"/> <extendedEdge key="edgesForExtendedLayout" bottom="YES"/>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Caz-AG-AcN" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="Caz-AG-AcN" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="2084" y="285"/> <point key="canvasLocation" x="2084" y="287"/>
</scene> </scene>
</scenes> </scenes>
<resources> <resources>
<image name="cards" width="126" height="54"/> <image name="cards" width="125" height="53"/>
<image name="defaultCheckbox" width="12" height="12"/> <image name="defaultCheckbox" width="12" height="12"/>
<image name="menu" width="28" height="14"/> <image name="menu" width="28" height="14"/>
<image name="oval" width="18" height="18"/> <image name="oval" width="18" height="18"/>

View File

@ -9,29 +9,29 @@
import UIKit import UIKit
private func yal_isPhone6() -> Bool { private func yal_isPhone6() -> Bool {
let size = UIScreen.mainScreen().bounds.size let size = UIScreen.main.bounds.size
let minSide = min(size.height, size.width) let minSide = min(size.height, size.width)
let maxSide = max(size.height, size.width) let maxSide = max(size.height, size.width)
return (fabs(minSide - 375.0) < 0.01) && (fabs(maxSide - 667.0) < 0.01) return (fabs(minSide - 375.0) < 0.01) && (fabs(maxSide - 667.0) < 0.01)
} }
class ExampleTableViewCell: UITableViewCell { class ExampleTableViewCell: UITableViewCell {
@IBOutlet private weak var hintLabel: UILabel! @IBOutlet fileprivate weak var hintLabel: UILabel!
} }
class ContentViewController: UIViewController { class ContentViewController: UIViewController {
@IBOutlet private weak var cardNameLabel: UILabel! @IBOutlet fileprivate weak var cardNameLabel: UILabel!
@IBOutlet private weak var hintTableView: UITableView! @IBOutlet fileprivate weak var hintTableView: UITableView!
@IBOutlet private weak var bottomCardConstraint: NSLayoutConstraint! @IBOutlet fileprivate weak var bottomCardConstraint: NSLayoutConstraint!
@IBOutlet private weak var heightConstraint: NSLayoutConstraint! @IBOutlet fileprivate weak var heightConstraint: NSLayoutConstraint!
var disaster: Disaster? var disaster: Disaster?
private var hints: [String]? fileprivate var hints: [String]?
class func create() -> ContentViewController { class func create() -> ContentViewController {
let mainStoryboard = UIStoryboard(name: "Main", bundle: nil) let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
return mainStoryboard.instantiateViewControllerWithIdentifier(String(self)) as! ContentViewController return mainStoryboard.instantiateViewController(withIdentifier: String(describing: self)) as! ContentViewController
} }
// MARK: - Lifecycle // MARK: - Lifecycle
@ -60,14 +60,14 @@ class ContentViewController: UIViewController {
extension ContentViewController: UITableViewDataSource { extension ContentViewController: UITableViewDataSource {
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return hints?.count ?? 0 return hints?.count ?? 0
} }
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! ExampleTableViewCell let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! ExampleTableViewCell
cell.hintLabel?.text = hints?[indexPath.row] cell.hintLabel?.text = hints?[indexPath.row]
return cell return cell
} }
} }

View File

@ -9,13 +9,13 @@
import UIKit import UIKit
import Segmentio import Segmentio
private let animateDuration: NSTimeInterval = 0.6 private let animateDuration: TimeInterval = 0.6
class EmbedContainerViewController: UIViewController { class EmbedContainerViewController: UIViewController {
var style = SegmentioStyle.OnlyImage var style = SegmentioStyle.onlyImage
private var currentViewController: UIViewController? fileprivate var currentViewController: UIViewController?
// MARK: - Lifecycle // MARK: - Lifecycle
@ -26,7 +26,7 @@ class EmbedContainerViewController: UIViewController {
// MARK: - Private functions // MARK: - Private functions
private func presentController(controller: UIViewController) { fileprivate func presentController(_ controller: UIViewController) {
if let _ = currentViewController { if let _ = currentViewController {
removeCurrentViewController() removeCurrentViewController()
} }
@ -34,29 +34,29 @@ class EmbedContainerViewController: UIViewController {
addChildViewController(controller) addChildViewController(controller)
view.addSubview(controller.view) view.addSubview(controller.view)
currentViewController = controller currentViewController = controller
controller.didMoveToParentViewController(self) controller.didMove(toParentViewController: self)
} }
private func controller(style: SegmentioStyle) -> ExampleViewController { fileprivate func controller(_ style: SegmentioStyle) -> ExampleViewController {
let controller = ExampleViewController.create() let controller = ExampleViewController.create()
controller.segmentioStyle = style controller.segmentioStyle = style
controller.view.frame = view.bounds controller.view.frame = view.bounds
return controller return controller
} }
private func removeCurrentViewController() { fileprivate func removeCurrentViewController() {
currentViewController?.willMoveToParentViewController(nil) currentViewController?.willMove(toParentViewController: nil)
currentViewController?.view.removeFromSuperview() currentViewController?.view.removeFromSuperview()
currentViewController?.removeFromParentViewController() currentViewController?.removeFromParentViewController()
} }
private func swapCurrentController(controller: UIViewController) { fileprivate func swapCurrentController(_ controller: UIViewController) {
currentViewController?.willMoveToParentViewController(nil) currentViewController?.willMove(toParentViewController: nil)
addChildViewController(controller) addChildViewController(controller)
view.addSubview(controller.view) view.addSubview(controller.view)
UIView.animateWithDuration( UIView.animate(
animateDuration, withDuration: animateDuration,
animations: { animations: {
controller.view.alpha = 1 controller.view.alpha = 1
self.currentViewController?.view.alpha = 0 self.currentViewController?.view.alpha = 0
@ -65,15 +65,15 @@ class EmbedContainerViewController: UIViewController {
self.currentViewController?.view.removeFromSuperview() self.currentViewController?.view.removeFromSuperview()
self.currentViewController?.removeFromParentViewController() self.currentViewController?.removeFromParentViewController()
self.currentViewController = controller self.currentViewController = controller
self.currentViewController?.didMoveToParentViewController(self) self.currentViewController?.didMove(toParentViewController: self)
} }
) )
} }
// MARK: - Public functions // MARK: - Public functions
func swapViewControllers(style: SegmentioStyle) { func swapViewControllers(_ style: SegmentioStyle) {
swapCurrentController(controller(style)) swapCurrentController(controller(style))
} }
} }

View File

@ -11,14 +11,14 @@ import Segmentio
class ExampleViewController: UIViewController { class ExampleViewController: UIViewController {
var segmentioStyle = SegmentioStyle.ImageOverLabel var segmentioStyle = SegmentioStyle.imageOverLabel
@IBOutlet private weak var segmentViewHeightConstraint: NSLayoutConstraint! @IBOutlet fileprivate weak var segmentViewHeightConstraint: NSLayoutConstraint!
@IBOutlet private weak var segmentioView: Segmentio! @IBOutlet fileprivate weak var segmentioView: Segmentio!
@IBOutlet private weak var containerView: UIView! @IBOutlet fileprivate weak var containerView: UIView!
@IBOutlet private weak var scrollView: UIScrollView! @IBOutlet fileprivate weak var scrollView: UIScrollView!
private lazy var viewControllers: [UIViewController] = { fileprivate lazy var viewControllers: [UIViewController] = {
return self.preparedViewControllers() return self.preparedViewControllers()
}() }()
@ -26,7 +26,7 @@ class ExampleViewController: UIViewController {
class func create() -> ExampleViewController { class func create() -> ExampleViewController {
let board = UIStoryboard(name: "Main", bundle: nil) let board = UIStoryboard(name: "Main", bundle: nil)
return board.instantiateViewControllerWithIdentifier(String(self)) as! ExampleViewController return board.instantiateViewController(withIdentifier: String(describing: self)) as! ExampleViewController
} }
// MARK: - Lifecycle // MARK: - Lifecycle
@ -35,27 +35,24 @@ class ExampleViewController: UIViewController {
super.viewDidLoad() super.viewDidLoad()
switch segmentioStyle { switch segmentioStyle {
case .OnlyLabel, .ImageBeforeLabel, .ImageAfterLabel: case .onlyLabel, .imageBeforeLabel, .imageAfterLabel:
segmentViewHeightConstraint.constant = 50 segmentViewHeightConstraint.constant = 50
case .OnlyImage: case .onlyImage:
segmentViewHeightConstraint.constant = 100 segmentViewHeightConstraint.constant = 100
default: default:
break break
} }
} }
override func viewDidAppear(animated: Bool) { override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated) super.viewDidAppear(animated)
setupSegmentioView()
setupScrollView() setupScrollView()
}
SegmentioBuilder.buildSegmentioView(
private func setupSegmentioView() { segmentioView: segmentioView,
segmentioView.setup( segmentioStyle: segmentioStyle
content: segmentioContent(),
style: segmentioStyle,
options: segmentioOptions()
) )
SegmentioBuilder.setupBadgeCountForIndex(segmentioView, index: 1)
segmentioView.selectedSegmentioIndex = selectedSegmentioIndex() segmentioView.selectedSegmentioIndex = selectedSegmentioIndex()
@ -70,108 +67,44 @@ class ExampleViewController: UIViewController {
} }
} }
private func segmentioContent() -> [SegmentioItem] {
return [
SegmentioItem(title: "Tornado", image: UIImage(named: "tornado")),
SegmentioItem(title: "Earthquakes", image: UIImage(named: "earthquakes")),
SegmentioItem(title: "Extreme heat", image: UIImage(named: "heat")),
SegmentioItem(title: "Eruption", image: UIImage(named: "eruption")),
SegmentioItem(title: "Floods", image: UIImage(named: "floods")),
SegmentioItem(title: "Wildfires", image: UIImage(named: "wildfires"))
]
}
private func segmentioOptions() -> SegmentioOptions {
var imageContentMode = UIViewContentMode.Center
switch segmentioStyle {
case .ImageBeforeLabel, .ImageAfterLabel:
imageContentMode = .ScaleAspectFit
default:
break
}
return SegmentioOptions(
backgroundColor: ColorPalette.WhiteColor,
maxVisibleItems: 3,
scrollEnabled: true,
indicatorOptions: segmentioIndicatorOptions(),
horizontalSeparatorOptions: segmentioHorizontalSeparatorOptions(),
verticalSeparatorOptions: segmentioVerticalSeparatorOptions(),
imageContentMode: imageContentMode,
labelTextAlignment: .Center,
segmentStates: segmentioStates()
)
}
private func segmentioStates() -> SegmentioStates {
let font = UIFont.exampleAvenirMediumWithSize(13)
return SegmentioStates(
defaultState: segmentioState(
backgroundColor: UIColor.clearColor(),
titleFont: font,
titleTextColor: ColorPalette.GrayChateauColor
),
selectedState: segmentioState(
backgroundColor: UIColor.clearColor(),
titleFont: font,
titleTextColor: ColorPalette.BlackColor
),
highlightedState: segmentioState(
backgroundColor: ColorPalette.WhiteSmokeColor,
titleFont: font,
titleTextColor: ColorPalette.GrayChateauColor
)
)
}
private func segmentioState(backgroundColor backgroundColor: UIColor, titleFont: UIFont, titleTextColor: UIColor) -> SegmentioState {
return SegmentioState(backgroundColor: backgroundColor, titleFont: titleFont, titleTextColor: titleTextColor)
}
private func segmentioIndicatorOptions() -> SegmentioIndicatorOptions {
return SegmentioIndicatorOptions(
type: .Bottom,
ratio: 1,
height: 5,
color: ColorPalette.CoralColor
)
}
private func segmentioHorizontalSeparatorOptions() -> SegmentioHorizontalSeparatorOptions {
return SegmentioHorizontalSeparatorOptions(
type: .TopAndBottom,
height: 1,
color: ColorPalette.WhiteSmokeColor
)
}
private func segmentioVerticalSeparatorOptions() -> SegmentioVerticalSeparatorOptions {
return SegmentioVerticalSeparatorOptions(
ratio: 1,
color: ColorPalette.WhiteSmokeColor
)
}
// Example viewControllers // Example viewControllers
private func preparedViewControllers() -> [ContentViewController] { fileprivate func preparedViewControllers() -> [ContentViewController] {
let tornadoController = ContentViewController.create() let tornadoController = ContentViewController.create()
tornadoController.disaster = Disaster(cardName: "Before tornado", hints: Hints.Tornado) tornadoController.disaster = Disaster(
cardName: "Before tornado",
hints: Hints.tornado
)
let earthquakesController = ContentViewController.create() let earthquakesController = ContentViewController.create()
earthquakesController.disaster = Disaster(cardName: "Before earthquakes", hints: Hints.Earthquakes) earthquakesController.disaster = Disaster(
cardName: "Before earthquakes",
hints: Hints.earthquakes
)
let extremeHeatController = ContentViewController.create() let extremeHeatController = ContentViewController.create()
extremeHeatController.disaster = Disaster(cardName: "Before extreme heat", hints: Hints.ExtremeHeat) extremeHeatController.disaster = Disaster(
cardName: "Before extreme heat",
hints: Hints.extremeHeat
)
let eruptionController = ContentViewController.create() let eruptionController = ContentViewController.create()
eruptionController.disaster = Disaster(cardName: "Before eruption", hints: Hints.Eruption) eruptionController.disaster = Disaster(
cardName: "Before eruption",
hints: Hints.eruption
)
let floodsController = ContentViewController.create() let floodsController = ContentViewController.create()
floodsController.disaster = Disaster(cardName: "Before floods", hints: Hints.Floods) floodsController.disaster = Disaster(
cardName: "Before floods",
hints: Hints.floods
)
let wildfiresController = ContentViewController.create() let wildfiresController = ContentViewController.create()
wildfiresController.disaster = Disaster(cardName: "Before wildfires", hints: Hints.Wildfires) wildfiresController.disaster = Disaster(
cardName: "Before wildfires",
hints: Hints.wildfires
)
return [ return [
tornadoController, tornadoController,
@ -183,49 +116,48 @@ class ExampleViewController: UIViewController {
] ]
} }
private func selectedSegmentioIndex() -> Int { fileprivate func selectedSegmentioIndex() -> Int {
return 0 return 0
} }
// MARK: - Setup container view // MARK: - Setup container view
private func setupScrollView() { fileprivate func setupScrollView() {
scrollView.contentSize = CGSize( scrollView.contentSize = CGSize(
width: UIScreen.mainScreen().bounds.width * CGFloat(viewControllers.count), width: UIScreen.main.bounds.width * CGFloat(viewControllers.count),
height: containerView.frame.height height: containerView.frame.height
) )
for (index, viewController) in viewControllers.enumerate() { for (index, viewController) in viewControllers.enumerated() {
viewController.view.frame = CGRect( viewController.view.frame = CGRect(
x: UIScreen.mainScreen().bounds.width * CGFloat(index), x: UIScreen.main.bounds.width * CGFloat(index),
y: 0, y: 0,
width: scrollView.frame.width, width: scrollView.frame.width,
height: scrollView.frame.height height: scrollView.frame.height
) )
addChildViewController(viewController) addChildViewController(viewController)
scrollView.addSubview(viewController.view, options: .UseAutoresize) // module's extension scrollView.addSubview(viewController.view, options: .useAutoresize) // module's extension
viewController.didMoveToParentViewController(self) viewController.didMove(toParentViewController: self)
} }
} }
// MARK: - Actions // MARK: - Actions
private func goToControllerAtIndex(index: Int) { fileprivate func goToControllerAtIndex(_ index: Int) {
segmentioView.selectedSegmentioIndex = index segmentioView.selectedSegmentioIndex = index
} }
} }
extension ExampleViewController: UIScrollViewDelegate { extension ExampleViewController: UIScrollViewDelegate {
func scrollViewDidEndDecelerating(scrollView: UIScrollView) { func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
let currentPage = floor(scrollView.contentOffset.x / scrollView.frame.width) let currentPage = floor(scrollView.contentOffset.x / scrollView.frame.width)
segmentioView.selectedSegmentioIndex = Int(currentPage) segmentioView.selectedSegmentioIndex = Int(currentPage)
} }
func scrollViewDidScroll(scrollView: UIScrollView) { func scrollViewDidScroll(_ scrollView: UIScrollView) {
scrollView.contentSize = CGSize(width: scrollView.contentSize.width, height: 0) scrollView.contentSize = CGSize(width: scrollView.contentSize.width, height: 0)
} }
} }

View File

@ -11,8 +11,8 @@ import Segmentio
class HomeViewController: UIViewController { class HomeViewController: UIViewController {
private var currentStyle = SegmentioStyle.OnlyImage fileprivate var currentStyle = SegmentioStyle.onlyImage
private var containerViewController: EmbedContainerViewController? fileprivate var containerViewController: EmbedContainerViewController?
// MARK: - Lifecycle // MARK: - Lifecycle
@ -20,26 +20,26 @@ class HomeViewController: UIViewController {
super.viewDidLoad() super.viewDidLoad()
} }
override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { override func shouldPerformSegue(withIdentifier identifier: String, sender: Any?) -> Bool {
return true return true
} }
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == String(EmbedContainerViewController.self) { if segue.identifier == String(describing: EmbedContainerViewController.self) {
containerViewController = segue.destinationViewController as? EmbedContainerViewController containerViewController = segue.destination as? EmbedContainerViewController
containerViewController?.style = currentStyle containerViewController?.style = currentStyle
} }
} }
// MARK: - Actions // MARK: - Actions
@IBAction private func showMenu(sender: UIBarButtonItem) { @IBAction fileprivate func showMenu(_ sender: UIBarButtonItem) {
SideMenuViewController.create().showSideMenu( SideMenuViewController.create().showSideMenu(
viewController: self, viewController: self,
currentStyle: currentStyle, currentStyle: currentStyle,
sideMenuDidHide: { [weak self] style in sideMenuDidHide: { [weak self] style in
self?.dismissViewControllerAnimated( self?.dismiss(
false, animated: false,
completion: { completion: {
if self?.currentStyle != style { if self?.currentStyle != style {
self?.currentStyle = style self?.currentStyle = style
@ -51,4 +51,4 @@ class HomeViewController: UIViewController {
) )
} }
} }

View File

@ -9,9 +9,9 @@
import UIKit import UIKit
import Segmentio import Segmentio
typealias SideMenuHandler = ((style: SegmentioStyle) -> Void) typealias SideMenuHandler = ((_ style: SegmentioStyle) -> Void)
private let animationDuration: NSTimeInterval = 0.3 private let animationDuration: TimeInterval = 0.3
private let selectedCheckboxImage = UIImage(named: "selectedCheckbox") private let selectedCheckboxImage = UIImage(named: "selectedCheckbox")
private let defaultCheckboxImage = UIImage(named: "defaultCheckbox") private let defaultCheckboxImage = UIImage(named: "defaultCheckbox")
@ -19,20 +19,21 @@ class SideMenuViewController: UIViewController {
var sideMenuDidHide: SideMenuHandler? var sideMenuDidHide: SideMenuHandler?
@IBOutlet private weak var shadowView: UIView! @IBOutlet fileprivate weak var shadowView: UIView!
@IBOutlet private weak var menuTableView: UITableView! @IBOutlet fileprivate weak var menuTableView: UITableView!
@IBOutlet private weak var menuTableViewWidthConstraint: NSLayoutConstraint! @IBOutlet fileprivate weak var menuTableViewWidthConstraint: NSLayoutConstraint!
private var menuItems = SegmentioStyle.allStyles fileprivate var menuItems = SegmentioStyle.allStyles
private var currentStyle = SegmentioStyle.OnlyImage fileprivate var currentStyle = SegmentioStyle.onlyImage
// MARK: - Lifecycle // MARK: - Lifecycle
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
menuTableView.hidden = true
view.hidden = true menuTableView.isHidden = true
menuTableViewWidthConstraint.constant = UIScreen.mainScreen().bounds.width * 0.7 view.isHidden = true
menuTableViewWidthConstraint.constant = UIScreen.main.bounds.width * 0.7
setupGestureRecognizers() setupGestureRecognizers()
} }
@ -40,23 +41,24 @@ class SideMenuViewController: UIViewController {
class func create() -> SideMenuViewController { class func create() -> SideMenuViewController {
let board = UIStoryboard(name: "Main", bundle: nil) let board = UIStoryboard(name: "Main", bundle: nil)
return board.instantiateViewControllerWithIdentifier(String(self)) as! SideMenuViewController return board.instantiateViewController(withIdentifier: String(describing: self)) as! SideMenuViewController
} }
func showSideMenu(viewController viewController: UIViewController, currentStyle: SegmentioStyle, sideMenuDidHide: SideMenuHandler?) { func showSideMenu(viewController: UIViewController, currentStyle: SegmentioStyle, sideMenuDidHide: SideMenuHandler?) {
self.currentStyle = currentStyle self.currentStyle = currentStyle
self.sideMenuDidHide = sideMenuDidHide self.sideMenuDidHide = sideMenuDidHide
self.modalPresentationStyle = .OverCurrentContext modalPresentationStyle = .overCurrentContext
let size = view.frame.size let size = view.frame.size
viewController.presentViewController(self, animated: false) { [weak self] in
self?.view.hidden = false viewController.present(self, animated: false) { [weak self] in
self?.view.isHidden = false
self?.menuTableView.frame.origin = CGPoint(x: -size.width, y: 0) self?.menuTableView.frame.origin = CGPoint(x: -size.width, y: 0)
UIView.animateWithDuration( UIView.animate(
animationDuration, withDuration: animationDuration,
animations: { animations: {
self?.view.backgroundColor = UIColor.blackColor().colorWithAlphaComponent(0.63) self?.view.backgroundColor = UIColor.black.withAlphaComponent(0.63)
self?.slideAnimationToPoint(CGPointZero) self?.slideAnimationToPoint(.zero)
self?.menuTableView.hidden = false self?.menuTableView.isHidden = false
} }
) )
} }
@ -64,64 +66,55 @@ class SideMenuViewController: UIViewController {
// MARK: - Private functions // MARK: - Private functions
private func setupGestureRecognizers() { fileprivate func setupGestureRecognizers() {
let dissmisSideMenuSelector = #selector(SideMenuViewController.dissmisSideMenu) let dissmisSideMenuSelector = #selector(SideMenuViewController.dismissSideMenu)
let tapRecognizer = UITapGestureRecognizer( let tapRecognizer = UITapGestureRecognizer(target: self, action: dissmisSideMenuSelector)
target: self,
action: dissmisSideMenuSelector
)
tapRecognizer.delegate = self tapRecognizer.delegate = self
shadowView.addGestureRecognizer(tapRecognizer) shadowView.addGestureRecognizer(tapRecognizer)
let swipeRecognizer = UISwipeGestureRecognizer( let swipeRecognizer = UISwipeGestureRecognizer(target: self, action: dissmisSideMenuSelector)
target: self, swipeRecognizer.direction = .left
action: dissmisSideMenuSelector
)
swipeRecognizer.direction = .Left
swipeRecognizer.delegate = self swipeRecognizer.delegate = self
view.addGestureRecognizer(swipeRecognizer) view.addGestureRecognizer(swipeRecognizer)
} }
private func didSelectItemAtIndexPath(indexPath: NSIndexPath) { fileprivate func didSelectItem(at indexPath: IndexPath) {
currentStyle = SegmentioStyle.allStyles[indexPath.row] currentStyle = SegmentioStyle.allStyles[indexPath.row]
dissmisSideMenu() dismissSideMenu()
} }
@objc private func dissmisSideMenu() { @objc fileprivate func dismissSideMenu() {
let size = view.frame.size let size = view.frame.size
UIView.animateWithDuration( UIView.animate(
animationDuration, withDuration: animationDuration,
animations: { animations: {
self.slideAnimationToPoint(CGPoint(x: -size.width, y: 0)) self.slideAnimationToPoint(CGPoint(x: -size.width, y: 0))
self.view.backgroundColor = UIColor.clearColor() self.view.backgroundColor = .clear
}, },
completion: { _ in completion: { _ in
self.view.hidden = true self.view.isHidden = true
self.menuTableView.hidden = true self.menuTableView.isHidden = true
self.sideMenuDidHide?(style: self.currentStyle) self.sideMenuDidHide?(self.currentStyle)
} }
) )
} }
private func slideAnimationToPoint(point: CGPoint) { fileprivate func slideAnimationToPoint(_ point: CGPoint) {
UIView.animateWithDuration(animationDuration) { UIView.animate(withDuration: animationDuration) {
self.menuTableView.frame.origin = point self.menuTableView.frame.origin = point
} }
} }
private func uncheckCurrentStyle() { fileprivate func uncheckCurrentStyle() {
guard let currentStyleIndex = menuItems.indexOf(currentStyle) else { guard let currentStyleIndex = menuItems.index(of: currentStyle) else {
return return
} }
let activeIndexPath = NSIndexPath( let activeIndexPath = IndexPath(row: currentStyleIndex, section: menuTableView.numberOfSections - 1)
forRow: currentStyleIndex,
inSection: menuTableView.numberOfSections - 1
)
let activeCell = menuTableView.cellForRowAtIndexPath(activeIndexPath) let activeCell = menuTableView.cellForRow(at: activeIndexPath)
activeCell?.imageView?.image = defaultCheckboxImage activeCell?.imageView?.image = defaultCheckboxImage
} }
@ -129,45 +122,44 @@ class SideMenuViewController: UIViewController {
extension SideMenuViewController: UITableViewDataSource { extension SideMenuViewController: UITableViewDataSource {
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return menuItems.count ?? 0 return menuItems.count
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "Cell")!
let reuseIdentifier = "Cell"
let cell = tableView.dequeueReusableCellWithIdentifier(reuseIdentifier)
let isCurrentStyle = currentStyle == menuItems[indexPath.row] let isCurrentStyle = currentStyle == menuItems[indexPath.row]
cell!.textLabel?.text = menuItems[indexPath.row].rawValue.stringFromCamelCase() cell.textLabel?.text = menuItems[indexPath.row].rawValue.stringFromCamelCase()
cell!.imageView?.image = isCurrentStyle ? selectedCheckboxImage : defaultCheckboxImage cell.imageView?.image = isCurrentStyle ? selectedCheckboxImage : defaultCheckboxImage
return cell! return cell
} }
} }
extension SideMenuViewController: UITableViewDelegate { extension SideMenuViewController: UITableViewDelegate {
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let cell = tableView.cellForRowAtIndexPath(indexPath) let cell = tableView.cellForRow(at: indexPath)
if currentStyle != menuItems[indexPath.row] { if currentStyle != menuItems[indexPath.row] {
uncheckCurrentStyle() uncheckCurrentStyle()
cell?.imageView?.image = selectedCheckboxImage cell?.imageView?.image = selectedCheckboxImage
} }
didSelectItemAtIndexPath(indexPath) didSelectItem(at: indexPath)
} }
func tableView(tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView() return UIView()
} }
} }
extension SideMenuViewController: UIGestureRecognizerDelegate { extension SideMenuViewController: UIGestureRecognizerDelegate {
func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWithGestureRecognizer otherGestureRecognizer: UIGestureRecognizer) -> Bool {
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
return true return true
} }
} }

View File

@ -1,6 +1,6 @@
The MIT License (MIT) The MIT License (MIT)
Copyright © 2015 Yalantis Copyright © 2017 Yalantis
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
@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 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 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.

101
README.md
View File

@ -1,5 +1,5 @@
##Segmentio ##Segmentio
[![Platform](http://img.shields.io/badge/platform-iOS-blue.svg?style=flat)](https://cocoapods.org/?q=segmentio) [![License](http://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/Yalantis/Segmentio/blob/master/LICENSE) ![Swift 2.2.x](https://img.shields.io/badge/Swift-2.2.x-orange.svg) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Platform](http://img.shields.io/badge/platform-iOS-blue.svg?style=flat)](https://cocoapods.org/?q=segmentio) [![License](http://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/Yalantis/Segmentio/blob/master/LICENSE) ![Swift 3.x](https://img.shields.io/badge/Swift-3.0-orange.svg) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
Animated top/bottom segmented control written in Swift. Animated top/bottom segmented control written in Swift.
@ -9,7 +9,9 @@ Check this <a href="https://dribbble.com/shots/2820372-Segmentio-Component">proj
##Requirements ##Requirements
iOS 8.x, Swift 2.2.x - Xcode 8
- iOS 8.x+
- Swift 3
##Installation ##Installation
@ -17,14 +19,14 @@ iOS 8.x, Swift 2.2.x
```ruby ```ruby
use_frameworks! use_frameworks!
pod 'Segmentio', '~> 1.1.1' pod 'Segmentio', '~> 2.1'
``` ```
*(CocoaPods v1.0.1 or later required. See [this blog post](http://blog.cocoapods.org/Pod-Authors-Guide-to-CocoaPods-Frameworks/) for details.)* *CocoaPods v1.1.0 or later required*
####[Carthage](http://github.com/Carthage/Carthage) ####[Carthage](http://github.com/Carthage/Carthage)
```ruby ```ruby
github "Yalantis/Segmentio" ~> 1.1.1 github "Yalantis/Segmentio" ~> 2.1
``` ```
##Usage ##Usage
@ -35,23 +37,26 @@ import Segmentio
####Init ####Init
You can initialize a `Segmentio` instance from code: You can initialize a `Segmentio` instance from code:
```swift ```swift
var segmentioView: Segmentio! var segmentioView: Segmentio!
let segmentioViewRect = CGRect(x: 0, y: 0, width: UIScreen.mainScreen().bounds.width, height: 125) let segmentioViewRect = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 125)
segmentioView = Segmentio(frame: segmentioViewRect) segmentioView = Segmentio(frame: segmentioViewRect)
view.addSubview(segmentioView) view.addSubview(segmentioView)
``` ```
or or
add a `UIView` instance in your .storyboard or .xib, set `Segmentio` class and connect `IBOutlet`: add a `UIView` instance in your .storyboard or .xib, set `Segmentio` class and connect `IBOutlet`:
```swift ```swift
@IBOutlet weak var segmentioView: Segmentio! @IBOutlet weak var segmentioView: Segmentio!
``` ```
####Setup `Segmentio` ####Setup `Segmentio`
```swift ```swift
segmentioView.setupContent( segmentioView.setup(
content: [SegmentioItem], content: [SegmentioItem],
style: SegmentioStyle, style: SegmentioStyle,
options: SegmentioOptions? options: SegmentioOptions?
@ -61,7 +66,7 @@ segmentioView.setupContent(
To start with default options you can just pass `nil` to the `options` parameter. To start with default options you can just pass `nil` to the `options` parameter.
```swift ```swift
segmentioView.setupContent( segmentioView.setup(
content: [SegmentioItem], content: [SegmentioItem],
style: SegmentioStyle, style: SegmentioStyle,
options: nil options: nil
@ -71,6 +76,7 @@ segmentioView.setupContent(
####Configuring items ####Configuring items
In order to set items you need to create an array of `SegmentioItem` instances: In order to set items you need to create an array of `SegmentioItem` instances:
```swift ```swift
var content = [SegmentioItem]() var content = [SegmentioItem]()
@ -83,11 +89,13 @@ content.append(tornadoItem)
####Handling selection ####Handling selection
You can specify selected item manually: You can specify selected item manually:
```swift ```swift
segmentioView.selectedSegmentIndex = 0 segmentioView.selectedSegmentioIndex = 0
``` ```
####Handling callback ####Handling callback
```swift ```swift
segmentioView.valueDidChange = { segmentio, segmentIndex in segmentioView.valueDidChange = { segmentio, segmentIndex in
print("Selected item: ", segmentIndex) print("Selected item: ", segmentIndex)
@ -96,65 +104,70 @@ segmentioView.valueDidChange = { segmentio, segmentIndex in
####Customization ####Customization
`Segmentio` can be customized by passing an instance of `SegmentioOptions` struct: `Segmentio` can be customized by passing an instance of `SegmentioOptions` struct:
```swift ```swift
SegmentioOptions( SegmentioOptions(
backgroundColor: UIColor.whiteColor(), backgroundColor: .white,
maxVisibleItems: 3, maxVisibleItems: 3,
scrollEnabled: true, scrollEnabled: true,
indicatorOptions: SegmentioIndicatorOptions, indicatorOptions: SegmentioIndicatorOptions,
horizontalSeparatorOptions: SegmentioHorizontalSeparatorOptions, horizontalSeparatorOptions: SegmentioHorizontalSeparatorOptions,
verticalSeparatorOptions: SegmentioVerticalSeparatorOptions, verticalSeparatorOptions: SegmentioVerticalSeparatorOptions,
imageContentMode: UIViewContentMode.Center, imageContentMode: .center,
labelTextAlignment: NSTextAlignment.Center, labelTextAlignment: .center,
segmentStates: SegmentioStates // tuple of SegmentioState (defaultState, selectState, highlightedState) segmentStates: SegmentioStates
) )
``` ```
Selection indicator can be customized by passing an instance of `SegmentioIndicatorOptions`: Selection indicator can be customized by passing an instance of `SegmentioIndicatorOptions`:
```swift ```swift
SegmentioIndicatorOptions( SegmentioIndicatorOptions(
type: .Bottom, type: .bottom,
ratio: 1, ratio: 1,
height: 5, height: 5,
color: UIColor.orangeColor() color: .orange
) )
``` ```
Horizontal borders can be customized by passing an instance of `SegmentioHorizontalSeparatorOptions`: Horizontal borders can be customized by passing an instance of `SegmentioHorizontalSeparatorOptions`:
```swift ```swift
SegmentioHorizontalSeparatorOptions( SegmentioHorizontalSeparatorOptions(
type: SegmentioHorizontalSeparatorType.TopAndBottom, // Top, Bottom, TopAndBottom type: SegmentioHorizontalSeparatorType.topAndBottom, // Top, Bottom, TopAndBottom
height: 1, height: 1,
color: UIColor.grayColor() color: .gray
) )
``` ```
Separators between segments can be customized by passing an instance of `SegmentioVerticalSeparatorOptions`: Separators between segments can be customized by passing an instance of `SegmentioVerticalSeparatorOptions`:
```swift ```swift
SegmentioVerticalSeparatorOptions( SegmentioVerticalSeparatorOptions(
ratio: 0.6 // from 0.1 to 1 ratio: 0.6, // from 0.1 to 1
color: UIColor.grayColor() color: .gray
) )
``` ```
In order to set `SegmentioStates` you need to create a tuple of `SegmentioState` instances: In order to set `SegmentioStates` you need to create a tuple of `SegmentioState` instances:
```swift ```swift
SegmentioStates( SegmentioStates(
defaultState: segmentioState( defaultState: SegmentioState(
backgroundColor: UIColor.clearColor(), backgroundColor: .clear,
titleFont: UIFont.systemFontOfSize(UIFont.smallSystemFontSize()), titleFont: UIFont.systemFont(ofSize: UIFont.smallSystemFontSize),
titleTextColor: UIColor.blackColor() titleTextColor: .black
), ),
selectState: segmentioState( selectedState: SegmentioState(
backgroundColor: UIColor.orangeColor(), backgroundColor: .orange,
titleFont: UIFont.systemFontOfSize(UIFont.smallSystemFontSize()), titleFont: UIFont.systemFont(ofSize: UIFont.smallSystemFontSize),
titleTextColor: UIColor.whiteColor() titleTextColor: .white
), ),
highlightedState: segmentioState( highlightedState: SegmentioState(
backgroundColor: UIColor.lightGrayColor().colorWithAlphaComponent(0.6), backgroundColor: UIColor.lightGray.withAlphaComponent(0.6),
titleFont: UIFont.boldSystemFontOfSize(UIFont.smallSystemFontSize()), titleFont: UIFont.boldSystemFont(ofSize: UIFont.smallSystemFontSize),
titleTextColor: UIColor.blackColor() titleTextColor: .black
) )
) )
``` ```
@ -167,7 +180,7 @@ P.S. Were going to publish more awesomeness wrapped in code and a tutorial on
The MIT License (MIT) The MIT License (MIT)
Copyright © 2016 Yalantis Copyright © 2017 Yalantis
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
@ -185,4 +198,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 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 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |spec| Pod::Spec.new do |spec|
spec.name = "Segmentio" spec.name = "Segmentio"
spec.version = "1.1.1" spec.version = "2.1.2"
spec.homepage = "https://github.com/Yalantis/Segmentio" spec.homepage = "https://github.com/Yalantis/Segmentio"
spec.summary = "Animated top/bottom segmented control written in Swift!" spec.summary = "Animated top/bottom segmented control written in Swift!"
@ -10,12 +10,12 @@ Pod::Spec.new do |spec|
spec.license = { :type => "MIT", :file => "LICENSE" } spec.license = { :type => "MIT", :file => "LICENSE" }
spec.social_media_url = "https://twitter.com/yalantis" spec.social_media_url = "https://twitter.com/yalantis"
spec.platform = :ios, '8.0'
spec.ios.deployment_target = '8.0' spec.ios.deployment_target = '8.0'
spec.source = { :git => "https://github.com/Yalantis/Segmentio.git", :tag => spec.version } spec.source = { :git => "https://github.com/Yalantis/Segmentio.git", :tag => spec.version }
spec.source_files = 'Segmentio/Source/**/*.swift' spec.source_files = 'Segmentio/Source/**/*.swift'
spec.resources = 'Segmentio/Source/Badge/Views/*.xib'
spec.resource_bundle = { 'Segmentio' => 'Segmentio/Source/Badge/Views/*.xib' }
spec.module_name = 'Segmentio' spec.module_name = 'Segmentio'
spec.requires_arc = true spec.requires_arc = true
end end

View File

@ -18,6 +18,10 @@
324B605E1D33E5200050B083 /* UIView+Appearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 324B60541D33E5200050B083 /* UIView+Appearance.swift */; }; 324B605E1D33E5200050B083 /* UIView+Appearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 324B60541D33E5200050B083 /* UIView+Appearance.swift */; };
324B605F1D33E5200050B083 /* Segmentio.swift in Sources */ = {isa = PBXBuildFile; fileRef = 324B60551D33E5200050B083 /* Segmentio.swift */; }; 324B605F1D33E5200050B083 /* Segmentio.swift in Sources */ = {isa = PBXBuildFile; fileRef = 324B60551D33E5200050B083 /* Segmentio.swift */; };
324B60601D33E5200050B083 /* SegmentioOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 324B60561D33E5200050B083 /* SegmentioOptions.swift */; }; 324B60601D33E5200050B083 /* SegmentioOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 324B60561D33E5200050B083 /* SegmentioOptions.swift */; };
C5514DD81DAB5B82008F14AA /* BadgeViewPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5514DD31DAB5B82008F14AA /* BadgeViewPresenter.swift */; };
C5514DD91DAB5B82008F14AA /* BadgeWithCounterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5514DD51DAB5B82008F14AA /* BadgeWithCounterView.swift */; };
C5514DDA1DAB5B82008F14AA /* BadgeWithCounterViewBigSized.xib in Resources */ = {isa = PBXBuildFile; fileRef = C5514DD61DAB5B82008F14AA /* BadgeWithCounterViewBigSized.xib */; };
C5514DDB1DAB5B82008F14AA /* BadgeWithCounterViewStandardSized.xib in Resources */ = {isa = PBXBuildFile; fileRef = C5514DD71DAB5B82008F14AA /* BadgeWithCounterViewStandardSized.xib */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
@ -34,6 +38,10 @@
324B60541D33E5200050B083 /* UIView+Appearance.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Appearance.swift"; sourceTree = "<group>"; }; 324B60541D33E5200050B083 /* UIView+Appearance.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Appearance.swift"; sourceTree = "<group>"; };
324B60551D33E5200050B083 /* Segmentio.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Segmentio.swift; sourceTree = "<group>"; }; 324B60551D33E5200050B083 /* Segmentio.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Segmentio.swift; sourceTree = "<group>"; };
324B60561D33E5200050B083 /* SegmentioOptions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SegmentioOptions.swift; sourceTree = "<group>"; }; 324B60561D33E5200050B083 /* SegmentioOptions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SegmentioOptions.swift; sourceTree = "<group>"; };
C5514DD31DAB5B82008F14AA /* BadgeViewPresenter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BadgeViewPresenter.swift; sourceTree = "<group>"; };
C5514DD51DAB5B82008F14AA /* BadgeWithCounterView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BadgeWithCounterView.swift; sourceTree = "<group>"; };
C5514DD61DAB5B82008F14AA /* BadgeWithCounterViewBigSized.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = BadgeWithCounterViewBigSized.xib; sourceTree = "<group>"; };
C5514DD71DAB5B82008F14AA /* BadgeWithCounterViewStandardSized.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = BadgeWithCounterViewStandardSized.xib; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
@ -76,6 +84,7 @@
324B604A1D33E5200050B083 /* Source */ = { 324B604A1D33E5200050B083 /* Source */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
C5514DD21DAB5B82008F14AA /* Badge */,
324B604B1D33E5200050B083 /* Cells */, 324B604B1D33E5200050B083 /* Cells */,
324B60531D33E5200050B083 /* Extensions */, 324B60531D33E5200050B083 /* Extensions */,
324B60551D33E5200050B083 /* Segmentio.swift */, 324B60551D33E5200050B083 /* Segmentio.swift */,
@ -106,6 +115,25 @@
path = Extensions; path = Extensions;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
C5514DD21DAB5B82008F14AA /* Badge */ = {
isa = PBXGroup;
children = (
C5514DD31DAB5B82008F14AA /* BadgeViewPresenter.swift */,
C5514DD41DAB5B82008F14AA /* Views */,
);
path = Badge;
sourceTree = "<group>";
};
C5514DD41DAB5B82008F14AA /* Views */ = {
isa = PBXGroup;
children = (
C5514DD51DAB5B82008F14AA /* BadgeWithCounterView.swift */,
C5514DD61DAB5B82008F14AA /* BadgeWithCounterViewBigSized.xib */,
C5514DD71DAB5B82008F14AA /* BadgeWithCounterViewStandardSized.xib */,
);
path = Views;
sourceTree = "<group>";
};
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */ /* Begin PBXHeadersBuildPhase section */
@ -150,6 +178,7 @@
TargetAttributes = { TargetAttributes = {
324B603F1D33E43E0050B083 = { 324B603F1D33E43E0050B083 = {
CreatedOnToolsVersion = 7.3.1; CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0800;
}; };
}; };
}; };
@ -176,6 +205,8 @@
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
C5514DDB1DAB5B82008F14AA /* BadgeWithCounterViewStandardSized.xib in Resources */,
C5514DDA1DAB5B82008F14AA /* BadgeWithCounterViewBigSized.xib in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -189,6 +220,8 @@
324B60601D33E5200050B083 /* SegmentioOptions.swift in Sources */, 324B60601D33E5200050B083 /* SegmentioOptions.swift in Sources */,
324B605B1D33E5200050B083 /* SegmentioCellWithImageOverLabel.swift in Sources */, 324B605B1D33E5200050B083 /* SegmentioCellWithImageOverLabel.swift in Sources */,
324B60571D33E5200050B083 /* SegmentioCell.swift in Sources */, 324B60571D33E5200050B083 /* SegmentioCell.swift in Sources */,
C5514DD91DAB5B82008F14AA /* BadgeWithCounterView.swift in Sources */,
C5514DD81DAB5B82008F14AA /* BadgeViewPresenter.swift in Sources */,
324B60591D33E5200050B083 /* SegmentioCellWithImageAfterLabel.swift in Sources */, 324B60591D33E5200050B083 /* SegmentioCellWithImageAfterLabel.swift in Sources */,
324B605F1D33E5200050B083 /* Segmentio.swift in Sources */, 324B605F1D33E5200050B083 /* Segmentio.swift in Sources */,
324B60581D33E5200050B083 /* SegmentioCellWithImage.swift in Sources */, 324B60581D33E5200050B083 /* SegmentioCellWithImage.swift in Sources */,
@ -239,7 +272,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.3; IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES; MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos; SDKROOT = iphoneos;
@ -279,7 +312,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.3; IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
@ -301,6 +334,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.yalantismobile.Segmentio; PRODUCT_BUNDLE_IDENTIFIER = com.yalantismobile.Segmentio;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = ""; VERSION_INFO_PREFIX = "";
}; };
@ -320,6 +354,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.yalantismobile.Segmentio; PRODUCT_BUNDLE_IDENTIFIER = com.yalantismobile.Segmentio;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = ""; VERSION_INFO_PREFIX = "";
}; };

View File

@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>0.1.5</string> <string>2.1</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>

View File

@ -0,0 +1,92 @@
//
// BadgeViewPresenter.swift
// Pods
//
// Created by Eugene on 22.09.16.
//
//
import UIKit
class BadgeViewPresenter {
func addBadgeForContainerView(_ containerView: UIView, counterValue: Int, backgroundColor: UIColor = .red, badgeSize: BadgeSize = .standard) {
var badgeView: BadgeWithCounterView!
for view in containerView.subviews {
if view is BadgeWithCounterView {
badgeView = view as! BadgeWithCounterView
badgeView?.setBadgeBackgroundColor(backgroundColor)
badgeView?.setBadgeCounterValue(counterValue)
}
}
if badgeView == nil {
badgeView = badgeViewForCounterValue(counterValue, backgroundColor: backgroundColor, size: badgeSize)
badgeView.translatesAutoresizingMaskIntoConstraints = false
containerView.addSubview(badgeView)
containerView.bringSubview(toFront: badgeView)
setupBadgeConstraints(badgeView, counterValue: counterValue)
}
}
func removeBadgeFromContainerView(_ containerView: UIView) {
for view in containerView.subviews {
if view is BadgeWithCounterView {
view.removeFromSuperview()
}
}
}
fileprivate func setupBadgeConstraints(_ badgeView: BadgeWithCounterView, counterValue: Int) {
var constraintConstant:CGFloat = -5.0
if counterValue > 9 {
constraintConstant = -10.0
}
let segmentTitleLabelHorizontalCenterConstraint =
NSLayoutConstraint(
item: badgeView,
attribute: .top,
relatedBy: .equal,
toItem: badgeView.superview,
attribute: .top,
multiplier: 1,
constant: 6.0
)
let segmentTitleLabelVerticalCenterConstraint =
NSLayoutConstraint(
item: badgeView,
attribute: .trailing,
relatedBy: .equal,
toItem: badgeView.superview,
attribute: .trailing,
multiplier: 1,
constant: constraintConstant
)
segmentTitleLabelHorizontalCenterConstraint.isActive = true
segmentTitleLabelVerticalCenterConstraint.isActive = true
}
}
enum Separator {
case top
case bottom
case topAndBottom
}
// MARK: Badges views creation
extension BadgeViewPresenter {
fileprivate func badgeViewForCounterValue(_ counter: Int, backgroundColor: UIColor, size: BadgeSize) -> BadgeWithCounterView {
let view = BadgeWithCounterView.instanceFromNib(size: size)
view.setBadgeBackgroundColor(backgroundColor)
view.setBadgeCounterValue(counter)
return view
}
}

View File

@ -0,0 +1,47 @@
import Foundation
private let BadgeCounterMaxValue = 99
private let BadgeCounterOverMaxValueText = "99+"
private let standardSizedNibName = "BadgeWithCounterViewStandardSized"
private let bigSizedNibName = "BadgeWithCounterViewBigSized"
enum BadgeSize {
case standard
case big
}
class BadgeWithCounterView: UIView {
@IBOutlet fileprivate weak var counterValueLabel: UILabel!
@IBOutlet fileprivate weak var backgroundImageView: UIImageView!
class func instanceFromNib(size: BadgeSize) -> BadgeWithCounterView {
let nibName = nibNameForSize(size)
let podBundle = Bundle(for: self.classForCoder())
if let bundleURL = podBundle.url(forResource: "Segmentio", withExtension: "bundle"), let bundle = Bundle(url: bundleURL) {
return UINib(nibName: nibName, bundle: bundle).instantiate(withOwner: nil, options: nil)[0] as! BadgeWithCounterView
}
return BadgeWithCounterView(frame: .zero)
}
func setBadgeCounterValue(_ counterValue: Int) {
var counterText: String!
if counterValue > BadgeCounterMaxValue {
counterText = BadgeCounterOverMaxValueText
} else {
counterText = String(counterValue)
}
counterValueLabel.text = counterText
}
func setBadgeBackgroundColor(_ color: UIColor) {
backgroundImageView.backgroundColor = color
}
fileprivate class func nibNameForSize(_ size: BadgeSize) -> String {
return size == .standard ? standardSizedNibName : bigSizedNibName
}
}

View File

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view userInteractionEnabled="NO" contentMode="scaleToFill" id="KcE-SS-9TU" customClass="BadgeWithCounterView" customModule="Segmentio">
<rect key="frame" x="0.0" y="0.0" width="38" height="20"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="250" verticalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="v0J-W6-cSb" userLabel="Background Image View" customClass="RoundImageView" customModule="Segmentio" customModuleProvider="target">
<rect key="frame" x="-2" y="-1" width="40.5" height="22"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="20" id="0LH-dc-4RL"/>
<constraint firstAttribute="width" relation="greaterThanOrEqual" secondItem="v0J-W6-cSb" secondAttribute="height" id="ofE-fK-2Pf"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="1000" verticalHuggingPriority="1000" text="99+" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.30000001192092896" translatesAutoresizingMaskIntoConstraints="NO" id="aLy-ls-VfX" userLabel="Counter Value Label">
<rect key="frame" x="6" y="2" width="25" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="v0J-W6-cSb" firstAttribute="centerX" secondItem="KcE-SS-9TU" secondAttribute="centerX" id="8mG-rK-NDa"/>
<constraint firstItem="aLy-ls-VfX" firstAttribute="width" secondItem="v0J-W6-cSb" secondAttribute="width" constant="-15" id="G78-cE-E4C"/>
<constraint firstItem="v0J-W6-cSb" firstAttribute="centerY" secondItem="KcE-SS-9TU" secondAttribute="centerY" id="ObE-ZA-xQJ"/>
<constraint firstItem="aLy-ls-VfX" firstAttribute="centerX" secondItem="v0J-W6-cSb" secondAttribute="centerX" id="Rvg-Jy-Cnd"/>
<constraint firstItem="aLy-ls-VfX" firstAttribute="centerY" secondItem="v0J-W6-cSb" secondAttribute="centerY" id="ibJ-Qo-25e"/>
<constraint firstItem="aLy-ls-VfX" firstAttribute="height" secondItem="v0J-W6-cSb" secondAttribute="height" constant="-6" id="kr5-0Q-aUM"/>
</constraints>
<nil key="simulatedStatusBarMetrics"/>
<nil key="simulatedTopBarMetrics"/>
<nil key="simulatedBottomBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="backgroundImageView" destination="v0J-W6-cSb" id="F4i-xu-iDM"/>
<outlet property="counterValueLabel" destination="aLy-ls-VfX" id="uv7-Qn-Ucz"/>
</connections>
<point key="canvasLocation" x="398" y="446"/>
</view>
</objects>
</document>

View File

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view userInteractionEnabled="NO" contentMode="scaleToFill" id="iN0-l3-epB" customClass="BadgeWithCounterView" customModule="Segmentio">
<rect key="frame" x="0.0" y="0.0" width="30" height="18"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="250" verticalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="d4V-GG-9pR" userLabel="Background Image View" customClass="RoundImageView" customModule="Segmentio" customModuleProvider="target">
<rect key="frame" x="-2" y="-1" width="32.5" height="20"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="18" id="Nld-O1-MJv"/>
<constraint firstAttribute="width" relation="greaterThanOrEqual" secondItem="d4V-GG-9pR" secondAttribute="height" id="cCQ-lW-OUm"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="1000" verticalHuggingPriority="1000" text="99+" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.29999999999999999" translatesAutoresizingMaskIntoConstraints="NO" id="ech-Mu-YMM" userLabel="Counter Value Label">
<rect key="frame" x="2.5" y="1" width="25" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="ech-Mu-YMM" firstAttribute="centerY" secondItem="d4V-GG-9pR" secondAttribute="centerY" id="3TE-QX-wNX"/>
<constraint firstItem="ech-Mu-YMM" firstAttribute="centerX" secondItem="d4V-GG-9pR" secondAttribute="centerX" id="QJJ-ap-dbB"/>
<constraint firstItem="d4V-GG-9pR" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="R7x-Ll-s8y"/>
<constraint firstItem="ech-Mu-YMM" firstAttribute="width" secondItem="d4V-GG-9pR" secondAttribute="width" constant="-7" id="Sz2-qr-fOS"/>
<constraint firstItem="d4V-GG-9pR" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="dFc-74-PeR"/>
<constraint firstItem="ech-Mu-YMM" firstAttribute="height" secondItem="d4V-GG-9pR" secondAttribute="height" constant="-4" id="uDs-Tl-0La"/>
</constraints>
<nil key="simulatedStatusBarMetrics"/>
<nil key="simulatedTopBarMetrics"/>
<nil key="simulatedBottomBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="backgroundImageView" destination="d4V-GG-9pR" id="aJr-t4-PcZ"/>
<outlet property="counterValueLabel" destination="ech-Mu-YMM" id="7r3-jp-rZj"/>
</connections>
<point key="canvasLocation" x="398" y="446"/>
</view>
</objects>
</document>

View File

@ -16,23 +16,26 @@ class SegmentioCell: UICollectionViewCell {
var verticalSeparatorView: UIView? var verticalSeparatorView: UIView?
var segmentTitleLabel: UILabel? var segmentTitleLabel: UILabel?
var segmentImageView: UIImageView? var segmentImageView: UIImageView?
var containerView: UIView?
var imageContainerView: UIView?
var topConstraint: NSLayoutConstraint? var topConstraint: NSLayoutConstraint?
var bottomConstraint: NSLayoutConstraint? var bottomConstraint: NSLayoutConstraint?
var cellSelected = false var cellSelected = false
private var options = SegmentioOptions() fileprivate var options = SegmentioOptions()
private var style = SegmentioStyle.ImageOverLabel fileprivate var style = SegmentioStyle.imageOverLabel
private let verticalSeparatorLayer = CAShapeLayer() fileprivate let verticalSeparatorLayer = CAShapeLayer()
fileprivate let badgePresenter = BadgeViewPresenter()
override var highlighted: Bool { override var isHighlighted: Bool {
get { get {
return super.highlighted return super.isHighlighted
} }
set { set {
if newValue != highlighted { if newValue != isHighlighted {
super.highlighted = newValue super.isHighlighted = newValue
let highlightedState = options.states.highlightedState let highlightedState = options.states.highlightedState
let defaultState = options.states.defaultState let defaultState = options.states.defaultState
@ -42,11 +45,11 @@ class SegmentioCell: UICollectionViewCell {
let highlightedTitleTextColor = cellSelected ? selectedState.titleTextColor : defaultState.titleTextColor let highlightedTitleTextColor = cellSelected ? selectedState.titleTextColor : defaultState.titleTextColor
let highlightedTitleFont = cellSelected ? selectedState.titleFont : defaultState.titleFont let highlightedTitleFont = cellSelected ? selectedState.titleFont : defaultState.titleFont
segmentTitleLabel?.textColor = highlighted ? highlightedState.titleTextColor : highlightedTitleTextColor segmentTitleLabel?.textColor = isHighlighted ? highlightedState.titleTextColor : highlightedTitleTextColor
segmentTitleLabel?.font = highlighted ? highlightedState.titleFont : highlightedTitleFont segmentTitleLabel?.font = isHighlighted ? highlightedState.titleFont : highlightedTitleFont
} }
backgroundColor = highlighted ? highlightedState.backgroundColor : defaultState.backgroundColor backgroundColor = isHighlighted ? highlightedState.backgroundColor : defaultState.backgroundColor
} }
} }
} }
@ -55,22 +58,33 @@ class SegmentioCell: UICollectionViewCell {
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
imageContainerView = UIView(frame: CGRect.zero)
segmentImageView = UIImageView(frame: CGRectZero) if let imageContainerView = imageContainerView {
if let segmentImageView = segmentImageView { contentView.addSubview(imageContainerView)
contentView.addSubview(segmentImageView) }
segmentImageView = UIImageView(frame: CGRect.zero)
if let segmentImageView = segmentImageView, let imageContainerView = imageContainerView {
imageContainerView.addSubview(segmentImageView)
} }
segmentTitleLabel = UILabel(frame: CGRectZero) containerView = UIView(frame: CGRect.zero)
if let segmentTitleLabel = segmentTitleLabel { if let containerView = containerView {
contentView.addSubview(segmentTitleLabel) contentView.addSubview(containerView)
} }
segmentTitleLabel = UILabel(frame: CGRect.zero)
if let segmentTitleLabel = segmentTitleLabel, let containerView = containerView {
containerView.addSubview(segmentTitleLabel)
}
segmentImageView?.translatesAutoresizingMaskIntoConstraints = false segmentImageView?.translatesAutoresizingMaskIntoConstraints = false
segmentTitleLabel?.translatesAutoresizingMaskIntoConstraints = false segmentTitleLabel?.translatesAutoresizingMaskIntoConstraints = false
containerView?.translatesAutoresizingMaskIntoConstraints = false
imageContainerView?.translatesAutoresizingMaskIntoConstraints = false
segmentImageView?.layer.masksToBounds = true segmentImageView?.layer.masksToBounds = true
segmentTitleLabel?.font = UIFont.systemFontOfSize(UIFont.smallSystemFontSize()) segmentTitleLabel?.font = UIFont.systemFont(ofSize: UIFont.smallSystemFontSize)
setupConstraintsForSubviews() setupConstraintsForSubviews()
addVerticalSeparator() addVerticalSeparator()
@ -85,11 +99,14 @@ class SegmentioCell: UICollectionViewCell {
super.prepareForReuse() super.prepareForReuse()
switch style { switch style {
case .OnlyLabel: case .onlyLabel:
badgePresenter.removeBadgeFromContainerView(containerView!)
segmentTitleLabel?.text = nil segmentTitleLabel?.text = nil
case .OnlyImage: case .onlyImage:
badgePresenter.removeBadgeFromContainerView(imageContainerView!)
segmentImageView?.image = nil segmentImageView?.image = nil
default: default:
badgePresenter.removeBadgeFromContainerView(containerView!)
segmentTitleLabel?.text = nil segmentTitleLabel?.text = nil
segmentImageView?.image = nil segmentImageView?.image = nil
} }
@ -97,11 +114,10 @@ class SegmentioCell: UICollectionViewCell {
// MARK: - Configure // MARK: - Configure
func configure(content content: SegmentioItem, style: SegmentioStyle, options: SegmentioOptions, isLastCell: Bool) { func configure(content: SegmentioItem, style: SegmentioStyle, options: SegmentioOptions, isLastCell: Bool) {
self.options = options self.options = options
self.style = style self.style = style
setupContent(content: content) setupContent(content: content)
if let indicatorOptions = self.options.indicatorOptions { if let indicatorOptions = self.options.indicatorOptions {
setupConstraint(indicatorOptions: indicatorOptions) setupConstraint(indicatorOptions: indicatorOptions)
} }
@ -111,9 +127,10 @@ class SegmentioCell: UICollectionViewCell {
setupVerticalSeparators() setupVerticalSeparators()
} }
} }
configurateBadgeWithCount(content.badgeCount, color: content.badgeColor)
} }
func configure(selected selected: Bool) { func configure(selected: Bool) {
cellSelected = selected cellSelected = selected
let selectedState = options.states.selectedState let selectedState = options.states.selectedState
@ -125,13 +142,137 @@ class SegmentioCell: UICollectionViewCell {
} }
} }
func setupConstraintsForSubviews() { func configurateBadgeWithCount(_ badgeCount: Int?, color: UIColor?) {
return // implement in subclasses guard let badgeCount = badgeCount, let color = color else {
return
}
if style == .onlyImage {
badgePresenter.addBadgeForContainerView(
imageContainerView!,
counterValue: badgeCount,
backgroundColor: color,
badgeSize: .standard
)
} else {
badgePresenter.addBadgeForContainerView(
containerView!,
counterValue: badgeCount,
backgroundColor: color,
badgeSize: .standard
)
}
} }
func setupConstraintsForSubviews() {
setupContainerConstraints()
setupImageContainerConstraints()
return // implement in subclasses
}
// MARK: - Private functions // MARK: - Private functions
private func setupContent(content content: SegmentioItem) { fileprivate func setupContainerConstraints() {
guard let segmentTitleLabel = segmentTitleLabel, let containerView = containerView else {
return
}
let segmentTitleLabelVerticalCenterConstraint = NSLayoutConstraint(
item: segmentTitleLabel,
attribute: .centerY,
relatedBy: .equal,
toItem: containerView,
attribute: .centerY,
multiplier: 1,
constant: 0
)
let segmentTitleLabelTrailingConstraint = NSLayoutConstraint(
item: segmentTitleLabel,
attribute: .trailing,
relatedBy: .equal,
toItem: containerView,
attribute: .trailing, //changed from .trailingMargin. remove std margin 8pt
multiplier: 1.0,
constant: 0
)
let segmentTitleLabelLeadingConstraint = NSLayoutConstraint(
item: segmentTitleLabel,
attribute: .leading,
relatedBy: .equal,
toItem: containerView,
attribute: .leading, //changed from .leadingMargin. remove std margin 8pt
multiplier: 1.0,
constant: 0
)
addConstraints([
segmentTitleLabelTrailingConstraint,
segmentTitleLabelVerticalCenterConstraint,
segmentTitleLabelLeadingConstraint
])
}
fileprivate func setupImageContainerConstraints() {
guard let segmentImageView = segmentImageView else {
return
}
guard let imageContainerView = imageContainerView else {
return
}
let segmentImageViewTopConstraint =
NSLayoutConstraint(
item: segmentImageView,
attribute: .top,
relatedBy: .equal,
toItem: imageContainerView,
attribute: .top,
multiplier: 1,
constant: 0
)
let segmentImageViewLeadingConstraint =
NSLayoutConstraint(
item: segmentImageView,
attribute: .leading,
relatedBy: .equal,
toItem: imageContainerView,
attribute: .leading,
multiplier: 1,
constant: 0
)
let segmentImageViewTrailingConstraint =
NSLayoutConstraint(
item: segmentImageView,
attribute: .trailing,
relatedBy: .equal,
toItem: imageContainerView,
attribute: .trailing,
multiplier: 1,
constant: 0
)
let segmentImageViewBottomConstraint =
NSLayoutConstraint(
item: segmentImageView,
attribute: .bottom,
relatedBy: .equal,
toItem: imageContainerView,
attribute: .bottom,
multiplier: 1,
constant: 0
)
addConstraints([
segmentImageViewBottomConstraint,
segmentImageViewTrailingConstraint,
segmentImageViewLeadingConstraint,
segmentImageViewTopConstraint
])
}
fileprivate func setupContent(content: SegmentioItem) {
if style.isWithImage() { if style.isWithImage() {
segmentImageView?.contentMode = options.imageContentMode segmentImageView?.contentMode = options.imageContentMode
segmentImageView?.image = content.image segmentImageView?.image = content.image
@ -139,6 +280,7 @@ class SegmentioCell: UICollectionViewCell {
if style.isWithText() { if style.isWithText() {
segmentTitleLabel?.textAlignment = options.labelTextAlignment segmentTitleLabel?.textAlignment = options.labelTextAlignment
segmentTitleLabel?.numberOfLines = options.labelTextNumberOfLines
let defaultState = options.states.defaultState let defaultState = options.states.defaultState
segmentTitleLabel?.textColor = defaultState.titleTextColor segmentTitleLabel?.textColor = defaultState.titleTextColor
segmentTitleLabel?.font = defaultState.titleFont segmentTitleLabel?.font = defaultState.titleFont
@ -146,18 +288,18 @@ class SegmentioCell: UICollectionViewCell {
} }
} }
private func setupConstraint(indicatorOptions indicatorOptions: SegmentioIndicatorOptions) { fileprivate func setupConstraint(indicatorOptions: SegmentioIndicatorOptions) {
switch indicatorOptions.type { switch indicatorOptions.type {
case .Top: case .top:
topConstraint?.constant = padding + indicatorOptions.height topConstraint?.constant = padding + indicatorOptions.height
case .Bottom: case .bottom:
bottomConstraint?.constant = padding + indicatorOptions.height bottomConstraint?.constant = padding + indicatorOptions.height
} }
} }
// MARK: - Vertical separator // MARK: - Vertical separator
private func addVerticalSeparator() { fileprivate func addVerticalSeparator() {
let contentViewWidth = contentView.bounds.width let contentViewWidth = contentView.bounds.width
let rect = CGRect( let rect = CGRect(
x: contentView.bounds.width - 1, x: contentView.bounds.width - 1,
@ -183,48 +325,50 @@ class SegmentioCell: UICollectionViewCell {
let widthConstraint = NSLayoutConstraint( let widthConstraint = NSLayoutConstraint(
item: verticalSeparatorView, item: verticalSeparatorView,
attribute: .Width, attribute: .width,
relatedBy: .Equal, relatedBy: .equal,
toItem: nil, toItem: nil,
attribute: .NotAnAttribute, attribute: .notAnAttribute,
multiplier: 1, multiplier: 1,
constant: 1 constant: 1
) )
widthConstraint.active = true widthConstraint.isActive = true
let trailingConstraint = NSLayoutConstraint( let trailingConstraint = NSLayoutConstraint(
item: verticalSeparatorView, item: verticalSeparatorView,
attribute: .Trailing, attribute: .trailing,
relatedBy: .Equal, relatedBy: .equal,
toItem: contentView, toItem: contentView,
attribute: .Trailing, attribute: .trailing,
multiplier: 1, multiplier: 1,
constant: 0 constant: 0
) )
trailingConstraint.active = true trailingConstraint.isActive = true
let topConstraint = NSLayoutConstraint( let topConstraint = NSLayoutConstraint(
item: verticalSeparatorView, item: verticalSeparatorView,
attribute: .Top, relatedBy: .Equal, attribute: .top,
toItem: contentView, attribute: .Top, relatedBy: .equal,
toItem: contentView,
attribute: .top,
multiplier: 1, multiplier: 1,
constant: 0 constant: 0
) )
topConstraint.active = true topConstraint.isActive = true
let bottomConstraint = NSLayoutConstraint( let bottomConstraint = NSLayoutConstraint(
item: contentView, item: contentView,
attribute: .Bottom, attribute: .bottom,
relatedBy: .Equal, relatedBy: .equal,
toItem: verticalSeparatorView, toItem: verticalSeparatorView,
attribute: .Bottom, attribute: .bottom,
multiplier: 1, multiplier: 1,
constant: 0 constant: 0
) )
bottomConstraint.active = true bottomConstraint.isActive = true
} }
private func setupVerticalSeparators() { fileprivate func setupVerticalSeparators() {
guard let verticalSeparatorOptions = options.verticalSeparatorOptions else { guard let verticalSeparatorOptions = options.verticalSeparatorOptions else {
return return
} }
@ -240,15 +384,15 @@ class SegmentioCell: UICollectionViewCell {
let endY = bounds.height - difference let endY = bounds.height - difference
let path = UIBezierPath() let path = UIBezierPath()
path.moveToPoint(CGPoint(x: verticalSeparatorView.frame.width / 2, y: startY)) path.move(to: CGPoint(x: verticalSeparatorView.frame.width / 2, y: startY))
path.addLineToPoint(CGPoint(x: verticalSeparatorView.frame.width / 2, y: endY)) path.addLine(to: CGPoint(x: verticalSeparatorView.frame.width / 2, y: endY))
verticalSeparatorLayer.path = path.CGPath verticalSeparatorLayer.path = path.cgPath
verticalSeparatorLayer.lineWidth = 1 verticalSeparatorLayer.lineWidth = 1
verticalSeparatorLayer.strokeColor = verticalSeparatorOptions.color.CGColor verticalSeparatorLayer.strokeColor = verticalSeparatorOptions.color.cgColor
verticalSeparatorLayer.fillColor = verticalSeparatorOptions.color.CGColor verticalSeparatorLayer.fillColor = verticalSeparatorOptions.color.cgColor
verticalSeparatorView.layer.addSublayer(verticalSeparatorLayer) verticalSeparatorView.layer.addSublayer(verticalSeparatorLayer)
} }
} }

View File

@ -11,44 +11,45 @@ import UIKit
final class SegmentioCellWithImage: SegmentioCell { final class SegmentioCellWithImage: SegmentioCell {
override func setupConstraintsForSubviews() { override func setupConstraintsForSubviews() {
guard let segmentImageView = segmentImageView else { super.setupConstraintsForSubviews()
guard let imageContainerView = imageContainerView else {
return return
} }
let views = ["segmentImageView": segmentImageView] let views = ["imageContainerView": imageContainerView]
// main constraints // main constraints
let segmentImageViewlHorizontConstraint = NSLayoutConstraint.constraintsWithVisualFormat( let segmentImageViewlHorizontConstraint = NSLayoutConstraint.constraints(
"|-[segmentImageView]-|", withVisualFormat: "|-[imageContainerView]-|",
options: [], options: [],
metrics: nil, metrics: nil,
views: views) views: views)
NSLayoutConstraint.activateConstraints(segmentImageViewlHorizontConstraint) NSLayoutConstraint.activate(segmentImageViewlHorizontConstraint)
// custom constraints // custom constraints
topConstraint = NSLayoutConstraint( topConstraint = NSLayoutConstraint(
item: segmentImageView, item: imageContainerView,
attribute: .Top, attribute: .top,
relatedBy: .Equal, relatedBy: .equal,
toItem: contentView, toItem: contentView,
attribute: .Top, attribute: .top,
multiplier: 1, multiplier: 1,
constant: padding constant: padding
) )
topConstraint?.active = true topConstraint?.isActive = true
bottomConstraint = NSLayoutConstraint( bottomConstraint = NSLayoutConstraint(
item: contentView, item: contentView,
attribute: .Bottom, attribute: .bottom,
relatedBy: .Equal, relatedBy: .equal,
toItem: segmentImageView, toItem: imageContainerView,
attribute: .Bottom, attribute: .bottom,
multiplier: 1, multiplier: 1,
constant: padding constant: padding
) )
bottomConstraint?.active = true bottomConstraint?.isActive = true
} }
} }

View File

@ -11,58 +11,58 @@ import UIKit
final class SegmentioCellWithImageAfterLabel: SegmentioCell { final class SegmentioCellWithImageAfterLabel: SegmentioCell {
override func setupConstraintsForSubviews() { override func setupConstraintsForSubviews() {
guard let segmentImageView = segmentImageView else { super.setupConstraintsForSubviews()
guard let imageContainerView = imageContainerView else {
return return
} }
guard let segmentTitleLabel = segmentTitleLabel else { guard let containerView = containerView else {
return return
} }
let metrics = ["labelHeight": segmentTitleLabelHeight] let metrics = ["labelHeight": segmentTitleLabelHeight]
let views = [ let views = [
"segmentImageView": segmentImageView, "imageContainerView": imageContainerView,
"segmentTitleLabel": segmentTitleLabel "containerView": containerView
] ]
// main constraints // main constraints
let segmentImageViewVerticalConstraint = NSLayoutConstraint.constraintsWithVisualFormat( let segmentImageViewVerticalConstraint = NSLayoutConstraint.constraints(
"V:[segmentImageView(labelHeight)]", withVisualFormat: "V:[imageContainerView(labelHeight)]",
options: [.AlignAllCenterY], options: [.alignAllCenterY],
metrics: metrics, metrics: metrics,
views: views) views: views)
NSLayoutConstraint.activateConstraints(segmentImageViewVerticalConstraint) NSLayoutConstraint.activate(segmentImageViewVerticalConstraint)
let contentViewHorizontalConstraints = NSLayoutConstraint.constraintsWithVisualFormat( let contentViewHorizontalConstraints = NSLayoutConstraint.constraints(
"|-[segmentTitleLabel]-[segmentImageView(labelHeight)]-|", withVisualFormat: "|-[containerView]-[imageContainerView(labelHeight)]-|",
options: [.AlignAllCenterY], options: [.alignAllCenterY],
metrics: metrics, metrics: metrics,
views: views) views: views)
NSLayoutConstraint.activateConstraints(contentViewHorizontalConstraints) NSLayoutConstraint.activate(contentViewHorizontalConstraints)
// custom constraints // custom constraints
topConstraint = NSLayoutConstraint( topConstraint = NSLayoutConstraint(
item: segmentTitleLabel, item: containerView,
attribute: .Top, attribute: .top,
relatedBy: .Equal, relatedBy: .equal,
toItem: contentView, toItem: contentView,
attribute: .Top, attribute: .top,
multiplier: 1, multiplier: 1,
constant: padding constant: padding
) )
topConstraint?.active = true topConstraint?.isActive = true
bottomConstraint = NSLayoutConstraint( bottomConstraint = NSLayoutConstraint(
item: contentView, item: contentView,
attribute: .Bottom, attribute: .bottom,
relatedBy: .Equal, relatedBy: .equal,
toItem: segmentTitleLabel, toItem: containerView,
attribute: .Bottom, attribute: .bottom,
multiplier: 1, multiplier: 1,
constant: padding constant: padding
) )
bottomConstraint?.active = true bottomConstraint?.isActive = true
} }
} }

View File

@ -11,58 +11,59 @@ import UIKit
class SegmentioCellWithImageBeforeLabel: SegmentioCell { class SegmentioCellWithImageBeforeLabel: SegmentioCell {
override func setupConstraintsForSubviews() { override func setupConstraintsForSubviews() {
guard let segmentImageView = segmentImageView else { super.setupConstraintsForSubviews()
guard let imageContainerView = imageContainerView else {
return return
} }
guard let segmentTitleLabel = segmentTitleLabel else { guard let containerView = containerView else {
return return
} }
let metrics = ["labelHeight": segmentTitleLabelHeight] let metrics = ["labelHeight": segmentTitleLabelHeight]
let views = [ let views = [
"segmentImageView": segmentImageView, "imageContainerView": imageContainerView,
"segmentTitleLabel": segmentTitleLabel "containerView": containerView
] ]
// main constraints // main constraints
let segmentImageViewVerticalConstraint = NSLayoutConstraint.constraintsWithVisualFormat( let segmentImageViewVerticalConstraint = NSLayoutConstraint.constraints(
"V:[segmentImageView(labelHeight)]", withVisualFormat: "V:[imageContainerView(labelHeight)]",
options: [.AlignAllCenterY], options: [.alignAllCenterY],
metrics: metrics, metrics: metrics,
views: views) views: views)
NSLayoutConstraint.activateConstraints(segmentImageViewVerticalConstraint) NSLayoutConstraint.activate(segmentImageViewVerticalConstraint)
let contentViewHorizontalConstraints = NSLayoutConstraint.constraintsWithVisualFormat( let contentViewHorizontalConstraints = NSLayoutConstraint.constraints(
"|-[segmentImageView(labelHeight)]-[segmentTitleLabel]-|", withVisualFormat: "|-[imageContainerView(labelHeight)]-[containerView]-|",
options: [.AlignAllCenterY], options: [.alignAllCenterY],
metrics: metrics, metrics: metrics,
views: views) views: views)
NSLayoutConstraint.activateConstraints(contentViewHorizontalConstraints) NSLayoutConstraint.activate(contentViewHorizontalConstraints)
// custom constraints // custom constraints
topConstraint = NSLayoutConstraint( topConstraint = NSLayoutConstraint(
item: segmentTitleLabel, item: containerView,
attribute: .Top, attribute: .top,
relatedBy: .Equal, relatedBy: .equal,
toItem: contentView, toItem: contentView,
attribute: .Top, attribute: .top,
multiplier: 1, multiplier: 1,
constant: padding constant: padding
) )
topConstraint?.active = true topConstraint?.isActive = true
bottomConstraint = NSLayoutConstraint( bottomConstraint = NSLayoutConstraint(
item: contentView, item: contentView,
attribute: .Bottom, attribute: .bottom,
relatedBy: .Equal, relatedBy: .equal,
toItem: segmentTitleLabel, toItem: containerView,
attribute: .Bottom, attribute: .bottom,
multiplier: 1, multiplier: 1,
constant: padding constant: padding
) )
bottomConstraint?.active = true bottomConstraint?.isActive = true
} }
} }

View File

@ -11,65 +11,69 @@ import UIKit
class SegmentioCellWithImageOverLabel: SegmentioCell { class SegmentioCellWithImageOverLabel: SegmentioCell {
override func setupConstraintsForSubviews() { override func setupConstraintsForSubviews() {
guard let segmentImageView = segmentImageView else { super.setupConstraintsForSubviews()
guard let imageContainerView = imageContainerView else {
return return
} }
guard let segmentTitleLabel = segmentTitleLabel else { guard let containerView = containerView else {
return return
} }
let metrics = ["labelHeight": segmentTitleLabelHeight] let metrics = ["labelHeight": segmentTitleLabelHeight]
let views = [ let views = [
"segmentImageView": segmentImageView, "imageContainerView": imageContainerView,
"segmentTitleLabel": segmentTitleLabel "containerView": containerView
] ]
// main constraints // main constraints
let segmentImageViewHorizontConstraint = NSLayoutConstraint.constraintsWithVisualFormat( let segmentImageViewHorizontConstraint = NSLayoutConstraint.constraints(
"|-[segmentImageView]-|", withVisualFormat: "|-[imageContainerView]-|",
options: [], options: [],
metrics: nil, metrics: nil,
views: views) views: views)
NSLayoutConstraint.activateConstraints(segmentImageViewHorizontConstraint) NSLayoutConstraint.activate(segmentImageViewHorizontConstraint)
let segmentTitleLabelHorizontConstraint = NSLayoutConstraint.constraintsWithVisualFormat( let segmentTitleLabelHorizontConstraint = NSLayoutConstraint.constraints(
"|-[segmentTitleLabel]-|", withVisualFormat: "|-[containerView]-|",
options: [], options: [.alignAllCenterX],
metrics: nil, metrics: nil,
views: views) views: views
NSLayoutConstraint.activateConstraints(segmentTitleLabelHorizontConstraint) )
let contentViewVerticalConstraints = NSLayoutConstraint.constraintsWithVisualFormat(
"V:[segmentImageView]-[segmentTitleLabel(labelHeight)]", NSLayoutConstraint.activate(segmentTitleLabelHorizontConstraint)
let contentViewVerticalConstraints = NSLayoutConstraint.constraints(
withVisualFormat: "V:[imageContainerView]-[containerView(labelHeight)]",
options: [], options: [],
metrics: metrics, metrics: metrics,
views: views) views: views)
NSLayoutConstraint.activateConstraints(contentViewVerticalConstraints) NSLayoutConstraint.activate(contentViewVerticalConstraints)
// custom constraints // custom constraints
topConstraint = NSLayoutConstraint( topConstraint = NSLayoutConstraint(
item: segmentImageView, item: imageContainerView,
attribute: .Top, attribute: .top,
relatedBy: .Equal, relatedBy: .equal,
toItem: contentView, toItem: contentView,
attribute: .Top, attribute: .top,
multiplier: 1, multiplier: 1,
constant: padding constant: padding
) )
topConstraint?.active = true topConstraint?.isActive = true
bottomConstraint = NSLayoutConstraint( bottomConstraint = NSLayoutConstraint(
item: contentView, item: contentView,
attribute: .Bottom, attribute: .bottom,
relatedBy: .Equal, relatedBy: .equal,
toItem: segmentTitleLabel, toItem: containerView,
attribute: .Bottom, attribute: .bottom,
multiplier: 1, multiplier: 1,
constant: padding constant: padding
) )
bottomConstraint?.active = true bottomConstraint?.isActive = true
} }
} }

View File

@ -11,65 +11,67 @@ import UIKit
class SegmentioCellWithImageUnderLabel: SegmentioCell { class SegmentioCellWithImageUnderLabel: SegmentioCell {
override func setupConstraintsForSubviews() { override func setupConstraintsForSubviews() {
guard let segmentImageView = segmentImageView else { super.setupConstraintsForSubviews()
guard let imageContainerView = imageContainerView else {
return return
} }
guard let segmentTitleLabel = segmentTitleLabel else { guard let containerView = containerView else {
return return
} }
let metrics = ["labelHeight": segmentTitleLabelHeight] let metrics = ["labelHeight": segmentTitleLabelHeight]
let views = [ let views = [
"segmentImageView": segmentImageView, "imageContainerView": imageContainerView,
"segmentTitleLabel": segmentTitleLabel "containerView": containerView
] ]
// main constraints // main constraints
let segmentImageViewHorizontConstraint = NSLayoutConstraint.constraintsWithVisualFormat( let segmentImageViewHorizontConstraint = NSLayoutConstraint.constraints(
"|-[segmentImageView]-|", withVisualFormat: "|-[imageContainerView]-|",
options: [], options: [],
metrics: nil, metrics: nil,
views: views) views: views)
NSLayoutConstraint.activateConstraints(segmentImageViewHorizontConstraint) NSLayoutConstraint.activate(segmentImageViewHorizontConstraint)
let segmentTitleLabelHorizontConstraint = NSLayoutConstraint.constraintsWithVisualFormat( let segmentTitleLabelHorizontConstraint = NSLayoutConstraint.constraints(
"|-[segmentTitleLabel]-|", withVisualFormat: "|-[containerView]-|",
options: [], options: [.alignAllCenterX],
metrics: nil, metrics: nil,
views: views) views: views
NSLayoutConstraint.activateConstraints(segmentTitleLabelHorizontConstraint) )
NSLayoutConstraint.activate(segmentTitleLabelHorizontConstraint)
let contentViewVerticalConstraints = NSLayoutConstraint.constraintsWithVisualFormat( let contentViewVerticalConstraints = NSLayoutConstraint.constraints(
"V:[segmentTitleLabel(labelHeight)]-[segmentImageView]", withVisualFormat: "V:[containerView(labelHeight)]-[imageContainerView]",
options: [], options: [],
metrics: metrics, metrics: metrics,
views: views) views: views)
NSLayoutConstraint.activateConstraints(contentViewVerticalConstraints) NSLayoutConstraint.activate(contentViewVerticalConstraints)
// custom constraints // custom constraints
topConstraint = NSLayoutConstraint( topConstraint = NSLayoutConstraint(
item: segmentTitleLabel, item: containerView,
attribute: .Top, attribute: .top,
relatedBy: .Equal, relatedBy: .equal,
toItem: contentView, toItem: contentView,
attribute: .Top, attribute: .top,
multiplier: 1, multiplier: 1,
constant: padding constant: padding
) )
topConstraint?.active = true topConstraint?.isActive = true
bottomConstraint = NSLayoutConstraint( bottomConstraint = NSLayoutConstraint(
item: contentView, item: contentView,
attribute: .Bottom, attribute: .bottom,
relatedBy: .Equal, relatedBy: .equal,
toItem: segmentImageView, toItem: imageContainerView,
attribute: .Bottom, attribute: .bottom,
multiplier: 1, multiplier: 1,
constant: padding constant: padding
) )
bottomConstraint?.active = true bottomConstraint?.isActive = true
} }
} }

View File

@ -11,45 +11,47 @@ import UIKit
final class SegmentioCellWithLabel: SegmentioCell { final class SegmentioCellWithLabel: SegmentioCell {
override func setupConstraintsForSubviews() { override func setupConstraintsForSubviews() {
guard let segmentTitleLabel = segmentTitleLabel else { super.setupConstraintsForSubviews()
guard let containerView = containerView else {
return return
} }
let views = ["segmentTitleLabel": segmentTitleLabel] let views = ["containerView": containerView]
// main constraints // main constraints
let segmentTitleLabelHorizontConstraint = NSLayoutConstraint.constraintsWithVisualFormat( let segmentTitleLabelHorizontConstraint = NSLayoutConstraint.constraints(
"|-[segmentTitleLabel]-|", withVisualFormat: "|[containerView]|", //changed from |-[containerView]-|. remove standard space
options: [], options: [.alignAllCenterX],
metrics: nil, metrics: nil,
views: views views: views
) )
NSLayoutConstraint.activateConstraints(segmentTitleLabelHorizontConstraint) NSLayoutConstraint.activate(segmentTitleLabelHorizontConstraint)
// custom constraints // custom constraints
topConstraint = NSLayoutConstraint( topConstraint = NSLayoutConstraint(
item: segmentTitleLabel, item: containerView,
attribute: .Top, attribute: .top,
relatedBy: .Equal, relatedBy: .equal,
toItem: contentView, toItem: contentView,
attribute: .Top, attribute: .top,
multiplier: 1, multiplier: 1,
constant: padding constant: padding
) )
topConstraint?.active = true topConstraint?.isActive = true
bottomConstraint = NSLayoutConstraint( bottomConstraint = NSLayoutConstraint(
item: contentView, item: contentView,
attribute: .Bottom, attribute: .bottom,
relatedBy: .Equal, relatedBy: .equal,
toItem: segmentTitleLabel, toItem: containerView,
attribute: .Bottom, attribute: .bottom,
multiplier: 1, multiplier: 1,
constant: padding constant: padding
) )
bottomConstraint?.active = true bottomConstraint?.isActive = true
} }
} }

View File

@ -0,0 +1,23 @@
import Foundation
@IBDesignable
class RoundImageView: UIImageView {
override var bounds: CGRect {
didSet {
updateCornerRadiusValue()
}
}
override func awakeFromNib() {
super.awakeFromNib()
updateCornerRadiusValue()
}
fileprivate func updateCornerRadiusValue() {
let cornerRadius = min(bounds.size.height, bounds.size.width) / 2
layer.cornerRadius = cornerRadius
}
}

View File

@ -8,34 +8,40 @@
import UIKit import UIKit
private typealias SubviewTreeModifier = (Void -> UIView) private typealias SubviewTreeModifier = ((Void) -> UIView)
public struct AppearanceOptions: OptionSetType { public struct AppearanceOptions: OptionSet {
public static let overlay = AppearanceOptions(rawValue: 1 << 0)
public static let useAutoresize = AppearanceOptions(rawValue: 1 << 1)
public let rawValue: UInt public let rawValue: UInt
public init(rawValue: UInt) { self.rawValue = rawValue }
public static let Overlay = AppearanceOptions(rawValue: 1 << 0) public init(rawValue: UInt) {
public static let UseAutoresize = AppearanceOptions(rawValue: 1 << 1) self.rawValue = rawValue
}
} }
extension UIView { extension UIView {
private func addSubviewUsingOptions(options: AppearanceOptions, modifier: SubviewTreeModifier) { fileprivate func addSubviewUsingOptions(_ options: AppearanceOptions, modifier: SubviewTreeModifier) {
let subview = modifier() let subview = modifier()
if options.union(.Overlay) == .Overlay { if options.union(.overlay) == .overlay {
if options.union(.UseAutoresize) != .UseAutoresize { if options.union(.useAutoresize) != .useAutoresize {
subview.translatesAutoresizingMaskIntoConstraints = false subview.translatesAutoresizingMaskIntoConstraints = false
let views = dictionaryOfNames([subview]) let views = dictionaryOfNames([subview])
let horisontalConstraints = NSLayoutConstraint.constraintsWithVisualFormat( let horisontalConstraints = NSLayoutConstraint.constraints(
"|[subview]|", withVisualFormat: "|[subview]|",
options: [], options: [],
metrics: nil, metrics: nil,
views: views views: views
) )
addConstraints(horisontalConstraints) addConstraints(horisontalConstraints)
let verticalConstraints = NSLayoutConstraint.constraintsWithVisualFormat( let verticalConstraints = NSLayoutConstraint.constraints(
"V:|[subview]|", withVisualFormat: "V:|[subview]|",
options: [], options: [],
metrics: nil, metrics: nil,
views: views views: views
@ -44,14 +50,14 @@ extension UIView {
} else { } else {
frame = bounds frame = bounds
subview.autoresizingMask = [.FlexibleWidth, .FlexibleHeight] subview.autoresizingMask = [.flexibleWidth, .flexibleHeight]
} }
} }
} }
private func dictionaryOfNames(views:[UIView]) -> [String: UIView] { fileprivate func dictionaryOfNames(_ views: [UIView]) -> [String: UIView] {
var container = [String: UIView]() var container = [String: UIView]()
for (_, value) in views.enumerate() { for (_, value) in views.enumerated() {
container["subview"] = value container["subview"] = value
} }
return container return container
@ -59,7 +65,7 @@ extension UIView {
// MARK: - Interface methods // MARK: - Interface methods
public func addSubview(subview: UIView, options: AppearanceOptions) { public func addSubview(_ subview: UIView, options: AppearanceOptions) {
if subview.superview == self { if subview.superview == self {
return return
} }
@ -69,14 +75,14 @@ extension UIView {
} }
} }
public func insertSubview(subview: UIView, index: Int, options: AppearanceOptions) { public func insertSubview(_ subview: UIView, index: Int, options: AppearanceOptions) {
if subview.superview == self { if subview.superview == self {
return return
} }
addSubviewUsingOptions(options) { [weak self] in addSubviewUsingOptions(options) { [weak self] in
self?.insertSubview(subview, atIndex: index) self?.insertSubview(subview, at: index)
return subview return subview
} }
} }
} }

View File

@ -9,11 +9,9 @@
import UIKit import UIKit
import QuartzCore import QuartzCore
public typealias SegmentioSelectionCallback = ((segmentio: Segmentio, selectedSegmentioIndex: Int) -> Void) public typealias SegmentioSelectionCallback = ((_ segmentio: Segmentio, _ selectedSegmentioIndex: Int) -> Void)
private let animationDuration: CFTimeInterval = 0.3 open class Segmentio: UIView {
public class Segmentio: UIView {
internal struct Points { internal struct Points {
var startPoint: CGPoint var startPoint: CGPoint
@ -36,41 +34,29 @@ public class Segmentio: UIView {
var endX: CGFloat var endX: CGFloat
} }
public var valueDidChange: SegmentioSelectionCallback? open var valueDidChange: SegmentioSelectionCallback?
public var selectedSegmentioIndex = -1 { open var selectedSegmentioIndex = -1 {
didSet { didSet {
if selectedSegmentioIndex != oldValue { if selectedSegmentioIndex != oldValue {
reloadSegmentio() reloadSegmentio()
valueDidChange?(segmentio: self, selectedSegmentioIndex: selectedSegmentioIndex) valueDidChange?(self, selectedSegmentioIndex)
} }
} }
} }
open fileprivate(set) var segmentioItems = [SegmentioItem]()
fileprivate var segmentioCollectionView: UICollectionView?
fileprivate var segmentioOptions = SegmentioOptions()
fileprivate var segmentioStyle = SegmentioStyle.imageOverLabel
fileprivate var isPerformingScrollAnimation = false
private var segmentioCollectionView: UICollectionView? fileprivate var topSeparatorView: UIView?
private var segmentioItems = [SegmentioItem]() fileprivate var bottomSeparatorView: UIView?
private var segmentioOptions = SegmentioOptions() fileprivate var indicatorLayer: CAShapeLayer?
private var segmentioStyle = SegmentioStyle.ImageOverLabel fileprivate var selectedLayer: CAShapeLayer?
private var isPerformingScrollAnimation = false
private var topSeparatorView: UIView?
private var bottomSeparatorView: UIView?
private var indicatorLayer: CAShapeLayer?
private var selectedLayer: CAShapeLayer?
private var cachedOrientation: UIInterfaceOrientation? = UIApplication.sharedApplication().statusBarOrientation {
didSet {
if cachedOrientation != oldValue {
reloadSegmentio()
}
}
}
// MARK: - Lifecycle // MARK: - Lifecycle
deinit {
NSNotificationCenter.defaultCenter().removeObserver(self)
}
required public init?(coder aDecoder: NSCoder) { required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder) super.init(coder: aDecoder)
commonInit() commonInit()
@ -81,20 +67,19 @@ public class Segmentio: UIView {
commonInit() commonInit()
} }
private func commonInit() { open override func layoutSubviews() {
setupSegmentedCollectionView() super.layoutSubviews()
NSNotificationCenter.defaultCenter().addObserver( reloadSegmentio()
self,
selector: #selector(Segmentio.handleOrientationNotification),
name: UIDeviceOrientationDidChangeNotification,
object: nil
)
} }
private func setupSegmentedCollectionView() { fileprivate func commonInit() {
setupSegmentedCollectionView()
}
fileprivate func setupSegmentedCollectionView() {
let layout = UICollectionViewFlowLayout() let layout = UICollectionViewFlowLayout()
layout.sectionInset = UIEdgeInsetsZero layout.sectionInset = UIEdgeInsets.zero
layout.scrollDirection = .Horizontal layout.scrollDirection = .horizontal
layout.minimumInteritemSpacing = 0 layout.minimumInteritemSpacing = 0
layout.minimumLineSpacing = 0 layout.minimumLineSpacing = 0
@ -105,21 +90,21 @@ public class Segmentio: UIView {
collectionView.dataSource = self collectionView.dataSource = self
collectionView.delegate = self collectionView.delegate = self
collectionView.pagingEnabled = false collectionView.isPagingEnabled = false
collectionView.showsHorizontalScrollIndicator = false collectionView.showsHorizontalScrollIndicator = false
collectionView.showsVerticalScrollIndicator = false collectionView.showsVerticalScrollIndicator = false
collectionView.bounces = true collectionView.bounces = true
collectionView.scrollEnabled = segmentioOptions.scrollEnabled collectionView.isScrollEnabled = segmentioOptions.scrollEnabled
collectionView.backgroundColor = UIColor.clearColor() collectionView.backgroundColor = .clear
segmentioCollectionView = collectionView segmentioCollectionView = collectionView
if let segmentioCollectionView = segmentioCollectionView { if let segmentioCollectionView = segmentioCollectionView {
addSubview(segmentioCollectionView, options: .Overlay) addSubview(segmentioCollectionView, options: .overlay)
} }
} }
private func frameForSegmentCollectionView() -> CGRect { fileprivate func frameForSegmentCollectionView() -> CGRect {
var separatorsHeight: CGFloat = 0 var separatorsHeight: CGFloat = 0
var collectionViewFrameMinY: CGFloat = 0 var collectionViewFrameMinY: CGFloat = 0
@ -127,12 +112,12 @@ public class Segmentio: UIView {
let separatorHeight = horizontalSeparatorOptions.height let separatorHeight = horizontalSeparatorOptions.height
switch horizontalSeparatorOptions.type { switch horizontalSeparatorOptions.type {
case .Top: case .top:
collectionViewFrameMinY = separatorHeight collectionViewFrameMinY = separatorHeight
separatorsHeight = separatorHeight separatorsHeight = separatorHeight
case .Bottom: case .bottom:
separatorsHeight = separatorHeight separatorsHeight = separatorHeight
case .TopAndBottom: case .topAndBottom:
collectionViewFrameMinY = separatorHeight collectionViewFrameMinY = separatorHeight
separatorsHeight = separatorHeight * 2 separatorsHeight = separatorHeight * 2
} }
@ -146,16 +131,10 @@ public class Segmentio: UIView {
) )
} }
// MARK: - Handle orientation notification
@objc private func handleOrientationNotification() {
cachedOrientation = UIApplication.sharedApplication().statusBarOrientation
}
// MARK: - Setups: // MARK: - Setups:
// MARK: Main setup // MARK: Main setup
public func setup(content content: [SegmentioItem], style: SegmentioStyle, options: SegmentioOptions?) { open func setup(content: [SegmentioItem], style: SegmentioStyle, options: SegmentioOptions?) {
segmentioItems = content segmentioItems = content
segmentioStyle = style segmentioStyle = style
@ -164,13 +143,13 @@ public class Segmentio: UIView {
if let options = options { if let options = options {
segmentioOptions = options segmentioOptions = options
segmentioCollectionView?.scrollEnabled = segmentioOptions.scrollEnabled segmentioCollectionView?.isScrollEnabled = segmentioOptions.scrollEnabled
backgroundColor = options.backgroundColor backgroundColor = options.backgroundColor
} }
if segmentioOptions.states.selectedState.backgroundColor != UIColor.clearColor() { if segmentioOptions.states.selectedState.backgroundColor != .clear {
selectedLayer = CAShapeLayer() selectedLayer = CAShapeLayer()
if let selectedLayer = selectedLayer, sublayer = segmentioCollectionView?.layer { if let selectedLayer = selectedLayer, let sublayer = segmentioCollectionView?.layer {
setupShapeLayer( setupShapeLayer(
shapeLayer: selectedLayer, shapeLayer: selectedLayer,
backgroundColor: segmentioOptions.states.selectedState.backgroundColor, backgroundColor: segmentioOptions.states.selectedState.backgroundColor,
@ -197,33 +176,43 @@ public class Segmentio: UIView {
segmentioCollectionView?.reloadData() segmentioCollectionView?.reloadData()
} }
public override func didMoveToSuperview() { open override func didMoveToSuperview() {
super.didMoveToSuperview() super.didMoveToSuperview()
setupHorizontalSeparatorIfPossible() setupHorizontalSeparatorIfPossible()
} }
open func addBadge(at index: Int, count: Int, color: UIColor = .red) {
segmentioItems[index].addBadge(count, color: color)
segmentioCollectionView?.reloadData()
}
open func removeBadge(at index: Int) {
segmentioItems[index].removeBadge()
segmentioCollectionView?.reloadData()
}
// MARK: Collection view setup // MARK: Collection view setup
private func setupCellWithStyle(style: SegmentioStyle) { fileprivate func setupCellWithStyle(_ style: SegmentioStyle) {
var cellClass: SegmentioCell.Type { var cellClass: SegmentioCell.Type {
switch style { switch style {
case .OnlyLabel: case .onlyLabel:
return SegmentioCellWithLabel.self return SegmentioCellWithLabel.self
case .OnlyImage: case .onlyImage:
return SegmentioCellWithImage.self return SegmentioCellWithImage.self
case .ImageOverLabel: case .imageOverLabel:
return SegmentioCellWithImageOverLabel.self return SegmentioCellWithImageOverLabel.self
case .ImageUnderLabel: case .imageUnderLabel:
return SegmentioCellWithImageUnderLabel.self return SegmentioCellWithImageUnderLabel.self
case .ImageBeforeLabel: case .imageBeforeLabel:
return SegmentioCellWithImageBeforeLabel.self return SegmentioCellWithImageBeforeLabel.self
case .ImageAfterLabel: case .imageAfterLabel:
return SegmentioCellWithImageAfterLabel.self return SegmentioCellWithImageAfterLabel.self
} }
} }
segmentioCollectionView?.registerClass( segmentioCollectionView?.register(
cellClass, cellClass,
forCellWithReuseIdentifier: segmentioStyle.rawValue forCellWithReuseIdentifier: segmentioStyle.rawValue
) )
@ -233,13 +222,13 @@ public class Segmentio: UIView {
// MARK: Horizontal separators setup // MARK: Horizontal separators setup
private func setupHorizontalSeparatorIfPossible() { fileprivate func setupHorizontalSeparatorIfPossible() {
if superview != nil && segmentioOptions.horizontalSeparatorOptions != nil { if superview != nil && segmentioOptions.horizontalSeparatorOptions != nil {
setupHorizontalSeparator() setupHorizontalSeparator()
} }
} }
private func setupHorizontalSeparator() { fileprivate func setupHorizontalSeparator() {
topSeparatorView?.removeFromSuperview() topSeparatorView?.removeFromSuperview()
bottomSeparatorView?.removeFromSuperview() bottomSeparatorView?.removeFromSuperview()
@ -250,16 +239,16 @@ public class Segmentio: UIView {
let height = horizontalSeparatorOptions.height let height = horizontalSeparatorOptions.height
let type = horizontalSeparatorOptions.type let type = horizontalSeparatorOptions.type
if type == .Top || type == .TopAndBottom { if type == .top || type == .topAndBottom {
topSeparatorView = UIView(frame: CGRectZero) topSeparatorView = UIView(frame: CGRect.zero)
setupConstraintsForSeparatorView( setupConstraintsForSeparatorView(
separatorView: topSeparatorView, separatorView: topSeparatorView,
originY: 0 originY: 0
) )
} }
if type == .Bottom || type == .TopAndBottom { if type == .bottom || type == .topAndBottom {
bottomSeparatorView = UIView(frame: CGRectZero) bottomSeparatorView = UIView(frame: CGRect.zero)
setupConstraintsForSeparatorView( setupConstraintsForSeparatorView(
separatorView: bottomSeparatorView, separatorView: bottomSeparatorView,
originY: frame.maxY - height originY: frame.maxY - height
@ -267,8 +256,8 @@ public class Segmentio: UIView {
} }
} }
private func setupConstraintsForSeparatorView(separatorView separatorView: UIView?, originY: CGFloat) { fileprivate func setupConstraintsForSeparatorView(separatorView: UIView?, originY: CGFloat) {
guard let horizontalSeparatorOptions = segmentioOptions.horizontalSeparatorOptions, separatorView = separatorView else { guard let horizontalSeparatorOptions = segmentioOptions.horizontalSeparatorOptions, let separatorView = separatorView else {
return return
} }
@ -278,61 +267,62 @@ public class Segmentio: UIView {
let topConstraint = NSLayoutConstraint( let topConstraint = NSLayoutConstraint(
item: separatorView, item: separatorView,
attribute: .Top, attribute: .top,
relatedBy: .Equal, relatedBy: .equal,
toItem: superview, toItem: superview,
attribute: .Top, attribute: .top,
multiplier: 1, multiplier: 1,
constant: originY constant: originY
) )
topConstraint.active = true topConstraint.isActive = true
let leadingConstraint = NSLayoutConstraint( let leadingConstraint = NSLayoutConstraint(
item: separatorView, item: separatorView,
attribute: .Leading, attribute: .leading,
relatedBy: .Equal, relatedBy: .equal,
toItem: self, toItem: self,
attribute: .Leading, attribute: .leading,
multiplier: 1, multiplier: 1,
constant: 0 constant: 0
) )
leadingConstraint.active = true leadingConstraint.isActive = true
let trailingConstraint = NSLayoutConstraint( let trailingConstraint = NSLayoutConstraint(
item: separatorView, item: separatorView,
attribute: .Trailing, attribute: .trailing,
relatedBy: .Equal, relatedBy: .equal,
toItem: self, toItem: self,
attribute: .Trailing, attribute: .trailing,
multiplier: 1, multiplier: 1,
constant: 0 constant: 0
) )
trailingConstraint.active = true trailingConstraint.isActive = true
let heightConstraint = NSLayoutConstraint( let heightConstraint = NSLayoutConstraint(
item: separatorView, item: separatorView,
attribute: .Height, attribute: .height,
relatedBy: .Equal, relatedBy: .equal,
toItem: nil, toItem: nil,
attribute: .NotAnAttribute, attribute: .notAnAttribute,
multiplier: 1, multiplier: 1,
constant: horizontalSeparatorOptions.height constant: horizontalSeparatorOptions.height
) )
heightConstraint.active = true heightConstraint.isActive = true
} }
// MARK: CAShapeLayers setup // MARK: CAShapeLayers setup
private func setupShapeLayer(shapeLayer shapeLayer: CAShapeLayer, backgroundColor: UIColor, height: CGFloat, sublayer: CALayer) { fileprivate func setupShapeLayer(shapeLayer: CAShapeLayer, backgroundColor: UIColor, height: CGFloat, sublayer: CALayer) {
shapeLayer.fillColor = backgroundColor.CGColor shapeLayer.fillColor = backgroundColor.cgColor
shapeLayer.strokeColor = backgroundColor.CGColor shapeLayer.strokeColor = backgroundColor.cgColor
shapeLayer.lineWidth = height shapeLayer.lineWidth = height
layer.insertSublayer(shapeLayer, below: sublayer) layer.insertSublayer(shapeLayer, below: sublayer)
} }
// MARK: - Actions: // MARK: - Actions:
// MARK: Reload segmentio // MARK: Reload segmentio
private func reloadSegmentio() { public func reloadSegmentio() {
segmentioCollectionView?.collectionViewLayout.invalidateLayout()
segmentioCollectionView?.reloadData() segmentioCollectionView?.reloadData()
scrollToItemAtContext() scrollToItemAtContext()
moveShapeLayerAtContext() moveShapeLayerAtContext()
@ -340,7 +330,7 @@ public class Segmentio: UIView {
// MARK: Move shape layer to item // MARK: Move shape layer to item
private func moveShapeLayerAtContext() { fileprivate func moveShapeLayerAtContext() {
if let indicatorLayer = indicatorLayer, let options = segmentioOptions.indicatorOptions { if let indicatorLayer = indicatorLayer, let options = segmentioOptions.indicatorOptions {
let item = itemInSuperview(ratio: options.ratio) let item = itemInSuperview(ratio: options.ratio)
let context = contextForItem(item) let context = contextForItem(item)
@ -380,8 +370,8 @@ public class Segmentio: UIView {
// MARK: Scroll to item // MARK: Scroll to item
private func scrollToItemAtContext() { fileprivate func scrollToItemAtContext() {
guard let numberOfSections = segmentioCollectionView?.numberOfSections() else { guard let numberOfSections = segmentioCollectionView?.numberOfSections else {
return return
} }
@ -390,20 +380,21 @@ public class Segmentio: UIView {
if context.isLastOrPrelastVisibleCell == true { if context.isLastOrPrelastVisibleCell == true {
let newIndex = selectedSegmentioIndex + (context.isLastCell ? 0 : 1) let newIndex = selectedSegmentioIndex + (context.isLastCell ? 0 : 1)
let newIndexPath = NSIndexPath(forItem: newIndex, inSection: numberOfSections - 1) let newIndexPath = IndexPath(item: newIndex, section: numberOfSections - 1)
segmentioCollectionView?.scrollToItemAtIndexPath( segmentioCollectionView?.scrollToItem(
newIndexPath, at: newIndexPath,
atScrollPosition: .None, at: UICollectionViewScrollPosition(),
animated: true animated: true
) )
} }
if context.isFirstOrSecondVisibleCell == true { if context.isFirstOrSecondVisibleCell == true && selectedSegmentioIndex != -1 {
let newIndex = selectedSegmentioIndex - (context.isFirstIndex ? 1 : 0) let newIndex = selectedSegmentioIndex - (context.isFirstIndex ? 1 : 0)
let newIndexPath = NSIndexPath(forItem: newIndex, inSection: numberOfSections - 1) let newIndexPath = IndexPath(item: newIndex, section: numberOfSections - 1)
segmentioCollectionView?.scrollToItemAtIndexPath(
newIndexPath, segmentioCollectionView?.scrollToItem(
atScrollPosition: .None, at: newIndexPath,
at: UICollectionViewScrollPosition(),
animated: true animated: true
) )
} }
@ -411,38 +402,38 @@ public class Segmentio: UIView {
// MARK: Move shape layer // MARK: Move shape layer
private func moveShapeLayer(shapeLayer: CAShapeLayer, startPoint: CGPoint, endPoint: CGPoint, animated: Bool = false) { fileprivate func moveShapeLayer(_ shapeLayer: CAShapeLayer, startPoint: CGPoint, endPoint: CGPoint, animated: Bool = false) {
var endPointWithVerticalSeparator = endPoint var endPointWithVerticalSeparator = endPoint
let isLastItem = selectedSegmentioIndex + 1 == segmentioItems.count let isLastItem = selectedSegmentioIndex + 1 == segmentioItems.count
endPointWithVerticalSeparator.x = endPoint.x - (isLastItem ? 0 : 1) endPointWithVerticalSeparator.x = endPoint.x - (isLastItem ? 0 : 1)
let shapeLayerPath = UIBezierPath() let shapeLayerPath = UIBezierPath()
shapeLayerPath.moveToPoint(startPoint) shapeLayerPath.move(to: startPoint)
shapeLayerPath.addLineToPoint(endPointWithVerticalSeparator) shapeLayerPath.addLine(to: endPointWithVerticalSeparator)
if animated == true { if animated == true {
isPerformingScrollAnimation = true isPerformingScrollAnimation = true
userInteractionEnabled = false isUserInteractionEnabled = false
CATransaction.begin() CATransaction.begin()
let animation = CABasicAnimation(keyPath: "path") let animation = CABasicAnimation(keyPath: "path")
animation.fromValue = shapeLayer.path animation.fromValue = shapeLayer.path
animation.toValue = shapeLayerPath.CGPath animation.toValue = shapeLayerPath.cgPath
animation.duration = animationDuration animation.duration = segmentioOptions.animationDuration
CATransaction.setCompletionBlock() { CATransaction.setCompletionBlock() {
self.isPerformingScrollAnimation = false self.isPerformingScrollAnimation = false
self.userInteractionEnabled = true self.isUserInteractionEnabled = true
} }
shapeLayer.addAnimation(animation, forKey: "path") shapeLayer.add(animation, forKey: "path")
CATransaction.commit() CATransaction.commit()
} }
shapeLayer.path = shapeLayerPath.CGPath shapeLayer.path = shapeLayerPath.cgPath
} }
// MARK: - Context for item // MARK: - Context for item
private func contextForItem(item: ItemInSuperview) -> Context { fileprivate func contextForItem(_ item: ItemInSuperview) -> Context {
let cellFrame = item.cellFrameInSuperview let cellFrame = item.cellFrameInSuperview
let cellWidth = cellFrame.width let cellWidth = cellFrame.width
let lastCellMinX = floor(item.collectionViewWidth - cellWidth) let lastCellMinX = floor(item.collectionViewWidth - cellWidth)
@ -466,10 +457,10 @@ public class Segmentio: UIView {
// MARK: - Item in superview // MARK: - Item in superview
private func itemInSuperview(ratio ratio: CGFloat = 1) -> ItemInSuperview { fileprivate func itemInSuperview(ratio: CGFloat = 1) -> ItemInSuperview {
var collectionViewWidth: CGFloat = 0 var collectionViewWidth: CGFloat = 0
var cellWidth: CGFloat = 0 var cellWidth: CGFloat = 0
var cellRect = CGRectZero var cellRect = CGRect.zero
var shapeLayerWidth: CGFloat = 0 var shapeLayerWidth: CGFloat = 0
if let collectionView = segmentioCollectionView { if let collectionView = segmentioCollectionView {
@ -498,7 +489,7 @@ public class Segmentio: UIView {
// MARK: - Indicator point Y // MARK: - Indicator point Y
private func indicatorPointY() -> CGFloat { fileprivate func indicatorPointY() -> CGFloat {
var indicatorPointY: CGFloat = 0 var indicatorPointY: CGFloat = 0
guard let indicatorOptions = segmentioOptions.indicatorOptions else { guard let indicatorOptions = segmentioOptions.indicatorOptions else {
@ -506,9 +497,9 @@ public class Segmentio: UIView {
} }
switch indicatorOptions.type { switch indicatorOptions.type {
case .Top: case .top:
indicatorPointY = (indicatorOptions.height / 2) indicatorPointY = (indicatorOptions.height / 2)
case .Bottom: case .bottom:
indicatorPointY = frame.height - (indicatorOptions.height / 2) indicatorPointY = frame.height - (indicatorOptions.height / 2)
} }
@ -517,14 +508,14 @@ public class Segmentio: UIView {
} }
let separatorHeight = horizontalSeparatorOptions.height let separatorHeight = horizontalSeparatorOptions.height
let isIndicatorTop = indicatorOptions.type == .Top let isIndicatorTop = indicatorOptions.type == .top
switch horizontalSeparatorOptions.type { switch horizontalSeparatorOptions.type {
case .Top: case .top:
indicatorPointY = isIndicatorTop ? indicatorPointY + separatorHeight : indicatorPointY indicatorPointY = isIndicatorTop ? indicatorPointY + separatorHeight : indicatorPointY
case .Bottom: case .bottom:
indicatorPointY = isIndicatorTop ? indicatorPointY : indicatorPointY - separatorHeight indicatorPointY = isIndicatorTop ? indicatorPointY : indicatorPointY - separatorHeight
case .TopAndBottom: case .topAndBottom:
indicatorPointY = isIndicatorTop ? indicatorPointY + separatorHeight : indicatorPointY - separatorHeight indicatorPointY = isIndicatorTop ? indicatorPointY + separatorHeight : indicatorPointY - separatorHeight
} }
@ -536,14 +527,14 @@ public class Segmentio: UIView {
extension Segmentio: UICollectionViewDataSource { extension Segmentio: UICollectionViewDataSource {
public func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return segmentioItems.count ?? 0 return segmentioItems.count
} }
public func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier( let cell = collectionView.dequeueReusableCell(
segmentioStyle.rawValue, withReuseIdentifier: segmentioStyle.rawValue,
forIndexPath: indexPath) as! SegmentioCell for: indexPath) as! SegmentioCell
cell.configure( cell.configure(
content: segmentioItems[indexPath.row], content: segmentioItems[indexPath.row],
@ -563,11 +554,11 @@ extension Segmentio: UICollectionViewDataSource {
extension Segmentio: UICollectionViewDelegate { extension Segmentio: UICollectionViewDelegate {
public func collectionView(collectionView: UICollectionView, shouldSelectItemAtIndexPath indexPath: NSIndexPath) -> Bool { public func collectionView(_ collectionView: UICollectionView, shouldSelectItemAt indexPath: IndexPath) -> Bool {
return true return true
} }
public func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) { public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
selectedSegmentioIndex = indexPath.row selectedSegmentioIndex = indexPath.row
} }
@ -577,12 +568,9 @@ extension Segmentio: UICollectionViewDelegate {
extension Segmentio: UICollectionViewDelegateFlowLayout { extension Segmentio: UICollectionViewDelegateFlowLayout {
public func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize { public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let maxVisibleItems = segmentioOptions.maxVisibleItems > segmentioItems.count ? CGFloat(segmentioItems.count) : CGFloat(segmentioOptions.maxVisibleItems) let maxVisibleItems = segmentioOptions.maxVisibleItems > segmentioItems.count ? CGFloat(segmentioItems.count) : CGFloat(segmentioOptions.maxVisibleItems)
return CGSize( return CGSize( width: floor(collectionView.frame.width / maxVisibleItems), height: collectionView.frame.height)
width: floor(collectionView.frame.width / maxVisibleItems),
height: collectionView.frame.height
)
} }
} }
@ -591,17 +579,17 @@ extension Segmentio: UICollectionViewDelegateFlowLayout {
extension Segmentio: UIScrollViewDelegate { extension Segmentio: UIScrollViewDelegate {
public func scrollViewDidScroll(scrollView: UIScrollView) { public func scrollViewDidScroll(_ scrollView: UIScrollView) {
if isPerformingScrollAnimation == true { if isPerformingScrollAnimation {
return return
} }
if let options = segmentioOptions.indicatorOptions, indicatorLayer = indicatorLayer { if let options = segmentioOptions.indicatorOptions, let indicatorLayer = indicatorLayer {
let item = itemInSuperview(ratio: options.ratio) let item = itemInSuperview(ratio: options.ratio)
moveShapeLayer( moveShapeLayer(
indicatorLayer, indicatorLayer,
startPoint: CGPointMake(item.startX, indicatorPointY()), startPoint: CGPoint(x: item.startX, y: indicatorPointY()),
endPoint: CGPointMake(item.endX, indicatorPointY()), endPoint: CGPoint(x: item.endX, y: indicatorPointY()),
animated: false animated: false
) )
} }
@ -620,6 +608,7 @@ extension Segmentio: UIScrollViewDelegate {
} }
extension Segmentio.Points { extension Segmentio.Points {
init(context: Segmentio.Context, item: Segmentio.ItemInSuperview, pointY: CGFloat) { init(context: Segmentio.Context, item: Segmentio.ItemInSuperview, pointY: CGFloat) {
let cellWidth = item.cellFrameInSuperview.width let cellWidth = item.cellFrameInSuperview.width
@ -656,4 +645,4 @@ extension Segmentio.Points {
endPoint = CGPoint(x: endX, y: pointY) endPoint = CGPoint(x: endX, y: pointY)
} }
} }

View File

@ -11,27 +11,41 @@ import UIKit
// MARK: - Item // MARK: - Item
public struct SegmentioItem { public struct SegmentioItem {
var title: String?
var image: UIImage?
public var title: String?
public var image: UIImage?
public var badgeCount: Int?
public var badgeColor: UIColor?
public init(title: String?, image: UIImage?) { public init(title: String?, image: UIImage?) {
self.title = title self.title = title
self.image = image self.image = image
} }
public mutating func addBadge(_ count: Int, color: UIColor) {
self.badgeCount = count
self.badgeColor = color
}
public mutating func removeBadge() {
self.badgeCount = nil
self.badgeColor = nil
}
} }
// MARK: - Content view // MARK: - Content view
public struct SegmentioState { public struct SegmentioState {
var backgroundColor: UIColor var backgroundColor: UIColor
var titleFont: UIFont var titleFont: UIFont
var titleTextColor: UIColor var titleTextColor: UIColor
public init( public init(
backgroundColor: UIColor = UIColor.clearColor(), backgroundColor: UIColor = .clear,
titleFont: UIFont = UIFont.systemFontOfSize(UIFont.smallSystemFontSize()), titleFont: UIFont = UIFont.systemFont(ofSize: UIFont.smallSystemFontSize),
titleTextColor: UIColor = UIColor.blackColor()) { titleTextColor: UIColor = .black) {
self.backgroundColor = backgroundColor self.backgroundColor = backgroundColor
self.titleFont = titleFont self.titleFont = titleFont
self.titleTextColor = titleTextColor self.titleTextColor = titleTextColor
@ -42,18 +56,20 @@ public struct SegmentioState {
// MARK: - Horizontal separator // MARK: - Horizontal separator
public enum SegmentioHorizontalSeparatorType { public enum SegmentioHorizontalSeparatorType {
case Top, Bottom, TopAndBottom
case top
case bottom
case topAndBottom
} }
public struct SegmentioHorizontalSeparatorOptions { public struct SegmentioHorizontalSeparatorOptions {
var type: SegmentioHorizontalSeparatorType var type: SegmentioHorizontalSeparatorType
var height: CGFloat var height: CGFloat
var color: UIColor var color: UIColor
public init( public init(type: SegmentioHorizontalSeparatorType = .topAndBottom, height: CGFloat = 1.0, color: UIColor = .darkGray) {
type: SegmentioHorizontalSeparatorType = .TopAndBottom,
height: CGFloat = 1.0,
color: UIColor = UIColor.darkGrayColor()) {
self.type = type self.type = type
self.height = height self.height = height
self.color = color self.color = color
@ -64,10 +80,11 @@ public struct SegmentioHorizontalSeparatorOptions {
// MARK: - Vertical separator // MARK: - Vertical separator
public struct SegmentioVerticalSeparatorOptions { public struct SegmentioVerticalSeparatorOptions {
var ratio: CGFloat var ratio: CGFloat
var color: UIColor var color: UIColor
public init(ratio: CGFloat = 1.0, color: UIColor = UIColor.darkGrayColor()) { public init(ratio: CGFloat = 1, color: UIColor = .darkGray) {
self.ratio = ratio self.ratio = ratio
self.color = color self.color = color
} }
@ -77,20 +94,20 @@ public struct SegmentioVerticalSeparatorOptions {
// MARK: - Indicator // MARK: - Indicator
public enum SegmentioIndicatorType { public enum SegmentioIndicatorType {
case Top, Bottom
case top
case bottom
} }
public struct SegmentioIndicatorOptions { public struct SegmentioIndicatorOptions {
var type: SegmentioIndicatorType var type: SegmentioIndicatorType
var ratio: CGFloat var ratio: CGFloat
var height: CGFloat var height: CGFloat
var color: UIColor var color: UIColor
public init( public init(type: SegmentioIndicatorType = .bottom, ratio: CGFloat = 1, height: CGFloat = 2, color: UIColor = .orange) {
type: SegmentioIndicatorType = .Bottom,
ratio: CGFloat = 1.0,
height: CGFloat = 2.0,
color: UIColor = UIColor.orangeColor()) {
self.type = type self.type = type
self.ratio = ratio self.ratio = ratio
self.height = height self.height = height
@ -102,20 +119,21 @@ public struct SegmentioIndicatorOptions {
// MARK: - Control options // MARK: - Control options
public enum SegmentioStyle: String { public enum SegmentioStyle: String {
case OnlyLabel, OnlyImage, ImageOverLabel, ImageUnderLabel, ImageBeforeLabel, ImageAfterLabel
case onlyLabel, onlyImage, imageOverLabel, imageUnderLabel, imageBeforeLabel, imageAfterLabel
public static let allStyles = [ public static let allStyles = [
OnlyLabel, onlyLabel,
OnlyImage, onlyImage,
ImageOverLabel, imageOverLabel,
ImageUnderLabel, imageUnderLabel,
ImageBeforeLabel, imageBeforeLabel,
ImageAfterLabel imageAfterLabel
] ]
public func isWithText() -> Bool { public func isWithText() -> Bool {
switch self { switch self {
case .OnlyLabel, .ImageOverLabel, .ImageUnderLabel, .ImageBeforeLabel, .ImageAfterLabel: case .onlyLabel, .imageOverLabel, .imageUnderLabel, .imageBeforeLabel, .imageAfterLabel:
return true return true
default: default:
return false return false
@ -124,7 +142,7 @@ public enum SegmentioStyle: String {
public func isWithImage() -> Bool { public func isWithImage() -> Bool {
switch self { switch self {
case .ImageOverLabel, .ImageUnderLabel, .ImageBeforeLabel, .ImageAfterLabel, .OnlyImage: case .imageOverLabel, .imageUnderLabel, .imageBeforeLabel, .imageAfterLabel, .onlyImage:
return true return true
default: default:
return false return false
@ -135,6 +153,7 @@ public enum SegmentioStyle: String {
public typealias SegmentioStates = (defaultState: SegmentioState, selectedState: SegmentioState, highlightedState: SegmentioState) public typealias SegmentioStates = (defaultState: SegmentioState, selectedState: SegmentioState, highlightedState: SegmentioState)
public struct SegmentioOptions { public struct SegmentioOptions {
var backgroundColor: UIColor var backgroundColor: UIColor
var maxVisibleItems: Int var maxVisibleItems: Int
var scrollEnabled: Bool var scrollEnabled: Bool
@ -143,10 +162,12 @@ public struct SegmentioOptions {
var indicatorOptions: SegmentioIndicatorOptions? var indicatorOptions: SegmentioIndicatorOptions?
var imageContentMode: UIViewContentMode var imageContentMode: UIViewContentMode
var labelTextAlignment: NSTextAlignment var labelTextAlignment: NSTextAlignment
var labelTextNumberOfLines: Int
var states: SegmentioStates var states: SegmentioStates
var animationDuration: CFTimeInterval
public init() { public init() {
self.backgroundColor = UIColor.lightGrayColor() self.backgroundColor = .lightGray
self.maxVisibleItems = 4 self.maxVisibleItems = 4
self.scrollEnabled = true self.scrollEnabled = true
@ -155,17 +176,19 @@ public struct SegmentioOptions {
self.indicatorOptions = SegmentioIndicatorOptions() self.indicatorOptions = SegmentioIndicatorOptions()
self.imageContentMode = .Center self.imageContentMode = .center
self.labelTextAlignment = .Center self.labelTextAlignment = .center
self.labelTextNumberOfLines = 0
self.states = SegmentioStates( self.states = SegmentioStates(
defaultState: SegmentioState(), defaultState: SegmentioState(),
selectedState: SegmentioState(), selectedState: SegmentioState(),
highlightedState: SegmentioState() highlightedState: SegmentioState()
) )
self.animationDuration = 0.1
} }
public init(backgroundColor: UIColor, maxVisibleItems: Int, scrollEnabled: Bool, indicatorOptions: SegmentioIndicatorOptions?, horizontalSeparatorOptions: SegmentioHorizontalSeparatorOptions?, verticalSeparatorOptions: SegmentioVerticalSeparatorOptions?, imageContentMode: UIViewContentMode, labelTextAlignment: NSTextAlignment, segmentStates: SegmentioStates) { public init(backgroundColor: UIColor, maxVisibleItems: Int, scrollEnabled: Bool, indicatorOptions: SegmentioIndicatorOptions?, horizontalSeparatorOptions: SegmentioHorizontalSeparatorOptions?, verticalSeparatorOptions: SegmentioVerticalSeparatorOptions?, imageContentMode: UIViewContentMode, labelTextAlignment: NSTextAlignment, labelTextNumberOfLines: Int, segmentStates: SegmentioStates, animationDuration: CFTimeInterval) {
self.backgroundColor = backgroundColor self.backgroundColor = backgroundColor
self.maxVisibleItems = maxVisibleItems self.maxVisibleItems = maxVisibleItems
self.scrollEnabled = scrollEnabled self.scrollEnabled = scrollEnabled
@ -174,7 +197,9 @@ public struct SegmentioOptions {
self.verticalSeparatorOptions = verticalSeparatorOptions self.verticalSeparatorOptions = verticalSeparatorOptions
self.imageContentMode = imageContentMode self.imageContentMode = imageContentMode
self.labelTextAlignment = labelTextAlignment self.labelTextAlignment = labelTextAlignment
self.labelTextNumberOfLines = labelTextNumberOfLines
self.states = segmentStates self.states = segmentStates
self.animationDuration = animationDuration
} }
} }