Compare commits

..

No commits in common. "master" and "1.0" have entirely different histories.
master ... 1.0

60 changed files with 1385 additions and 1794 deletions

View File

@ -1,43 +0,0 @@
# 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.

View File

@ -1 +0,0 @@
3.0

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -35,8 +35,6 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.</string>
<key>License</key>
<string>MIT</string>
<key>Title</key>
<string>Segmentio</string>
<key>Type</key>

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,29 @@
<?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

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

View File

@ -0,0 +1,84 @@
#!/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

@ -0,0 +1,102 @@
#!/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

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

View File

@ -0,0 +1,7 @@
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

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

View File

@ -0,0 +1,7 @@
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>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.1.3</string>
<string>0.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>

View File

@ -24,7 +24,6 @@
327AF5EA1D1ABEC100534355 /* HomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 327AF5CB1D1ABEC100534355 /* HomeViewController.swift */; };
327AF5EB1D1ABEC100534355 /* SideMenuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 327AF5CC1D1ABEC100534355 /* SideMenuViewController.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 */; };
/* End PBXBuildFile section */
@ -50,7 +49,6 @@
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>"; };
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>"; };
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>"; };
@ -138,14 +136,6 @@
path = ViewControllers;
sourceTree = "<group>";
};
32C3706A1DD9C4EC001A39CB /* Builders */ = {
isa = PBXGroup;
children = (
32C3706B1DD9C4FA001A39CB /* SegmentioBuilder.swift */,
);
path = Builders;
sourceTree = "<group>";
};
45CA913E13914443DB2552B6 /* Pods */ = {
isa = PBXGroup;
children = (
@ -179,7 +169,6 @@
607FACD21AFB9204008FA782 /* Example for Segmentio */ = {
isa = PBXGroup;
children = (
32C3706A1DD9C4EC001A39CB /* Builders */,
327AF5A71D1ABEC100534355 /* Application */,
327AF5A91D1ABEC100534355 /* Extensions */,
327AF5AD1D1ABEC100534355 /* Helpers */,
@ -250,12 +239,11 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0810;
LastUpgradeCheck = 0720;
ORGANIZATIONNAME = CocoaPods;
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
LastSwiftMigration = 0800;
};
};
};
@ -333,7 +321,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
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";
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";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
@ -348,7 +336,6 @@
327AF5CF1D1ABEC100534355 /* AppDelegate.swift in Sources */,
327AF5EB1D1ABEC100534355 /* SideMenuViewController.swift in Sources */,
327AF5E81D1ABEC100534355 /* EmbedContainerViewController.swift in Sources */,
32C3706C1DD9C4FA001A39CB /* SegmentioBuilder.swift in Sources */,
327AF5D41D1ABEC100534355 /* Disaster.swift in Sources */,
327AF5D31D1ABEC100534355 /* AppearanceConfigurator.swift in Sources */,
327AF5EA1D1ABEC100534355 /* HomeViewController.swift in Sources */,
@ -377,10 +364,8 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@ -403,7 +388,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@ -424,10 +409,8 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@ -443,10 +426,9 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
VALIDATE_PRODUCT = YES;
};
name = Release;
@ -455,7 +437,6 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 031FB43EDAB25B02B2FB7406 /* Pods-Segmentio_Example.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "";
FRAMEWORK_SEARCH_PATHS = (
@ -469,7 +450,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
@ -478,7 +458,6 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 1667ACAF5594F75E244C8E1B /* Pods-Segmentio_Example.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
@ -493,7 +472,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -7,35 +7,35 @@
//
struct Hints {
static let tornado = [
static let Tornado = [
"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.",
"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."
]
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.",
"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.",
"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.",
"2. Install window air conditioners snugly; insulate if necessary.",
"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."
]
static let eruption = [
static let Eruption = [
"1. Know your community's warning system.",
"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.",
"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.",
"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.",
@ -43,11 +43,11 @@ struct Hints {
"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.",
"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.",
"4. Dont panic."
]
}
}

View File

@ -1,12 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--View Controller-->
@ -18,21 +14,21 @@
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<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">
<rect key="frame" x="157.5" y="288.5" width="60" height="90"/>
<rect key="frame" x="270" y="255" width="60" height="90"/>
<constraints>
<constraint firstAttribute="width" constant="60" id="15m-sK-BMc"/>
<constraint firstAttribute="height" constant="90" id="pHT-4Q-Z9L"/>
</constraints>
<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="custom" customColorSpace="sRGB"/>
<color key="textColor" red="0.95294117647058818" green="0.40000000000000002" blue="0.33333333333333331" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="0.96078431372549022" green="0.96078431372549022" blue="0.96078431372549022" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" red="0.96078431372549022" green="0.96078431372549022" blue="0.96078431372549022" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<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"/>
@ -41,7 +37,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-36" y="268"/>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>

View File

@ -1,12 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--Disaster's guide-->
@ -18,17 +14,17 @@
<viewControllerLayoutGuide type="bottom" id="Cxz-xC-i78"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="6th-V5-ZMU">
<rect key="frame" x="0.0" y="64" width="375" height="603"/>
<rect key="frame" x="0.0" y="64" width="600" height="536"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="j4J-17-RS0">
<rect key="frame" x="0.0" y="0.0" width="375" height="603"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="536"/>
<connections>
<segue destination="nnH-xc-bez" kind="embed" identifier="EmbedContainerViewController" id="39a-pg-Pje"/>
</connections>
</containerView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<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"/>
@ -58,46 +54,46 @@
<viewControllerLayoutGuide type="bottom" id="d6b-iV-EUm"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="aho-PV-db8" userLabel="Content View">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<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="325" height="620"/>
<rect key="frame" x="25" y="24" width="550" height="553"/>
<constraints>
<constraint firstAttribute="height" priority="900" constant="553" id="ffK-Ju-lZo"/>
</constraints>
</imageView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="pyy-sw-hGC" userLabel="Separator">
<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="custom" customColorSpace="sRGB"/>
<rect key="frame" x="32" y="101" width="536" height="1"/>
<color key="backgroundColor" red="0.96078431372549022" green="0.96078431372549022" blue="0.96078431372549022" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="89l-q6-tQe"/>
</constraints>
</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">
<rect key="frame" x="32" y="75" width="311" height="19"/>
<rect key="frame" x="32" y="75" width="536" height="19"/>
<constraints>
<constraint firstAttribute="height" constant="19" id="x6o-JU-9JP"/>
</constraints>
<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="custom" customColorSpace="sRGB"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<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="311" height="467"/>
<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="custom" customColorSpace="sRGB"/>
<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">
<rect key="frame" x="32" y="160" width="536" height="400"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<color key="separatorColor" red="0.96078431606292725" green="0.96078431606292725" blue="0.96078431606292725" alpha="1" colorSpace="calibratedRGB"/>
<inset key="separatorInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
<prototypes>
<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="311" height="44"/>
<rect key="frame" x="0.0" y="28" width="536" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<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="311" height="44"/>
<rect key="frame" x="0.0" y="0.0" width="536" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<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">
<rect key="frame" x="25" y="10" width="261" height="24"/>
<rect key="frame" x="25" y="10" width="486" height="24"/>
<fontDescription key="fontDescription" name="Avenir-Light" family="Avenir" pointSize="13"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
@ -122,14 +118,14 @@
</connections>
</tableView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="oval" translatesAutoresizingMaskIntoConstraints="NO" id="t46-Uj-4Ci">
<rect key="frame" x="178.5" y="122" width="18" height="18"/>
<rect key="frame" x="291" y="122" width="18" height="18"/>
<constraints>
<constraint firstAttribute="height" constant="18" id="Gki-L9-gmb"/>
<constraint firstAttribute="width" constant="18" id="HcY-Je-7ti"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" red="0.85490196078431369" green="0.85490196078431369" blue="0.85490196078431369" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" red="0.85490196078431369" green="0.85490196078431369" blue="0.85490196078431369" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<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"/>
@ -169,7 +165,7 @@
<navigationBar key="navigationBar" contentMode="scaleToFill" id="A36-fE-w8g">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<color key="barTintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="barTintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="flat" value="YES"/>
</userDefinedRuntimeAttributes>
@ -192,43 +188,43 @@
<viewControllerLayoutGuide type="bottom" id="Lh0-b2-Lg9"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="3on-2h-KRG">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dwd-YU-7oV" userLabel="Shadow View">
<rect key="frame" x="262" y="0.0" width="113" height="667"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<rect key="frame" x="420" y="0.0" width="180" height="600"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</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">
<rect key="frame" x="0.0" y="0.0" width="262" height="667"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<rect key="frame" x="0.0" y="0.0" width="420" height="600"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="width" constant="262" id="1Fe-0J-akh"/>
<constraint firstAttribute="width" constant="420" id="1Fe-0J-akh"/>
</constraints>
<color key="separatorColor" red="0.96078431369999995" green="0.96078431369999995" blue="0.96078431369999995" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="separatorColor" red="0.96078431369999995" green="0.96078431369999995" blue="0.96078431369999995" alpha="1" colorSpace="calibratedRGB"/>
<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">
<rect key="frame" x="0.0" y="0.0" width="262" height="66"/>
<rect key="frame" x="0.0" y="0.0" width="420" height="66"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="IOF-iR-GOe" userLabel="Separator View">
<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="custom" customColorSpace="sRGB"/>
<rect key="frame" x="0.0" y="65" width="420" height="1"/>
<color key="backgroundColor" red="0.95686274509803915" green="0.43529411764705883" blue="0.37647058823529411" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="ipJ-LO-nfb"/>
</constraints>
</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">
<rect key="frame" x="16" y="35" width="230" height="22"/>
<rect key="frame" x="16" y="35" width="388" height="22"/>
<constraints>
<constraint firstAttribute="height" constant="22" id="2GY-JW-I97"/>
</constraints>
<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="custom" customColorSpace="sRGB"/>
<color key="textColor" red="0.95686274510000002" green="0.43529411759999997" blue="0.37647058820000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<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"/>
@ -240,17 +236,17 @@
</view>
<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">
<rect key="frame" x="0.0" y="94" width="262" height="44"/>
<rect key="frame" x="0.0" y="94" width="420" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<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="262" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="420" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<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="205" height="43"/>
<rect key="frame" x="42" y="0.0" width="363" height="43"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<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="custom" customColorSpace="sRGB"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" image="defaultCheckbox" id="f8N-oJ-egW">
@ -268,7 +264,7 @@
</connections>
</tableView>
</subviews>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<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"/>
@ -279,6 +275,8 @@
<constraint firstAttribute="trailing" secondItem="dwd-YU-7oV" secondAttribute="trailing" id="tIN-F6-Jaf"/>
</constraints>
</view>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<size key="freeformSize" width="600" height="600"/>
<connections>
<outlet property="menuTableView" destination="Ufo-LN-tbg" id="MLh-5f-jgM"/>
<outlet property="menuTableViewWidthConstraint" destination="1Fe-0J-akh" id="m5l-sp-fm3"/>
@ -298,27 +296,27 @@
<viewControllerLayoutGuide type="bottom" id="qlN-Ul-M6a"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="cqi-F1-zxi">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Vkr-KO-SOm" customClass="Segmentio" customModule="Segmentio">
<rect key="frame" x="0.0" y="0.0" width="375" height="125"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="125"/>
<constraints>
<constraint firstAttribute="height" constant="125" id="MbU-cC-j02"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aMO-Fm-zcR" userLabel="Container">
<rect key="frame" x="0.0" y="125" width="375" height="542"/>
<rect key="frame" x="0.0" y="125" width="600" height="475"/>
<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">
<rect key="frame" x="0.0" y="0.0" width="375" height="542"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="475"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<connections>
<outlet property="delegate" destination="hoe-Iv-t0i" id="tIm-r4-G4D"/>
</connections>
</scrollView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<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"/>
@ -327,13 +325,13 @@
</constraints>
</view>
<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="375" height="9"/>
<rect key="frame" x="0.0" y="125" width="600" height="9"/>
<constraints>
<constraint firstAttribute="height" constant="9" id="2DA-Ym-fL4"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<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"/>
@ -377,19 +375,19 @@
<viewControllerLayoutGuide type="bottom" id="riu-eD-uzK"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8VE-5b-uC6">
<rect key="frame" x="0.0" y="0.0" width="375" height="603"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="536"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
<extendedEdge key="edgesForExtendedLayout" bottom="YES"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Caz-AG-AcN" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2084" y="287"/>
<point key="canvasLocation" x="2084" y="285"/>
</scene>
</scenes>
<resources>
<image name="cards" width="125" height="53"/>
<image name="cards" width="126" height="54"/>
<image name="defaultCheckbox" width="12" height="12"/>
<image name="menu" width="28" height="14"/>
<image name="oval" width="18" height="18"/>

View File

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

View File

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

View File

@ -11,14 +11,14 @@ import Segmentio
class ExampleViewController: UIViewController {
var segmentioStyle = SegmentioStyle.imageOverLabel
var segmentioStyle = SegmentioStyle.ImageOverLabel
@IBOutlet fileprivate weak var segmentViewHeightConstraint: NSLayoutConstraint!
@IBOutlet fileprivate weak var segmentioView: Segmentio!
@IBOutlet fileprivate weak var containerView: UIView!
@IBOutlet fileprivate weak var scrollView: UIScrollView!
@IBOutlet private weak var segmentViewHeightConstraint: NSLayoutConstraint!
@IBOutlet private weak var segmentioView: Segmentio!
@IBOutlet private weak var containerView: UIView!
@IBOutlet private weak var scrollView: UIScrollView!
fileprivate lazy var viewControllers: [UIViewController] = {
private lazy var viewControllers: [UIViewController] = {
return self.preparedViewControllers()
}()
@ -26,7 +26,7 @@ class ExampleViewController: UIViewController {
class func create() -> ExampleViewController {
let board = UIStoryboard(name: "Main", bundle: nil)
return board.instantiateViewController(withIdentifier: String(describing: self)) as! ExampleViewController
return board.instantiateViewControllerWithIdentifier(String(self)) as! ExampleViewController
}
// MARK: - Lifecycle
@ -35,24 +35,27 @@ class ExampleViewController: UIViewController {
super.viewDidLoad()
switch segmentioStyle {
case .onlyLabel, .imageBeforeLabel, .imageAfterLabel:
case .OnlyLabel, .ImageBeforeLabel, .ImageAfterLabel:
segmentViewHeightConstraint.constant = 50
case .onlyImage:
case .OnlyImage:
segmentViewHeightConstraint.constant = 100
default:
break
}
}
override func viewDidAppear(_ animated: Bool) {
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
setupSegmentioView()
setupScrollView()
SegmentioBuilder.buildSegmentioView(
segmentioView: segmentioView,
segmentioStyle: segmentioStyle
}
private func setupSegmentioView() {
segmentioView.setup(
content: segmentioContent(),
style: segmentioStyle,
options: segmentioOptions()
)
SegmentioBuilder.setupBadgeCountForIndex(segmentioView, index: 1)
segmentioView.selectedSegmentioIndex = selectedSegmentioIndex()
@ -67,44 +70,108 @@ 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
fileprivate func preparedViewControllers() -> [ContentViewController] {
private func preparedViewControllers() -> [ContentViewController] {
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()
earthquakesController.disaster = Disaster(
cardName: "Before earthquakes",
hints: Hints.earthquakes
)
earthquakesController.disaster = Disaster(cardName: "Before earthquakes", hints: Hints.Earthquakes)
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()
eruptionController.disaster = Disaster(
cardName: "Before eruption",
hints: Hints.eruption
)
eruptionController.disaster = Disaster(cardName: "Before eruption", hints: Hints.Eruption)
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()
wildfiresController.disaster = Disaster(
cardName: "Before wildfires",
hints: Hints.wildfires
)
wildfiresController.disaster = Disaster(cardName: "Before wildfires", hints: Hints.Wildfires)
return [
tornadoController,
@ -116,48 +183,49 @@ class ExampleViewController: UIViewController {
]
}
fileprivate func selectedSegmentioIndex() -> Int {
private func selectedSegmentioIndex() -> Int {
return 0
}
// MARK: - Setup container view
fileprivate func setupScrollView() {
private func setupScrollView() {
scrollView.contentSize = CGSize(
width: UIScreen.main.bounds.width * CGFloat(viewControllers.count),
width: UIScreen.mainScreen().bounds.width * CGFloat(viewControllers.count),
height: containerView.frame.height
)
for (index, viewController) in viewControllers.enumerated() {
for (index, viewController) in viewControllers.enumerate() {
viewController.view.frame = CGRect(
x: UIScreen.main.bounds.width * CGFloat(index),
x: UIScreen.mainScreen().bounds.width * CGFloat(index),
y: 0,
width: scrollView.frame.width,
height: scrollView.frame.height
)
addChildViewController(viewController)
scrollView.addSubview(viewController.view, options: .useAutoresize) // module's extension
viewController.didMove(toParentViewController: self)
scrollView.addSubview(viewController.view, options: .UseAutoresize) // module's extension
viewController.didMoveToParentViewController(self)
}
}
// MARK: - Actions
fileprivate func goToControllerAtIndex(_ index: Int) {
private func goToControllerAtIndex(index: Int) {
segmentioView.selectedSegmentioIndex = index
}
}
extension ExampleViewController: UIScrollViewDelegate {
func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
func scrollViewDidEndDecelerating(scrollView: UIScrollView) {
let currentPage = floor(scrollView.contentOffset.x / scrollView.frame.width)
segmentioView.selectedSegmentioIndex = Int(currentPage)
}
func scrollViewDidScroll(_ scrollView: UIScrollView) {
func scrollViewDidScroll(scrollView: UIScrollView) {
scrollView.contentSize = CGSize(width: scrollView.contentSize.width, height: 0)
}
}
}

View File

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

View File

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

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright © 2017 Yalantis
Copyright © 2015 Yalantis
Permission is hereby granted, free of charge, to any person obtaining a copy
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
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE.

101
README.md
View File

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

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "Segmentio"
spec.version = "2.1.2"
spec.version = "1.0"
spec.homepage = "https://github.com/Yalantis/Segmentio"
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.social_media_url = "https://twitter.com/yalantis"
spec.platform = :ios, '8.0'
spec.ios.deployment_target = '8.0'
spec.source = { :git => "https://github.com/Yalantis/Segmentio.git", :tag => spec.version }
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.requires_arc = true
end

View File

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

View File

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

View File

@ -1,92 +0,0 @@
//
// 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

@ -1,47 +0,0 @@
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

@ -1,49 +0,0 @@
<?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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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