├── .travis.yml
├── CocoaChainKit.podspec
├── CocoaChainKit
├── Assets
│ └── .gitkeep
└── Classes
│ ├── .gitkeep
│ ├── Chain.swift
│ ├── ChainCompatible.swift
│ ├── DateFormatter+Chain.swift
│ ├── HasFont+Chain.swift
│ ├── HasFont.swift
│ ├── HasText+Chain.swift
│ ├── HasText.swift
│ ├── NSMutableAttributedString+Chain.swift
│ ├── NotificationCenter+Chain.swift
│ ├── UIActivityIndicatorView+Chain.swift
│ ├── UIBarButtonItem+Chain.swift
│ ├── UIBarItem+Chain.swift
│ ├── UIButton+Chain.swift
│ ├── UICollectionView+Chain.swift
│ ├── UICollectionViewFlowLayout+Chain.swift
│ ├── UIControl+Chain.swift
│ ├── UIDatePicker+Chain.swift
│ ├── UIGestureRecognizer+Chain.swift
│ ├── UIImageView+Chain.swift
│ ├── UILabel+Chain.swift
│ ├── UINavigationBar+Chain.swift
│ ├── UINavigationItem+Chain.swift
│ ├── UIPickerView+Chain.swift
│ ├── UIProgressView+Chain.swift
│ ├── UIResponder+Chain.swift
│ ├── UIScrollView+Chain.swift
│ ├── UISegmentedControl+Chain.swift
│ ├── UISlider+Chain.swift
│ ├── UIStepper+Chain.swift
│ ├── UISwitch+Chain.swift
│ ├── UITableView+Chain.swift
│ ├── UITextField+Chain.swift
│ ├── UITextView+Chain.swift
│ ├── UIView+Chain.swift
│ └── UserDefaults+Chain.swift
├── Example
├── CocoaChainKit.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcuserdata
│ │ └── pircate.xcuserdatad
│ │ └── xcschemes
│ │ └── CocoaChainKit-Example.xcscheme
├── CocoaChainKit.xcworkspace
│ └── contents.xcworkspacedata
├── CocoaChainKit
│ ├── AppDelegate.swift
│ ├── Base.lproj
│ │ ├── LaunchScreen.xib
│ │ └── Main.storyboard
│ ├── Images.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── Info.plist
│ └── ViewController.swift
├── Podfile
├── Podfile.lock
├── Pods
│ ├── Local Podspecs
│ │ └── CocoaChainKit.podspec.json
│ ├── Manifest.lock
│ ├── Pods.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── xcshareddata
│ │ │ └── xcschemes
│ │ │ │ └── CocoaChainKit.xcscheme
│ │ └── xcuserdata
│ │ │ └── pircate.xcuserdatad
│ │ │ └── xcschemes
│ │ │ └── CocoaChainKit.xcscheme
│ └── Target Support Files
│ │ ├── CocoaChainKit
│ │ ├── CocoaChainKit-Info.plist
│ │ ├── CocoaChainKit-dummy.m
│ │ ├── CocoaChainKit-prefix.pch
│ │ ├── CocoaChainKit-umbrella.h
│ │ ├── CocoaChainKit.modulemap
│ │ ├── CocoaChainKit.xcconfig
│ │ └── Info.plist
│ │ ├── Pods-CocoaChainKit_Example
│ │ ├── Info.plist
│ │ ├── Pods-CocoaChainKit_Example-Info.plist
│ │ ├── Pods-CocoaChainKit_Example-acknowledgements.markdown
│ │ ├── Pods-CocoaChainKit_Example-acknowledgements.plist
│ │ ├── Pods-CocoaChainKit_Example-dummy.m
│ │ ├── Pods-CocoaChainKit_Example-frameworks.sh
│ │ ├── Pods-CocoaChainKit_Example-resources.sh
│ │ ├── Pods-CocoaChainKit_Example-umbrella.h
│ │ ├── Pods-CocoaChainKit_Example.debug.xcconfig
│ │ ├── Pods-CocoaChainKit_Example.modulemap
│ │ └── Pods-CocoaChainKit_Example.release.xcconfig
│ │ └── Pods-CocoaChainKit_Tests
│ │ ├── Info.plist
│ │ ├── Pods-CocoaChainKit_Tests-Info.plist
│ │ ├── Pods-CocoaChainKit_Tests-acknowledgements.markdown
│ │ ├── Pods-CocoaChainKit_Tests-acknowledgements.plist
│ │ ├── Pods-CocoaChainKit_Tests-dummy.m
│ │ ├── Pods-CocoaChainKit_Tests-frameworks.sh
│ │ ├── Pods-CocoaChainKit_Tests-resources.sh
│ │ ├── Pods-CocoaChainKit_Tests-umbrella.h
│ │ ├── Pods-CocoaChainKit_Tests.debug.xcconfig
│ │ ├── Pods-CocoaChainKit_Tests.modulemap
│ │ └── Pods-CocoaChainKit_Tests.release.xcconfig
├── Tests
│ ├── Info.plist
│ └── Tests.swift
├── before.png
└── cocoa_chain_kit.png
├── LICENSE
├── README.md
└── _Pods.xcodeproj
/.travis.yml:
--------------------------------------------------------------------------------
1 | # references:
2 | # * https://www.objc.io/issues/6-build-tools/travis-ci/
3 | # * https://github.com/supermarin/xcpretty#usage
4 |
5 | osx_image: xcode9.4.1
6 | language: swift
7 | cache: cocoapods
8 | podfile: Example/Podfile
9 | # before_install:
10 | # - gem install cocoapods # Since Travis is not always on latest version
11 | # - pod install --project-directory=Example
12 | script:
13 | - pod lib lint
14 |
--------------------------------------------------------------------------------
/CocoaChainKit.podspec:
--------------------------------------------------------------------------------
1 |
2 | Pod::Spec.new do |s|
3 | s.name = 'CocoaChainKit'
4 | s.version = '0.7.0'
5 | s.summary = '一款链式调用框架.'
6 | s.homepage = 'https://github.com/Pircate/CocoaChainKit'
7 | s.license = { :type => 'MIT', :file => 'LICENSE' }
8 | s.author = { 'Pircate' => 'gao497868860@163.com' }
9 | s.source = { :git => 'https://github.com/Pircate/CocoaChainKit.git', :tag => s.version.to_s }
10 | s.ios.deployment_target = '9.0'
11 | s.swift_version = '4.2'
12 | s.source_files = 'CocoaChainKit/Classes/**/*'
13 | s.frameworks = 'UIKit'
14 | end
15 |
--------------------------------------------------------------------------------
/CocoaChainKit/Assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pircate/CocoaChainKit/65a6ceada4429ef166df2fdec18ffd4a1eeef628/CocoaChainKit/Assets/.gitkeep
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pircate/CocoaChainKit/65a6ceada4429ef166df2fdec18ffd4a1eeef628/CocoaChainKit/Classes/.gitkeep
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/8.
6 | //
7 |
8 | public struct Chain {
9 |
10 | public let base: Base
11 |
12 | public var build: Base {
13 | return base
14 | }
15 |
16 | public init(_ base: Base) {
17 | self.base = base
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/ChainCompatible.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ChainCompatible.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/8.
6 | //
7 |
8 | public protocol ChainCompatible {
9 |
10 | associatedtype CompatibleType
11 |
12 | var chain: CompatibleType { get }
13 | }
14 |
15 | public extension ChainCompatible {
16 |
17 | var chain: Chain {
18 | return Chain(self)
19 | }
20 | }
21 |
22 | extension NSObject: ChainCompatible {}
23 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/DateFormatter+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DateFormatter+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/9.
6 | //
7 |
8 | public extension Chain where Base: DateFormatter {
9 |
10 | @discardableResult
11 | func dateFormat(_ dateFormat: String) -> Chain {
12 | base.dateFormat = dateFormat
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func dateStyle(_ dateStyle: DateFormatter.Style) -> Chain {
18 | base.dateStyle = dateStyle
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func timeStyle(_ timeStyle: DateFormatter.Style) -> Chain {
24 | base.timeStyle = timeStyle
25 | return self
26 | }
27 |
28 | @discardableResult
29 | func locale(_ locale: Locale) -> Chain {
30 | base.locale = locale
31 | return self
32 | }
33 |
34 | @discardableResult
35 | func generatesCalendarDates(_ generatesCalendarDates: Bool) -> Chain {
36 | base.generatesCalendarDates = generatesCalendarDates
37 | return self
38 | }
39 |
40 | @discardableResult
41 | func formatterBehavior(_ formatterBehavior: DateFormatter.Behavior) -> Chain {
42 | base.formatterBehavior = formatterBehavior
43 | return self
44 | }
45 |
46 | @discardableResult
47 | func timeZone(_ timeZone: TimeZone) -> Chain {
48 | base.timeZone = timeZone
49 | return self
50 | }
51 |
52 | @discardableResult
53 | func calendar(_ calendar: Calendar) -> Chain {
54 | base.calendar = calendar
55 | return self
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/HasFont+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // HasFont+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/6/28.
6 | //
7 |
8 | public extension Chain where Base: HasFont {
9 |
10 | @discardableResult
11 | func font(_ font: UIFont) -> Chain {
12 | base.set(font: font)
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func systemFont(ofSize fontSize: CGFloat) -> Chain {
18 | base.set(font: UIFont.systemFont(ofSize: fontSize))
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func boldSystemFont(ofSize fontSize: CGFloat) -> Chain {
24 | base.set(font: UIFont.boldSystemFont(ofSize: fontSize))
25 | return self
26 | }
27 |
28 | @discardableResult
29 | func systemFont(ofSize fontSize: CGFloat, weight: UIFont.Weight) -> Chain {
30 | base.set(font: UIFont.systemFont(ofSize: fontSize, weight: weight))
31 | return self
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/HasFont.swift:
--------------------------------------------------------------------------------
1 | //
2 | // HasFont.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/6/28.
6 | //
7 |
8 | public protocol HasFont {
9 |
10 | func set(font: UIFont)
11 | }
12 |
13 | extension UILabel: HasFont {
14 |
15 | public func set(font: UIFont) {
16 | self.font = font
17 | }
18 | }
19 |
20 | extension UIButton: HasFont {
21 |
22 | public func set(font: UIFont) {
23 | self.titleLabel?.font = font
24 | }
25 | }
26 |
27 | extension UITextField: HasFont {
28 |
29 | public func set(font: UIFont) {
30 | self.font = font
31 | }
32 | }
33 |
34 | extension UITextView: HasFont {
35 |
36 | public func set(font: UIFont) {
37 | self.font = font
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/HasText+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // HasText.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/8/7.
6 | //
7 |
8 | public extension Chain where Base: HasText {
9 |
10 | @discardableResult
11 | func text(_ text: String?) -> Chain {
12 | base.set(text: text)
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func attributedText(_ attributedText: NSAttributedString?) -> Chain {
18 | base.set(attributedText: attributedText)
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func textColor(_ textColor: UIColor) -> Chain {
24 | base.set(color: textColor)
25 | return self
26 | }
27 |
28 | @discardableResult
29 | func textAlignment(_ textAlignment: NSTextAlignment) -> Chain {
30 | base.set(alignment: textAlignment)
31 | return self
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/HasText.swift:
--------------------------------------------------------------------------------
1 | //
2 | // HasText.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/8/7.
6 | //
7 |
8 | public protocol HasText {
9 |
10 | func set(text: String?)
11 |
12 | func set(attributedText: NSAttributedString?)
13 |
14 | func set(color: UIColor)
15 |
16 | func set(alignment: NSTextAlignment)
17 | }
18 |
19 | extension UILabel: HasText {
20 |
21 | public func set(text: String?) {
22 | self.text = text
23 | }
24 |
25 | public func set(attributedText: NSAttributedString?) {
26 | self.attributedText = attributedText
27 | }
28 |
29 | public func set(color: UIColor) {
30 | self.textColor = color
31 | }
32 |
33 | public func set(alignment: NSTextAlignment) {
34 | self.textAlignment = alignment
35 | }
36 | }
37 |
38 | extension UITextField: HasText {
39 |
40 | public func set(text: String?) {
41 | self.text = text
42 | }
43 |
44 | public func set(attributedText: NSAttributedString?) {
45 | self.attributedText = attributedText
46 | }
47 |
48 | public func set(color: UIColor) {
49 | self.textColor = color
50 | }
51 |
52 | public func set(alignment: NSTextAlignment) {
53 | self.textAlignment = alignment
54 | }
55 | }
56 |
57 | extension UITextView: HasText {
58 |
59 | public func set(text: String?) {
60 | self.text = text
61 | }
62 |
63 | public func set(attributedText: NSAttributedString?) {
64 | self.attributedText = attributedText
65 | }
66 |
67 | public func set(color: UIColor) {
68 | self.textColor = color
69 | }
70 |
71 | public func set(alignment: NSTextAlignment) {
72 | self.textAlignment = alignment
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/NSMutableAttributedString+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // NSMutableAttributedString+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/9.
6 | //
7 |
8 | public extension Chain where Base: NSMutableAttributedString {
9 |
10 | @discardableResult
11 | func addAttribute(_ name: NSAttributedString.Key, value: Any, range: NSRange) -> Chain {
12 | base.addAttribute(name, value: value, range: range)
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func addAttributes(_ attrs: [NSAttributedString.Key : Any] = [:], range: NSRange) -> Chain {
18 | base.addAttributes(attrs, range: range)
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func removeAttribute(_ name: NSAttributedString.Key, range: NSRange) -> Chain {
24 | base.removeAttribute(name, range: range)
25 | return self
26 | }
27 |
28 | @discardableResult
29 | func font(_ font: UIFont, range: NSRange? = nil) -> Chain {
30 | guard let range = range else {
31 | base.addAttribute(.font, value: font, range: NSMakeRange(0, base.length))
32 | return self
33 | }
34 | base.addAttribute(.font, value: font, range: range)
35 | return self
36 | }
37 |
38 | @discardableResult
39 | func systemFont(ofSize fontSize: CGFloat, range: NSRange? = nil) -> Chain {
40 | guard let range = range else {
41 | base.addAttribute(.font, value: UIFont.systemFont(ofSize: fontSize), range: NSMakeRange(0, base.length))
42 | return self
43 | }
44 | base.addAttribute(.font, value: UIFont.systemFont(ofSize: fontSize), range: range)
45 | return self
46 | }
47 |
48 | @discardableResult
49 | func boldSystemFont(ofSize fontSize: CGFloat, range: NSRange? = nil) -> Chain {
50 | guard let range = range else {
51 | base.addAttribute(.font, value: UIFont.boldSystemFont(ofSize: fontSize), range: NSMakeRange(0, base.length))
52 | return self
53 | }
54 | base.addAttribute(.font, value: UIFont.boldSystemFont(ofSize: fontSize), range: range)
55 | return self
56 | }
57 |
58 | @discardableResult
59 | func paragraphStyle(_ paragraphStyle: NSParagraphStyle, range: NSRange? = nil) -> Chain {
60 | guard let range = range else {
61 | base.addAttribute(.paragraphStyle, value: paragraphStyle, range: NSMakeRange(0, base.length))
62 | return self
63 | }
64 | base.addAttribute(.paragraphStyle, value: paragraphStyle, range: range)
65 | return self
66 | }
67 |
68 | @discardableResult
69 | func foregroundColor(_ foregroundColor: UIColor, range: NSRange? = nil) -> Chain {
70 | guard let range = range else {
71 | base.addAttribute(.foregroundColor, value: foregroundColor, range: NSMakeRange(0, base.length))
72 | return self
73 | }
74 | base.addAttribute(.foregroundColor, value: foregroundColor, range: range)
75 | return self
76 | }
77 |
78 | @discardableResult
79 | func backgroundColor(_ backgroundColor: UIColor, range: NSRange? = nil) -> Chain {
80 | guard let range = range else {
81 | base.addAttribute(.backgroundColor, value: backgroundColor, range: NSMakeRange(0, base.length))
82 | return self
83 | }
84 | base.addAttribute(.backgroundColor, value: backgroundColor, range: range)
85 | return self
86 | }
87 |
88 | @discardableResult
89 | func ligature(_ ligature: Int, range: NSRange? = nil) -> Chain {
90 | guard let range = range else {
91 | base.addAttribute(.ligature, value: ligature, range: NSMakeRange(0, base.length))
92 | return self
93 | }
94 | base.addAttribute(.ligature, value: ligature, range: range)
95 | return self
96 | }
97 |
98 | @discardableResult
99 | func kern(_ kern: CGFloat, range: NSRange? = nil) -> Chain {
100 | guard let range = range else {
101 | base.addAttribute(.kern, value: kern, range: NSMakeRange(0, base.length))
102 | return self
103 | }
104 | base.addAttribute(.kern, value: kern, range: range)
105 | return self
106 | }
107 |
108 | @discardableResult
109 | func strikethroughStyle(_ strikethroughStyle: Int, range: NSRange? = nil) -> Chain {
110 | guard let range = range else {
111 | base.addAttribute(.strikethroughStyle, value: strikethroughStyle, range: NSMakeRange(0, base.length))
112 | return self
113 | }
114 | base.addAttribute(.strikethroughStyle, value: strikethroughStyle, range: range)
115 | return self
116 | }
117 |
118 | @discardableResult
119 | func underlineStyle(_ underlineStyle: Int, range: NSRange? = nil) -> Chain {
120 | guard let range = range else {
121 | base.addAttribute(.underlineStyle, value: underlineStyle, range: NSMakeRange(0, base.length))
122 | return self
123 | }
124 | base.addAttribute(.underlineStyle, value: underlineStyle, range: range)
125 | return self
126 | }
127 |
128 | @discardableResult
129 | func strokeColor(_ strokeColor: UIColor, range: NSRange? = nil) -> Chain {
130 | guard let range = range else {
131 | base.addAttribute(.strokeColor, value: strokeColor, range: NSMakeRange(0, base.length))
132 | return self
133 | }
134 | base.addAttribute(.strokeColor, value: strokeColor, range: range)
135 | return self
136 | }
137 |
138 | @discardableResult
139 | func strokeWidth(_ strokeWidth: CGFloat, range: NSRange? = nil) -> Chain {
140 | guard let range = range else {
141 | base.addAttribute(.strokeWidth, value: strokeWidth, range: NSMakeRange(0, base.length))
142 | return self
143 | }
144 | base.addAttribute(.strokeWidth, value: strokeWidth, range: range)
145 | return self
146 | }
147 |
148 | @discardableResult
149 | func shadow(_ shadow: NSShadow, range: NSRange? = nil) -> Chain {
150 | guard let range = range else {
151 | base.addAttribute(.shadow, value: shadow, range: NSMakeRange(0, base.length))
152 | return self
153 | }
154 | base.addAttribute(.shadow, value: shadow, range: range)
155 | return self
156 | }
157 |
158 | @discardableResult
159 | func textEffect(_ textEffect: String, range: NSRange? = nil) -> Chain {
160 | guard let range = range else {
161 | base.addAttribute(.textEffect, value: textEffect, range: NSMakeRange(0, base.length))
162 | return self
163 | }
164 | base.addAttribute(.textEffect, value: textEffect, range: range)
165 | return self
166 | }
167 |
168 | @discardableResult
169 | func attachment(_ attachment: NSTextAttachment, range: NSRange? = nil) -> Chain {
170 | guard let range = range else {
171 | base.addAttribute(.attachment, value: attachment, range: NSMakeRange(0, base.length))
172 | return self
173 | }
174 | base.addAttribute(.attachment, value: attachment, range: range)
175 | return self
176 | }
177 |
178 | @discardableResult
179 | func link(_ link: URL, range: NSRange? = nil) -> Chain {
180 | guard let range = range else {
181 | base.addAttribute(.link, value: link, range: NSMakeRange(0, base.length))
182 | return self
183 | }
184 | base.addAttribute(.link, value: link, range: range)
185 | return self
186 | }
187 |
188 | @discardableResult
189 | func baselineOffset(_ baselineOffset: CGFloat, range: NSRange? = nil) -> Chain {
190 | guard let range = range else {
191 | base.addAttribute(.baselineOffset, value: baselineOffset, range: NSMakeRange(0, base.length))
192 | return self
193 | }
194 | base.addAttribute(.baselineOffset, value: baselineOffset, range: range)
195 | return self
196 | }
197 |
198 | @discardableResult
199 | func underlineColor(_ underlineColor: UIColor, range: NSRange? = nil) -> Chain {
200 | guard let range = range else {
201 | base.addAttribute(.underlineColor, value: underlineColor, range: NSMakeRange(0, base.length))
202 | return self
203 | }
204 | base.addAttribute(.underlineColor, value: underlineColor, range: range)
205 | return self
206 | }
207 |
208 | @discardableResult
209 | func strikethroughColor(_ strikethroughColor: UIColor, range: NSRange? = nil) -> Chain {
210 | guard let range = range else {
211 | base.addAttribute(.strikethroughColor, value: strikethroughColor, range: NSMakeRange(0, base.length))
212 | return self
213 | }
214 | base.addAttribute(.strikethroughColor, value: strikethroughColor, range: range)
215 | return self
216 | }
217 |
218 | @discardableResult
219 | func obliqueness(_ obliqueness: CGFloat, range: NSRange? = nil) -> Chain {
220 | guard let range = range else {
221 | base.addAttribute(.obliqueness, value: obliqueness, range: NSMakeRange(0, base.length))
222 | return self
223 | }
224 | base.addAttribute(.obliqueness, value: obliqueness, range: range)
225 | return self
226 | }
227 |
228 | @discardableResult
229 | func expansion(_ expansion: CGFloat, range: NSRange? = nil) -> Chain {
230 | guard let range = range else {
231 | base.addAttribute(.expansion, value: expansion, range: NSMakeRange(0, base.length))
232 | return self
233 | }
234 | base.addAttribute(.expansion, value: expansion, range: range)
235 | return self
236 | }
237 |
238 | @discardableResult
239 | func writingDirection(_ writingDirection: [Int], range: NSRange? = nil) -> Chain {
240 | guard let range = range else {
241 | base.addAttribute(.writingDirection, value: writingDirection, range: NSMakeRange(0, base.length))
242 | return self
243 | }
244 | base.addAttribute(.writingDirection, value: writingDirection, range: range)
245 | return self
246 | }
247 |
248 | @discardableResult
249 | func verticalGlyphForm(_ verticalGlyphForm: Int, range: NSRange? = nil) -> Chain {
250 | guard let range = range else {
251 | base.addAttribute(.verticalGlyphForm, value: verticalGlyphForm, range: NSMakeRange(0, base.length))
252 | return self
253 | }
254 | base.addAttribute(.verticalGlyphForm, value: verticalGlyphForm, range: range)
255 | return self
256 | }
257 | }
258 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/NotificationCenter+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // NotificationCenter+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/9.
6 | //
7 |
8 | public extension Chain where Base: NotificationCenter {
9 |
10 | @discardableResult
11 | func addObserver(_ observer: Any,
12 | selector aSelector: Selector,
13 | name aName: NSNotification.Name?,
14 | object anObject: Any? = nil) -> Chain {
15 | base.addObserver(observer, selector: aSelector, name: aName, object: anObject)
16 | return self
17 | }
18 |
19 | @discardableResult
20 | func post(_ notification: Notification) -> Chain {
21 | base.post(notification)
22 | return self
23 | }
24 |
25 | @discardableResult
26 | func post(name aName: NSNotification.Name,
27 | object anObject: Any? = nil,
28 | userInfo aUserInfo: [AnyHashable : Any]? = nil) -> Chain {
29 | base.post(name: aName, object: anObject, userInfo: aUserInfo)
30 | return self
31 | }
32 |
33 | @discardableResult
34 | func removeObserver(_ observer: Any,
35 | name aName: NSNotification.Name?,
36 | object anObject: Any?) -> Chain {
37 | base.removeObserver(observer, name: aName, object: anObject)
38 | return self
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UIActivityIndicatorView+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIActivityIndicatorView+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/8.
6 | //
7 |
8 | public extension Chain where Base: UIActivityIndicatorView {
9 |
10 | @discardableResult
11 | func activityIndicatorViewStyle(_ activityIndicatorViewStyle: UIActivityIndicatorView.Style) -> Chain {
12 | #if swift(>=4.2)
13 | base.style = activityIndicatorViewStyle
14 | #else
15 | base.activityIndicatorViewStyle = activityIndicatorViewStyle
16 | #endif
17 | return self
18 | }
19 |
20 | @discardableResult
21 | func hidesWhenStopped(_ hidesWhenStopped: Bool) -> Chain {
22 | base.hidesWhenStopped = hidesWhenStopped
23 | return self
24 | }
25 |
26 | @discardableResult
27 | func color(_ color: UIColor?) -> Chain {
28 | base.color = color
29 | return self
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UIBarButtonItem+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIBarButtonItem+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/8.
6 | //
7 |
8 | public extension Chain where Base: UIBarButtonItem {
9 |
10 | @discardableResult
11 | func width(_ width: CGFloat) -> Chain {
12 | base.width = width
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func tintColor(_ tintColor: UIColor?) -> Chain {
18 | base.tintColor = tintColor
19 | return self
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UIBarItem+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIBarItem+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/8.
6 | //
7 |
8 | public extension Chain where Base: UIBarItem {
9 |
10 | @discardableResult
11 | func isEnabled(_ isEnabled: Bool) -> Chain {
12 | base.isEnabled = isEnabled
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func titleTextAttributes(_ titleTextAttributes: [NSAttributedString.Key: Any]?,
18 | for state: UIControl.State...) -> Chain {
19 | state.forEach { base.setTitleTextAttributes(titleTextAttributes, for: $0) }
20 | return self
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UIButton+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIButton+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/8.
6 | //
7 |
8 | public extension Chain where Base: UIButton {
9 |
10 | @discardableResult
11 | func title(_ title: String?, for state: UIControl.State...) -> Chain {
12 | state.forEach { base.setTitle(title, for: $0) }
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func titleColor(_ color: UIColor?, for state: UIControl.State...) -> Chain {
18 | state.forEach { base.setTitleColor(color, for: $0) }
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func image(_ image: UIImage?, for state: UIControl.State...) -> Chain {
24 | state.forEach { base.setImage(image, for: $0) }
25 | return self
26 | }
27 |
28 | @discardableResult
29 | func backgroundImage(_ image: UIImage?, for state: UIControl.State...) -> Chain {
30 | state.forEach { base.setBackgroundImage(image, for: $0) }
31 | return self
32 | }
33 |
34 | @discardableResult
35 | func attributedTitle(_ attributedTitle: NSAttributedString?, for state: UIControl.State...) -> Chain {
36 | state.forEach { base.setAttributedTitle(attributedTitle, for: $0) }
37 | return self
38 | }
39 |
40 | @discardableResult
41 | func titleEdgeInsets(_ edgeInsets: UIEdgeInsets) -> Chain {
42 | base.titleEdgeInsets = edgeInsets
43 | return self
44 | }
45 |
46 | @discardableResult
47 | func titleEdgeInsets(top: CGFloat, left: CGFloat, bottom: CGFloat, right: CGFloat) -> Chain {
48 | base.titleEdgeInsets = UIEdgeInsets(top: top, left: left, bottom: bottom, right: right)
49 | return self
50 | }
51 |
52 | @discardableResult
53 | func imageEdgeInsets(_ edgeInsets: UIEdgeInsets) -> Chain {
54 | base.imageEdgeInsets = edgeInsets
55 | return self
56 | }
57 |
58 | @discardableResult
59 | func imageEdgeInsets(top: CGFloat, left: CGFloat, bottom: CGFloat, right: CGFloat) -> Chain {
60 | base.imageEdgeInsets = UIEdgeInsets(top: top, left: left, bottom: bottom, right: right)
61 | return self
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UICollectionView+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UICollectionView+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/8.
6 | //
7 |
8 | public extension Chain where Base: UICollectionView {
9 |
10 | @discardableResult
11 | func backgroundView(_ backgroundView: UIView?) -> Chain {
12 | base.backgroundView = backgroundView
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func dataSource(_ dataSource: UICollectionViewDataSource?) -> Chain {
18 | base.dataSource = dataSource
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func delegate(_ delegate: UICollectionViewDelegate?) -> Chain {
24 | base.delegate = delegate
25 | return self
26 | }
27 |
28 | @discardableResult
29 | func register(_ cellClass: Swift.AnyClass?, forCellWithReuseIdentifier identifier: String) -> Chain {
30 | base.register(cellClass, forCellWithReuseIdentifier: identifier)
31 | return self
32 | }
33 |
34 | @discardableResult
35 | func register(_ nib: UINib?, forCellWithReuseIdentifier identifier: String) -> Chain {
36 | base.register(nib, forCellWithReuseIdentifier: identifier)
37 | return self
38 | }
39 |
40 | @discardableResult
41 | func register(_ viewClass: Swift.AnyClass?,
42 | forSupplementaryViewOfKind elementKind: String,
43 | withReuseIdentifier identifier: String) -> Chain {
44 | base.register(viewClass,
45 | forSupplementaryViewOfKind: elementKind,
46 | withReuseIdentifier: identifier)
47 | return self
48 | }
49 |
50 | @discardableResult
51 | func register(_ viewClass: Swift.AnyClass?,
52 | forSectionHeaderWithReuseIdentifier identifier: String) -> Chain {
53 | base.register(viewClass,
54 | forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader,
55 | withReuseIdentifier: identifier)
56 | return self
57 | }
58 |
59 | @discardableResult
60 | func register(_ viewClass: Swift.AnyClass?,
61 | forSectionFooterWithReuseIdentifier identifier: String) -> Chain {
62 | base.register(viewClass,
63 | forSupplementaryViewOfKind: UICollectionView.elementKindSectionFooter,
64 | withReuseIdentifier: identifier)
65 | return self
66 | }
67 |
68 | @discardableResult
69 | func register(_ nib: UINib?,
70 | forSupplementaryViewOfKind kind: String,
71 | withReuseIdentifier identifier: String) -> Chain {
72 | base.register(nib, forSupplementaryViewOfKind: kind, withReuseIdentifier: identifier)
73 | return self
74 | }
75 |
76 | @discardableResult
77 | func register(_ nib: UINib?,
78 | forSectionHeaderWithReuseIdentifier identifier: String) -> Chain {
79 | base.register(nib,
80 | forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader,
81 | withReuseIdentifier: identifier)
82 | return self
83 | }
84 |
85 | @discardableResult
86 | func register(_ nib: UINib?,
87 | forSectionFooterWithReuseIdentifier identifier: String) -> Chain {
88 | base.register(nib,
89 | forSupplementaryViewOfKind: UICollectionView.elementKindSectionFooter,
90 | withReuseIdentifier: identifier)
91 | return self
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UICollectionViewFlowLayout+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UICollectionViewFlowLayout+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/8.
6 | //
7 |
8 | public extension Chain where Base: UICollectionViewFlowLayout {
9 |
10 | @discardableResult
11 | func minimumLineSpacing(_ minimumLineSpacing: CGFloat) -> Chain {
12 | base.minimumLineSpacing = minimumLineSpacing
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func minimumInteritemSpacing(_ minimumInteritemSpacing: CGFloat) -> Chain {
18 | base.minimumInteritemSpacing = minimumInteritemSpacing
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func itemSize(_ itemSize: CGSize) -> Chain {
24 | base.itemSize = itemSize
25 | return self
26 | }
27 |
28 | @discardableResult
29 | func itemSize(width: CGFloat, height: CGFloat) -> Chain {
30 | base.itemSize = CGSize(width: width, height: height)
31 | return self
32 | }
33 |
34 | @discardableResult
35 | func estimatedItemSize(_ estimatedItemSize: CGSize) -> Chain {
36 | base.estimatedItemSize = estimatedItemSize
37 | return self
38 | }
39 |
40 | @discardableResult
41 | func estimatedItemSize(width: CGFloat, height: CGFloat) -> Chain {
42 | base.estimatedItemSize = CGSize(width: width, height: height)
43 | return self
44 | }
45 |
46 | @discardableResult
47 | func scrollDirection(_ scrollDirection: UICollectionView.ScrollDirection) -> Chain {
48 | base.scrollDirection = scrollDirection
49 | return self
50 | }
51 |
52 | @discardableResult
53 | func headerReferenceSize(_ headerReferenceSize: CGSize) -> Chain {
54 | base.headerReferenceSize = headerReferenceSize
55 | return self
56 | }
57 |
58 | @discardableResult
59 | func headerReferenceSize(width: CGFloat, height: CGFloat) -> Chain {
60 | base.headerReferenceSize = CGSize(width: width, height: height)
61 | return self
62 | }
63 |
64 | @discardableResult
65 | func footerReferenceSize(_ footerReferenceSize: CGSize) -> Chain {
66 | base.footerReferenceSize = footerReferenceSize
67 | return self
68 | }
69 |
70 | @discardableResult
71 | func footerReferenceSize(width: CGFloat, height: CGFloat) -> Chain {
72 | base.footerReferenceSize = CGSize(width: width, height: height)
73 | return self
74 | }
75 |
76 | @discardableResult
77 | func sectionInset(_ sectionInset: UIEdgeInsets) -> Chain {
78 | base.sectionInset = sectionInset
79 | return self
80 | }
81 |
82 | @discardableResult
83 | func sectionInset(top: CGFloat, left: CGFloat, bottom: CGFloat, right: CGFloat) -> Chain {
84 | base.sectionInset = UIEdgeInsets(top: top, left: left, bottom: bottom, right: right)
85 | return self
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UIControl+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIControl+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/8.
6 | //
7 |
8 | public extension Chain where Base: UIControl {
9 |
10 | @discardableResult
11 | func isEnabled(_ isEnabled: Bool) -> Chain {
12 | base.isEnabled = isEnabled
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func isSelected(_ isSelected: Bool) -> Chain {
18 | base.isSelected = isSelected
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func isHighlighted(_ isHighlighted: Bool) -> Chain {
24 | base.isHighlighted = isHighlighted
25 | return self
26 | }
27 |
28 | @discardableResult
29 | func addTarget(_ target: Any?, action: Selector, for controlEvents: UIControl.Event) -> Chain {
30 | base.addTarget(target, action: action, for: controlEvents)
31 | return self
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UIDatePicker+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIDatePicker+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/15.
6 | //
7 |
8 | public extension Chain where Base: UIDatePicker {
9 |
10 | @discardableResult
11 | func datePickerMode(_ datePickerMode: UIDatePicker.Mode) -> Chain {
12 | base.datePickerMode = datePickerMode
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func locale(_ locale: Locale?) -> Chain {
18 | base.locale = locale
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func calendar(_ calendar: Calendar) -> Chain {
24 | base.calendar = calendar
25 | return self
26 | }
27 |
28 | @discardableResult
29 | func timeZone(_ timeZone: TimeZone?) -> Chain {
30 | base.timeZone = timeZone
31 | return self
32 | }
33 |
34 | @discardableResult
35 | func date(_ date: Date) -> Chain {
36 | base.date = date
37 | return self
38 | }
39 |
40 | @discardableResult
41 | func minimumDate(_ minimumDate: Date?) -> Chain {
42 | base.minimumDate = minimumDate
43 | return self
44 | }
45 |
46 | @discardableResult
47 | func maximumDate(_ maximumDate: Date?) -> Chain {
48 | base.maximumDate = maximumDate
49 | return self
50 | }
51 |
52 | @discardableResult
53 | func countDownDuration(_ countDownDuration: TimeInterval) -> Chain {
54 | base.countDownDuration = countDownDuration
55 | return self
56 | }
57 |
58 | @discardableResult
59 | func minuteInterval(_ minuteInterval: Int) -> Chain {
60 | base.minuteInterval = minuteInterval
61 | return self
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UIGestureRecognizer+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIGestureRecognizer+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/9.
6 | //
7 |
8 | public extension Chain where Base: UIGestureRecognizer {
9 |
10 | @discardableResult
11 | func addTarget(_ target: Any, action: Selector) -> Chain {
12 | base.addTarget(target, action: action)
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func delegate(_ delegate: UIGestureRecognizerDelegate?) -> Chain {
18 | base.delegate = delegate
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func isEnabled(_ isEnabled: Bool) -> Chain {
24 | base.isEnabled = isEnabled
25 | return self
26 | }
27 | }
28 |
29 | public extension Chain where Base: UITapGestureRecognizer {
30 |
31 | @discardableResult
32 | func numberOfTapsRequired(_ numberOfTapsRequired: Int) -> Chain {
33 | base.numberOfTapsRequired = numberOfTapsRequired
34 | return self
35 | }
36 |
37 | @discardableResult
38 | func numberOfTouchesRequired(_ numberOfTouchesRequired: Int) -> Chain {
39 | base.numberOfTouchesRequired = numberOfTouchesRequired
40 | return self
41 | }
42 | }
43 |
44 | public extension Chain where Base: UIPanGestureRecognizer {
45 |
46 | @discardableResult
47 | func minimumNumberOfTouches(_ minimumNumberOfTouches: Int) -> Chain {
48 | base.minimumNumberOfTouches = minimumNumberOfTouches
49 | return self
50 | }
51 |
52 | @discardableResult
53 | func maximumNumberOfTouches(_ maximumNumberOfTouches: Int) -> Chain {
54 | base.maximumNumberOfTouches = maximumNumberOfTouches
55 | return self
56 | }
57 | }
58 |
59 | public extension Chain where Base: UISwipeGestureRecognizer {
60 |
61 | @discardableResult
62 | func numberOfTouchesRequired(_ numberOfTouchesRequired: Int) -> Chain {
63 | base.numberOfTouchesRequired = numberOfTouchesRequired
64 | return self
65 | }
66 |
67 | @discardableResult
68 | func direction(_ direction: UISwipeGestureRecognizer.Direction) -> Chain {
69 | base.direction = direction
70 | return self
71 | }
72 | }
73 |
74 | public extension Chain where Base: UIPinchGestureRecognizer {
75 |
76 | @discardableResult
77 | func scale(_ scale: CGFloat) -> Chain {
78 | base.scale = scale
79 | return self
80 | }
81 | }
82 |
83 | public extension Chain where Base: UILongPressGestureRecognizer {
84 |
85 | @discardableResult
86 | func numberOfTapsRequired(_ numberOfTapsRequired: Int) -> Chain {
87 | base.numberOfTapsRequired = numberOfTapsRequired
88 | return self
89 | }
90 |
91 | @discardableResult
92 | func numberOfTouchesRequired(_ numberOfTouchesRequired: Int) -> Chain {
93 | base.numberOfTouchesRequired = numberOfTouchesRequired
94 | return self
95 | }
96 |
97 | @discardableResult
98 | func minimumPressDuration(_ minimumPressDuration: CFTimeInterval) -> Chain {
99 | base.minimumPressDuration = minimumPressDuration
100 | return self
101 | }
102 |
103 | @discardableResult
104 | func allowableMovement(_ allowableMovement: CGFloat) -> Chain {
105 | base.allowableMovement = allowableMovement
106 | return self
107 | }
108 | }
109 |
110 | public extension Chain where Base: UIRotationGestureRecognizer {
111 |
112 | @discardableResult
113 | func rotation(_ rotation: CGFloat) -> Chain {
114 | base.rotation = rotation
115 | return self
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UIImageView+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIImageView+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/8.
6 | //
7 |
8 | public extension Chain where Base: UIImageView {
9 |
10 | @discardableResult
11 | func image(_ image: UIImage?) -> Chain {
12 | base.image = image
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func isHighlighted(_ isHighlighted: Bool) -> Chain {
18 | base.isHighlighted = isHighlighted
19 | return self
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UILabel+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UILabel+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/8.
6 | //
7 |
8 | public extension Chain where Base: UILabel {
9 |
10 | @discardableResult
11 | func shadowColor(_ shadowColor: UIColor?) -> Chain {
12 | base.shadowColor = shadowColor
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func shadowOffset(_ shadowOffset: CGSize) -> Chain {
18 | base.shadowOffset = shadowOffset
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func shadowOffset(width: CGFloat, height: CGFloat) -> Chain {
24 | base.shadowOffset = CGSize(width: width, height: height)
25 | return self
26 | }
27 |
28 | @discardableResult
29 | func numberOfLines(_ numberOfLines: Int) -> Chain {
30 | base.numberOfLines = numberOfLines
31 | return self
32 | }
33 |
34 | @discardableResult
35 | func adjustsFontSizeToFitWidth(_ adjustsFontSizeToFitWidth: Bool) -> Chain {
36 | base.adjustsFontSizeToFitWidth = adjustsFontSizeToFitWidth
37 | return self
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UINavigationBar+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UINavigationBar+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/8.
6 | //
7 |
8 | public extension Chain where Base: UINavigationBar {
9 |
10 | @discardableResult
11 | func barStyle(_ barStyle: UIBarStyle) -> Chain {
12 | base.barStyle = barStyle
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func isTranslucent(_ isTranslucent: Bool) -> Chain {
18 | base.isTranslucent = isTranslucent
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func barTintColor(_ barTintColor: UIColor?) -> Chain {
24 | base.barTintColor = barTintColor
25 | return self
26 | }
27 |
28 | @discardableResult
29 | func backgroundImage(_ backgroundImage: UIImage?, for barPosition: UIBarPosition = .any, barMetrics: UIBarMetrics = .default) -> Chain {
30 | base.setBackgroundImage(backgroundImage, for: barPosition, barMetrics: barMetrics)
31 | return self
32 | }
33 |
34 | @discardableResult
35 | func shadowImage(_ shadowImage: UIImage?) -> Chain {
36 | base.shadowImage = shadowImage
37 | return self
38 | }
39 |
40 | @discardableResult
41 | func titleTextAttributes(_ titleTextAttributes: [NSAttributedString.Key : Any]?) -> Chain {
42 | base.titleTextAttributes = titleTextAttributes
43 | return self
44 | }
45 |
46 | @discardableResult
47 | func prefersLargeTitles(_ prefersLargeTitles: Bool) -> Chain {
48 | if #available(iOS 11.0, *) {
49 | base.prefersLargeTitles = prefersLargeTitles
50 | }
51 | return self
52 | }
53 |
54 | @discardableResult
55 | func largeTitleTextAttributes(_ largeTitleTextAttributes: [NSAttributedString.Key : Any]?) -> Chain {
56 | if #available(iOS 11.0, *) {
57 | base.largeTitleTextAttributes = largeTitleTextAttributes
58 | }
59 | return self
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UINavigationItem+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UINavigationItem+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/9.
6 | //
7 |
8 | public extension Chain where Base: UINavigationItem {
9 |
10 | @discardableResult
11 | func title(_ title: String?) -> Chain {
12 | base.title = title
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func titleView(_ titleView: UIView?) -> Chain {
18 | base.titleView = titleView
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func leftBarButtonItem(_ leftBarButtonItem: UIBarButtonItem?) -> Chain {
24 | base.leftBarButtonItem = leftBarButtonItem
25 | return self
26 | }
27 |
28 | @discardableResult
29 | func rightBarButtonItem(_ rightBarButtonItem: UIBarButtonItem?) -> Chain {
30 | base.rightBarButtonItem = rightBarButtonItem
31 | return self
32 | }
33 |
34 | @discardableResult
35 | func leftBarButtonItems(_ leftBarButtonItems: [UIBarButtonItem]?) -> Chain {
36 | base.leftBarButtonItems = leftBarButtonItems
37 | return self
38 | }
39 |
40 | @discardableResult
41 | func rightBarButtonItems(_ rightBarButtonItems: [UIBarButtonItem]?) -> Chain {
42 | base.rightBarButtonItems = rightBarButtonItems
43 | return self
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UIPickerView+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIPickerView+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/11.
6 | //
7 |
8 | public extension Chain where Base: UIPickerView {
9 |
10 | @discardableResult
11 | func dataSource(_ dataSource: UIPickerViewDataSource?) -> Chain {
12 | base.dataSource = dataSource
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func delegate(_ delegate: UIPickerViewDelegate?) -> Chain {
18 | base.delegate = delegate
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func showsSelectionIndicator(_ showsSelectionIndicator: Bool) -> Chain {
24 | base.showsSelectionIndicator = showsSelectionIndicator
25 | return self
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UIProgressView+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIProgressView+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/9.
6 | //
7 |
8 | public extension Chain where Base: UIProgressView {
9 |
10 | @discardableResult
11 | func progress(_ progress: Float) -> Chain {
12 | base.progress = progress
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func progressViewStyle(_ progressViewStyle: UIProgressView.Style) -> Chain {
18 | base.progressViewStyle = progressViewStyle
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func progressTintColor(_ progressTintColor: UIColor?) -> Chain {
24 | base.progressTintColor = progressTintColor
25 | return self
26 | }
27 |
28 | @discardableResult
29 | func trackTintColor(_ trackTintColor: UIColor?) -> Chain {
30 | base.trackTintColor = trackTintColor
31 | return self
32 | }
33 |
34 | @discardableResult
35 | func progressImage(_ progressImage: UIImage?) -> Chain {
36 | base.progressImage = progressImage
37 | return self
38 | }
39 |
40 | @discardableResult
41 | func trackImage(_ trackImage: UIImage?) -> Chain {
42 | base.trackImage = trackImage
43 | return self
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UIResponder+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIResponder+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/7/13.
6 | //
7 |
8 | public extension Chain where Base: UIResponder {
9 |
10 | @discardableResult
11 | func becomeFirstResponder() -> Chain {
12 | base.becomeFirstResponder()
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func resignFirstResponder() -> Chain {
18 | base.resignFirstResponder()
19 | return self
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UIScrollView+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIScrollView+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/8.
6 | //
7 |
8 | public extension Chain where Base: UIScrollView {
9 |
10 | @discardableResult
11 | func delegate(_ delegate: UIScrollViewDelegate?) -> Chain {
12 | base.delegate = delegate
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func contentOffset(_ contentOffset: CGPoint) -> Chain {
18 | base.contentOffset = contentOffset
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func contentOffset(x: CGFloat, y: CGFloat) -> Chain {
24 | base.contentOffset = CGPoint(x: x, y: y)
25 | return self
26 | }
27 |
28 | @discardableResult
29 | func contentSize(_ contentSize: CGSize) -> Chain {
30 | base.contentSize = contentSize
31 | return self
32 | }
33 |
34 | @discardableResult
35 | func contentSize(width: CGFloat, height: CGFloat) -> Chain {
36 | base.contentSize = CGSize(width: width, height: height)
37 | return self
38 | }
39 |
40 | @discardableResult
41 | func contentInset(_ contentInset: UIEdgeInsets) -> Chain {
42 | base.contentInset = contentInset
43 | return self
44 | }
45 |
46 | @discardableResult
47 | func contentInset(top: CGFloat, left: CGFloat, bottom: CGFloat, right: CGFloat) -> Chain {
48 | base.contentInset = UIEdgeInsets(top: top, left: left, bottom: bottom, right: right)
49 | return self
50 | }
51 |
52 | @available(iOS 11.0, *)
53 | @discardableResult
54 | func contentInsetAdjustmentBehavior(_ contentInsetAdjustmentBehavior: UIScrollView.ContentInsetAdjustmentBehavior) -> Chain {
55 | base.contentInsetAdjustmentBehavior = contentInsetAdjustmentBehavior
56 | return self
57 | }
58 |
59 | @discardableResult
60 | func isDirectionalLockEnabled(_ isDirectionalLockEnabled: Bool) -> Chain {
61 | base.isDirectionalLockEnabled = isDirectionalLockEnabled
62 | return self
63 | }
64 |
65 | @discardableResult
66 | func bounces(_ bounces: Bool) -> Chain {
67 | base.bounces = bounces
68 | return self
69 | }
70 |
71 | @discardableResult
72 | func alwaysBounceVertical(_ alwaysBounceVertical: Bool) -> Chain {
73 | base.alwaysBounceVertical = alwaysBounceVertical
74 | return self
75 | }
76 |
77 | @discardableResult
78 | func alwaysBounceHorizontal(_ alwaysBounceHorizontal: Bool) -> Chain {
79 | base.alwaysBounceHorizontal = alwaysBounceHorizontal
80 | return self
81 | }
82 |
83 | @discardableResult
84 | func isPagingEnabled(_ isPagingEnabled: Bool) -> Chain {
85 | base.isPagingEnabled = isPagingEnabled
86 | return self
87 | }
88 |
89 | @discardableResult
90 | func isScrollEnabled(_ isScrollEnabled: Bool) -> Chain {
91 | base.isScrollEnabled = isScrollEnabled
92 | return self
93 | }
94 |
95 | @discardableResult
96 | func showsHorizontalScrollIndicator(_ showsHorizontalScrollIndicator: Bool) -> Chain {
97 | base.showsHorizontalScrollIndicator = showsHorizontalScrollIndicator
98 | return self
99 | }
100 |
101 | @discardableResult
102 | func showsVerticalScrollIndicator(_ showsVerticalScrollIndicator: Bool) -> Chain {
103 | base.showsVerticalScrollIndicator = showsVerticalScrollIndicator
104 | return self
105 | }
106 |
107 | @discardableResult
108 | func scrollIndicatorInsets(_ scrollIndicatorInsets: UIEdgeInsets) -> Chain {
109 | base.scrollIndicatorInsets = scrollIndicatorInsets
110 | return self
111 | }
112 |
113 | @discardableResult
114 | func scrollIndicatorInsets(top: CGFloat, left: CGFloat, bottom: CGFloat, right: CGFloat) -> Chain {
115 | base.scrollIndicatorInsets = UIEdgeInsets(top: top, left: left, bottom: bottom, right: right)
116 | return self
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UISegmentedControl+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UISegmentedControl+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/7/12.
6 | //
7 |
8 | public extension Chain where Base: UISegmentedControl {
9 |
10 | @discardableResult
11 | func title(_ title: String?, forSegmentAt segment: Int) -> Chain {
12 | base.setTitle(title, forSegmentAt: segment)
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func image(_ image: UIImage?, forSegmentAt segment: Int) -> Chain {
18 | base.setImage(image, forSegmentAt: segment)
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func width(_ width: CGFloat, forSegmentAt segment: Int) -> Chain {
24 | base.setWidth(width, forSegmentAt: segment)
25 | return self
26 | }
27 |
28 | @discardableResult
29 | func contentOffset(_ offset: CGSize, forSegmentAt segment: Int) -> Chain {
30 | base.setContentOffset(offset, forSegmentAt: segment)
31 | return self
32 | }
33 |
34 | @discardableResult
35 | func enabled(_ enabled: Bool, forSegmentAt segment: Int) -> Chain {
36 | base.setEnabled(enabled, forSegmentAt: segment)
37 | return self
38 | }
39 |
40 | @discardableResult
41 | func selectedSegmentIndex(_ selectedSegmentIndex: Int) -> Chain {
42 | base.selectedSegmentIndex = selectedSegmentIndex
43 | return self
44 | }
45 |
46 | @discardableResult
47 | func backgroundImage(_ backgroundImage: UIImage?, for state: UIControl.State..., barMetrics: UIBarMetrics) -> Chain {
48 | state.forEach { base.setBackgroundImage(backgroundImage, for: $0, barMetrics: barMetrics) }
49 | return self
50 | }
51 |
52 | @discardableResult
53 | func dividerImage(_ dividerImage: UIImage?,
54 | forLeftSegmentState leftState: UIControl.State,
55 | rightSegmentState rightState: UIControl.State,
56 | barMetrics: UIBarMetrics) -> Chain {
57 | base.setDividerImage(dividerImage, forLeftSegmentState: leftState, rightSegmentState: rightState, barMetrics: barMetrics)
58 | return self
59 | }
60 |
61 | @discardableResult
62 | func titleTextAttributes(_ attributes: [NSAttributedString.Key : Any]?, for state: UIControl.State...) -> Chain {
63 | state.forEach { base.setTitleTextAttributes(attributes, for: $0) }
64 | return self
65 | }
66 |
67 | @discardableResult
68 | func contentPositionAdjustment(_ adjustment: UIOffset,
69 | forSegmentType leftCenterRightOrAlone: UISegmentedControl.Segment,
70 | barMetrics: UIBarMetrics) -> Chain {
71 | base.setContentPositionAdjustment(adjustment, forSegmentType: leftCenterRightOrAlone, barMetrics: barMetrics)
72 | return self
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UISlider+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UISlider+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/9.
6 | //
7 |
8 | public extension Chain where Base: UISlider {
9 |
10 | @discardableResult
11 | func value(_ value: Float) -> Chain {
12 | base.value = value
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func minimumValue(_ minimumValue: Float) -> Chain {
18 | base.minimumValue = minimumValue
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func maximumValue(_ maximumValue: Float) -> Chain {
24 | base.maximumValue = maximumValue
25 | return self
26 | }
27 |
28 | @discardableResult
29 | func minimumValueImage(_ minimumValueImage: UIImage?) -> Chain {
30 | base.minimumValueImage = minimumValueImage
31 | return self
32 | }
33 |
34 | @discardableResult
35 | func maximumValueImage(_ maximumValueImage: UIImage?) -> Chain {
36 | base.maximumValueImage = maximumValueImage
37 | return self
38 | }
39 |
40 | @discardableResult
41 | func isContinuous(_ isContinuous: Bool) -> Chain {
42 | base.isContinuous = isContinuous
43 | return self
44 | }
45 |
46 | @discardableResult
47 | func minimumTrackTintColor(_ minimumTrackTintColor: UIColor?) -> Chain {
48 | base.minimumTrackTintColor = minimumTrackTintColor
49 | return self
50 | }
51 |
52 | @discardableResult
53 | func maximumTrackTintColor(_ maximumTrackTintColor: UIColor?) -> Chain {
54 | base.maximumTrackTintColor = maximumTrackTintColor
55 | return self
56 | }
57 |
58 | @discardableResult
59 | func thumbTintColor(_ thumbTintColor: UIColor?) -> Chain {
60 | base.thumbTintColor = thumbTintColor
61 | return self
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UIStepper+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIStepper+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/15.
6 | //
7 |
8 | public extension Chain where Base: UIStepper {
9 |
10 | @discardableResult
11 | func isContinuous(_ isContinuous: Bool) -> Chain {
12 | base.isContinuous = isContinuous
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func autorepeat(_ autorepeat: Bool) -> Chain {
18 | base.autorepeat = autorepeat
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func wraps(_ wraps: Bool) -> Chain {
24 | base.wraps = wraps
25 | return self
26 | }
27 |
28 | @discardableResult
29 | func value(_ value: Double) -> Chain {
30 | base.value = value
31 | return self
32 | }
33 |
34 | @discardableResult
35 | func minimumValue(_ minimumValue: Double) -> Chain {
36 | base.minimumValue = minimumValue
37 | return self
38 | }
39 |
40 | @discardableResult
41 | func maximumValue(_ maximumValue: Double) -> Chain {
42 | base.maximumValue = maximumValue
43 | return self
44 | }
45 |
46 | @discardableResult
47 | func stepValue(_ stepValue: Double) -> Chain {
48 | base.stepValue = stepValue
49 | return self
50 | }
51 |
52 | @discardableResult
53 | func backgroundImage(_ image: UIImage?, for state: UIControl.State...) -> Chain {
54 | state.forEach { base.setBackgroundImage(image, for: $0) }
55 | return self
56 | }
57 |
58 | @discardableResult
59 | func dividerImage(_ image: UIImage?,
60 | forLeftSegmentState leftState: UIControl.State,
61 | rightSegmentState rightState: UIControl.State) -> Chain {
62 | base.setDividerImage(image, forLeftSegmentState: leftState, rightSegmentState: rightState)
63 | return self
64 | }
65 |
66 | @discardableResult
67 | func incrementImage(_ image: UIImage?, for state: UIControl.State) -> Chain {
68 | base.setIncrementImage(image, for: state)
69 | return self
70 | }
71 |
72 | @discardableResult
73 | func decrementImage(_ image: UIImage?, for state: UIControl.State) -> Chain {
74 | base.setDecrementImage(image, for: state)
75 | return self
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UISwitch+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UISwitch+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/15.
6 | //
7 |
8 | public extension Chain where Base: UISwitch {
9 |
10 | @discardableResult
11 | func onTintColor(_ onTintColor: UIColor?) -> Chain {
12 | base.onTintColor = onTintColor
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func thumbTintColor(_ thumbTintColor: UIColor?) -> Chain {
18 | base.thumbTintColor = thumbTintColor
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func onImage(_ onImage: UIImage?) -> Chain {
24 | base.onImage = onImage
25 | return self
26 | }
27 |
28 | @discardableResult
29 | func offImage(_ offImage: UIImage?) -> Chain {
30 | base.offImage = offImage
31 | return self
32 | }
33 |
34 | @discardableResult
35 | func isOn(_ isOn: Bool) -> Chain {
36 | base.isOn = isOn
37 | return self
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UITableView+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UITableView+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/8.
6 | //
7 |
8 | public extension Chain where Base: UITableView {
9 |
10 | @discardableResult
11 | func backgroundView(_ backgroundView: UIView?) -> Chain {
12 | base.backgroundView = backgroundView
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func dataSource(_ dataSource: UITableViewDataSource?) -> Chain {
18 | base.dataSource = dataSource
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func delegate(_ delegate: UITableViewDelegate?) -> Chain {
24 | base.delegate = delegate
25 | return self
26 | }
27 |
28 | @discardableResult
29 | func rowHeight(_ rowHeight: CGFloat) -> Chain {
30 | base.rowHeight = rowHeight
31 | return self
32 | }
33 |
34 | @discardableResult
35 | func sectionHeaderHeight(_ sectionHeaderHeight: CGFloat) -> Chain {
36 | base.sectionHeaderHeight = sectionHeaderHeight
37 | return self
38 | }
39 |
40 | @discardableResult
41 | func sectionFooterHeight(_ sectionFooterHeight: CGFloat) -> Chain {
42 | base.sectionFooterHeight = sectionFooterHeight
43 | return self
44 | }
45 |
46 | @discardableResult
47 | func estimatedRowHeight(_ estimatedRowHeight: CGFloat) -> Chain {
48 | base.estimatedRowHeight = estimatedRowHeight
49 | return self
50 | }
51 |
52 | @discardableResult
53 | func estimatedSectionHeaderHeight(_ estimatedSectionHeaderHeight: CGFloat) -> Chain {
54 | base.estimatedSectionHeaderHeight = estimatedSectionHeaderHeight
55 | return self
56 | }
57 |
58 | @discardableResult
59 | func estimatedSectionFooterHeight(_ estimatedSectionFooterHeight: CGFloat) -> Chain {
60 | base.estimatedSectionFooterHeight = estimatedSectionFooterHeight
61 | return self
62 | }
63 |
64 | @discardableResult
65 | func sectionIndexColor(_ sectionIndexColor: UIColor?) -> Chain {
66 | base.sectionIndexColor = sectionIndexColor
67 | return self
68 | }
69 |
70 | @discardableResult
71 | func sectionIndexBackgroundColor(_ sectionIndexBackgroundColor: UIColor?) -> Chain {
72 | base.sectionIndexBackgroundColor = sectionIndexBackgroundColor
73 | return self
74 | }
75 |
76 | @discardableResult
77 | func sectionIndexTrackingBackgroundColor(_ sectionIndexTrackingBackgroundColor: UIColor?) -> Chain {
78 | base.sectionIndexTrackingBackgroundColor = sectionIndexTrackingBackgroundColor
79 | return self
80 | }
81 |
82 | @discardableResult
83 | func sectionIndexMinimumDisplayRowCount(_ sectionIndexMinimumDisplayRowCount: Int) -> Chain {
84 | base.sectionIndexMinimumDisplayRowCount = sectionIndexMinimumDisplayRowCount
85 | return self
86 | }
87 |
88 | @discardableResult
89 | func separatorStyle(_ separatorStyle: UITableViewCell.SeparatorStyle) -> Chain {
90 | base.separatorStyle = separatorStyle
91 | return self
92 | }
93 |
94 | @discardableResult
95 | func separatorColor(_ separatorColor: UIColor?) -> Chain {
96 | base.separatorColor = separatorColor
97 | return self
98 | }
99 |
100 | @discardableResult
101 | func separatorInset(_ separatorInset: UIEdgeInsets) -> Chain {
102 | base.separatorInset = separatorInset
103 | return self
104 | }
105 |
106 | @discardableResult
107 | func separatorInset(top: CGFloat, left: CGFloat, bottom: CGFloat, right: CGFloat) -> Chain {
108 | base.separatorInset = UIEdgeInsets(top: top, left: left, bottom: bottom, right: right)
109 | return self
110 | }
111 |
112 | @discardableResult
113 | func tableHeaderView(_ tableHeaderView: UIView?) -> Chain {
114 | base.tableHeaderView = tableHeaderView
115 | return self
116 | }
117 |
118 | @discardableResult
119 | func tableFooterView(_ tableFooterView: UIView?) -> Chain {
120 | base.tableFooterView = tableFooterView
121 | return self
122 | }
123 |
124 | @discardableResult
125 | func register(_ nib: UINib?, forCellReuseIdentifier identifier: String) -> Chain {
126 | base.register(nib, forCellReuseIdentifier: identifier)
127 | return self
128 | }
129 |
130 | @discardableResult
131 | func register(_ cellClass: Swift.AnyClass?, forCellReuseIdentifier identifier: String) -> Chain {
132 | base.register(cellClass, forCellReuseIdentifier: identifier)
133 | return self
134 | }
135 |
136 | @discardableResult
137 | func register(_ nib: UINib?, forHeaderFooterViewReuseIdentifier identifier: String) -> Chain {
138 | base.register(nib, forHeaderFooterViewReuseIdentifier: identifier)
139 | return self
140 | }
141 |
142 | @discardableResult
143 | func register(_ aClass: Swift.AnyClass?, forHeaderFooterViewReuseIdentifier identifier: String) -> Chain {
144 | base.register(aClass, forHeaderFooterViewReuseIdentifier: identifier)
145 | return self
146 | }
147 | }
148 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UITextField+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UITextField+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/8.
6 | //
7 |
8 | public extension Chain where Base: UITextField {
9 |
10 | @discardableResult
11 | func delegate(_ delegate: UITextFieldDelegate?) -> Chain {
12 | base.delegate = delegate
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func placeholder(_ placeholder: String?) -> Chain {
18 | base.placeholder = placeholder
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func attributedPlaceholder(_ attributedPlaceholder: NSAttributedString?) -> Chain {
24 | base.attributedPlaceholder = attributedPlaceholder
25 | return self
26 | }
27 |
28 | @discardableResult
29 | func borderStyle(_ borderStyle: UITextField.BorderStyle) -> Chain {
30 | base.borderStyle = borderStyle
31 | return self
32 | }
33 |
34 | @discardableResult
35 | func defaultTextAttributes(_ defaultTextAttributes: [String: Any]) -> Chain {
36 | #if swift(>=4.2)
37 | base.defaultTextAttributes = convertToNSAttributedStringKeyDictionary(defaultTextAttributes)
38 | #else
39 | base.defaultTextAttributes = defaultTextAttributes
40 | #endif
41 | return self
42 | }
43 |
44 | @discardableResult
45 | func clearsOnBeginEditing(_ clearsOnBeginEditing: Bool) -> Chain {
46 | base.clearsOnBeginEditing = clearsOnBeginEditing
47 | return self
48 | }
49 |
50 | @discardableResult
51 | func adjustsFontSizeToFitWidth(_ adjustsFontSizeToFitWidth: Bool) -> Chain {
52 | base.adjustsFontSizeToFitWidth = adjustsFontSizeToFitWidth
53 | return self
54 | }
55 |
56 | @discardableResult
57 | func minimumFontSize(_ minimumFontSize: CGFloat) -> Chain {
58 | base.minimumFontSize = minimumFontSize
59 | return self
60 | }
61 |
62 | @discardableResult
63 | func allowsEditingTextAttributes(_ allowsEditingTextAttributes: Bool) -> Chain {
64 | base.allowsEditingTextAttributes = allowsEditingTextAttributes
65 | return self
66 | }
67 |
68 | @discardableResult
69 | func typingAttributes(_ typingAttributes: [String: Any]?) -> Chain {
70 | #if swift(>=4.2)
71 | base.typingAttributes = convertToOptionalNSAttributedStringKeyDictionary(typingAttributes)
72 | #else
73 | base.typingAttributes = typingAttributes
74 | #endif
75 | return self
76 | }
77 |
78 | @discardableResult
79 | func clearButtonMode(_ clearButtonMode: UITextField.ViewMode) -> Chain {
80 | base.clearButtonMode = clearButtonMode
81 | return self
82 | }
83 |
84 | @discardableResult
85 | func leftView(_ leftView: UIView?) -> Chain {
86 | base.leftView = leftView
87 | return self
88 | }
89 |
90 | @discardableResult
91 | func leftViewMode(_ leftViewMode: UITextField.ViewMode) -> Chain {
92 | base.leftViewMode = leftViewMode
93 | return self
94 | }
95 |
96 | @discardableResult
97 | func rightView(_ rightView: UIView?) -> Chain {
98 | base.rightView = rightView
99 | return self
100 | }
101 |
102 | @discardableResult
103 | func rightViewMode(_ rightViewMode: UITextField.ViewMode) -> Chain {
104 | base.rightViewMode = rightViewMode
105 | return self
106 | }
107 |
108 | @discardableResult
109 | func keyboardType(_ keyboardType: UIKeyboardType) -> Chain {
110 | base.keyboardType = keyboardType
111 | return self
112 | }
113 |
114 | @discardableResult
115 | func returnKeyType(_ returnKeyType: UIReturnKeyType) -> Chain {
116 | base.returnKeyType = returnKeyType
117 | return self
118 | }
119 |
120 | @discardableResult
121 | func isSecureTextEntry(_ isSecureTextEntry: Bool) -> Chain {
122 | base.isSecureTextEntry = isSecureTextEntry
123 | return self
124 | }
125 |
126 | @discardableResult
127 | func textContentType(_ textContentType: UITextContentType) -> Chain {
128 | if #available(iOS 10.0, *) {
129 | base.textContentType = textContentType
130 | }
131 | return self
132 | }
133 | }
134 |
135 | // Helper function inserted by Swift 4.2 migrator.
136 | fileprivate func convertToNSAttributedStringKeyDictionary(_ input: [String: Any])
137 | -> [NSAttributedString.Key: Any] {
138 | return Dictionary(uniqueKeysWithValues: input.map { key, value in
139 | (NSAttributedString.Key(rawValue: key), value)
140 | })
141 | }
142 |
143 | // Helper function inserted by Swift 4.2 migrator.
144 | fileprivate func convertToOptionalNSAttributedStringKeyDictionary(_ input: [String: Any]?) -> [NSAttributedString.Key: Any]? {
145 | guard let input = input else { return nil }
146 | return Dictionary(uniqueKeysWithValues: input.map { key, value in
147 | (NSAttributedString.Key(rawValue: key), value)
148 | })
149 | }
150 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UITextView+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UITextView+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/8.
6 | //
7 |
8 | public extension Chain where Base: UITextView {
9 |
10 | @discardableResult
11 | func delegate(_ delegate: UITextViewDelegate?) -> Chain {
12 | base.delegate = delegate
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func isEditable(_ isEditable: Bool) -> Chain {
18 | base.isEditable = isEditable
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func isSelectable(_ isSelectable: Bool) -> Chain {
24 | base.isSelectable = isSelectable
25 | return self
26 | }
27 |
28 | @discardableResult
29 | func textContainerInset(_ textContainerInset: UIEdgeInsets) -> Chain {
30 | base.textContainerInset = textContainerInset
31 | return self
32 | }
33 |
34 | @discardableResult
35 | func dataDetectorTypes(_ dataDetectorTypes: UIDataDetectorTypes) -> Chain {
36 | base.dataDetectorTypes = dataDetectorTypes
37 | return self
38 | }
39 |
40 | @discardableResult
41 | func allowsEditingTextAttributes(_ allowsEditingTextAttributes: Bool) -> Chain {
42 | base.allowsEditingTextAttributes = allowsEditingTextAttributes
43 | return self
44 | }
45 |
46 | @discardableResult
47 | func keyboardType(_ keyboardType: UIKeyboardType) -> Chain {
48 | base.keyboardType = keyboardType
49 | return self
50 | }
51 |
52 | @discardableResult
53 | func returnKeyType(_ returnKeyType: UIReturnKeyType) -> Chain {
54 | base.returnKeyType = returnKeyType
55 | return self
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UIView+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/8.
6 | //
7 |
8 | public extension Chain where Base: UIView {
9 |
10 | @discardableResult
11 | func tag(_ tag: Int) -> Chain {
12 | base.tag = tag
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func frame(_ frame: CGRect) -> Chain {
18 | base.frame = frame
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func frame(x: CGFloat, y: CGFloat, width: CGFloat, height: CGFloat) -> Chain {
24 | base.frame = CGRect(x: x, y: y, width: width, height: height)
25 | return self
26 | }
27 |
28 | @discardableResult
29 | func bounds(_ bounds: CGRect) -> Chain {
30 | base.bounds = bounds
31 | return self
32 | }
33 |
34 | @discardableResult
35 | func center(_ center: CGPoint) -> Chain {
36 | base.center = center
37 | return self
38 | }
39 |
40 | @discardableResult
41 | func center(x: CGFloat, y: CGFloat) -> Chain {
42 | base.center = CGPoint(x: x, y: y)
43 | return self
44 | }
45 |
46 | @discardableResult
47 | func backgroundColor(_ backgroundColor: UIColor) -> Chain {
48 | base.backgroundColor = backgroundColor
49 | return self
50 | }
51 |
52 | @discardableResult
53 | func contentMode(_ contentMode: UIView.ContentMode) -> Chain {
54 | base.contentMode = contentMode
55 | return self
56 | }
57 |
58 | @discardableResult
59 | func clipsToBounds(_ clipsToBounds: Bool) -> Chain {
60 | base.clipsToBounds = clipsToBounds
61 | return self
62 | }
63 |
64 | @discardableResult
65 | func alpha(_ alpha: CGFloat) -> Chain {
66 | base.alpha = alpha
67 | return self
68 | }
69 |
70 | @discardableResult
71 | func isHidden(_ isHidden: Bool) -> Chain {
72 | base.isHidden = isHidden
73 | return self
74 | }
75 |
76 | @discardableResult
77 | func isOpaque(_ isOpaque: Bool) -> Chain {
78 | base.isOpaque = isOpaque
79 | return self
80 | }
81 |
82 | @discardableResult
83 | func isUserInteractionEnabled(_ isUserInteractionEnabled: Bool) -> Chain {
84 | base.isUserInteractionEnabled = isUserInteractionEnabled
85 | return self
86 | }
87 |
88 | @discardableResult
89 | func tintColor(_ tintColor: UIColor) -> Chain {
90 | base.tintColor = tintColor
91 | return self
92 | }
93 |
94 | @discardableResult
95 | func cornerRadius(_ cornerRadius: CGFloat) -> Chain {
96 | base.layer.cornerRadius = cornerRadius
97 | return self
98 | }
99 |
100 | @discardableResult
101 | func masksToBounds(_ masksToBounds: Bool) -> Chain {
102 | base.layer.masksToBounds = masksToBounds
103 | return self
104 | }
105 |
106 | @discardableResult
107 | func borderWidth(_ borderWidth: CGFloat) -> Chain {
108 | base.layer.borderWidth = borderWidth
109 | return self
110 | }
111 |
112 | @discardableResult
113 | func borderColor(_ borderColor: UIColor) -> Chain {
114 | base.layer.borderColor = borderColor.cgColor
115 | return self
116 | }
117 |
118 | @discardableResult
119 | func shadowColor(_ shadowColor: UIColor?) -> Chain {
120 | base.layer.shadowColor = shadowColor?.cgColor
121 | return self
122 | }
123 |
124 | @discardableResult
125 | func shadowOpacity(_ shadowOpacity: Float) -> Chain {
126 | base.layer.shadowOpacity = shadowOpacity
127 | return self
128 | }
129 |
130 | @discardableResult
131 | func shadowOffset(_ shadowOffset: CGSize) -> Chain {
132 | base.layer.shadowOffset = shadowOffset
133 | return self
134 | }
135 |
136 | @discardableResult
137 | func shadowRadius(_ shadowRadius: CGFloat) -> Chain {
138 | base.layer.shadowRadius = shadowRadius
139 | return self
140 | }
141 |
142 | @discardableResult
143 | func shadowPath(_ shadowPath: CGPath?) -> Chain {
144 | base.layer.shadowPath = shadowPath
145 | return self
146 | }
147 |
148 | @discardableResult
149 | func addSubview(_ view: UIView) -> Chain {
150 | base.addSubview(view)
151 | return self
152 | }
153 |
154 | @discardableResult
155 | func addGestureRecognizer(_ gestureRecognizer: UIGestureRecognizer) -> Chain {
156 | base.addGestureRecognizer(gestureRecognizer)
157 | return self
158 | }
159 |
160 | @discardableResult
161 | func addConstraint(_ constraint: NSLayoutConstraint) -> Chain {
162 | base.addConstraint(constraint)
163 | return self
164 | }
165 |
166 | @discardableResult
167 | func addConstraints(_ constraints: [NSLayoutConstraint]) -> Chain {
168 | base.addConstraints(constraints)
169 | return self
170 | }
171 | }
172 |
--------------------------------------------------------------------------------
/CocoaChainKit/Classes/UserDefaults+Chain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UserDefaults+Chain.swift
3 | // CocoaChainKit
4 | //
5 | // Created by GorXion on 2018/5/9.
6 | //
7 |
8 | public extension Chain where Base: UserDefaults {
9 |
10 | @discardableResult
11 | func removeObject(forKey defaultName: String) -> Chain {
12 | base.removeObject(forKey: defaultName)
13 | return self
14 | }
15 |
16 | @discardableResult
17 | func set(_ value: Any?, forKey defaultName: String) -> Chain {
18 | base.set(value, forKey: defaultName)
19 | return self
20 | }
21 |
22 | @discardableResult
23 | func set(_ value: Bool, forKey defaultName: String) -> Chain {
24 | base.set(value, forKey: defaultName)
25 | return self
26 | }
27 |
28 | @discardableResult
29 | func set(_ value: Int, forKey defaultName: String) -> Chain {
30 | base.set(value, forKey: defaultName)
31 | return self
32 | }
33 |
34 | @discardableResult
35 | func set(_ value: Double, forKey defaultName: String) -> Chain {
36 | base.set(value, forKey: defaultName)
37 | return self
38 | }
39 |
40 | @discardableResult
41 | func set(_ value: Float, forKey defaultName: String) -> Chain {
42 | base.set(value, forKey: defaultName)
43 | return self
44 | }
45 |
46 | @discardableResult
47 | func set(_ url: URL?, forKey defaultName: String) -> Chain {
48 | base.set(url, forKey: defaultName)
49 | return self
50 | }
51 |
52 | @discardableResult
53 | func synchronize() -> Bool {
54 | return base.synchronize()
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/Example/CocoaChainKit.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 511B97FE1FAC72BD7CBFA2D5 /* Pods_CocoaChainKit_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7A6CFB18269B6085343EB20 /* Pods_CocoaChainKit_Tests.framework */; };
11 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; };
12 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; };
13 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; };
14 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; };
15 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; };
16 | 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; };
17 | 9695229C5590EB344F9761D5 /* Pods_CocoaChainKit_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B0EA80AFA37335D22311DE8D /* Pods_CocoaChainKit_Example.framework */; };
18 | /* End PBXBuildFile section */
19 |
20 | /* Begin PBXContainerItemProxy section */
21 | 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */ = {
22 | isa = PBXContainerItemProxy;
23 | containerPortal = 607FACC81AFB9204008FA782 /* Project object */;
24 | proxyType = 1;
25 | remoteGlobalIDString = 607FACCF1AFB9204008FA782;
26 | remoteInfo = CocoaChainKit;
27 | };
28 | /* End PBXContainerItemProxy section */
29 |
30 | /* Begin PBXFileReference section */
31 | 19E2FF6B1A6B19E53B6BF062 /* Pods-CocoaChainKit_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CocoaChainKit_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CocoaChainKit_Tests/Pods-CocoaChainKit_Tests.debug.xcconfig"; sourceTree = ""; };
32 | 202BD38E687EBEB9D2EBFDD9 /* Pods-CocoaChainKit_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CocoaChainKit_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-CocoaChainKit_Tests/Pods-CocoaChainKit_Tests.release.xcconfig"; sourceTree = ""; };
33 | 2E85C7E5B55A830368DFA1F2 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; };
34 | 3E7A827D7EEC97F8D413A0A2 /* CocoaChainKit.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = CocoaChainKit.podspec; path = ../CocoaChainKit.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
35 | 4867660C0735A9EB705259F5 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; };
36 | 4AE03E8D0B55B46921E93EB7 /* Pods-CocoaChainKit_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CocoaChainKit_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CocoaChainKit_Example/Pods-CocoaChainKit_Example.debug.xcconfig"; sourceTree = ""; };
37 | 607FACD01AFB9204008FA782 /* CocoaChainKit_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CocoaChainKit_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
38 | 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
39 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
40 | 607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
41 | 607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
42 | 607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
43 | 607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
44 | 607FACE51AFB9204008FA782 /* CocoaChainKit_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CocoaChainKit_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
45 | 607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
46 | 607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = ""; };
47 | B0EA80AFA37335D22311DE8D /* Pods_CocoaChainKit_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CocoaChainKit_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
48 | E7A6CFB18269B6085343EB20 /* Pods_CocoaChainKit_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CocoaChainKit_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
49 | EDFAD5D3952E9C58C1BA967A /* Pods-CocoaChainKit_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CocoaChainKit_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-CocoaChainKit_Example/Pods-CocoaChainKit_Example.release.xcconfig"; sourceTree = ""; };
50 | /* End PBXFileReference section */
51 |
52 | /* Begin PBXFrameworksBuildPhase section */
53 | 607FACCD1AFB9204008FA782 /* Frameworks */ = {
54 | isa = PBXFrameworksBuildPhase;
55 | buildActionMask = 2147483647;
56 | files = (
57 | 9695229C5590EB344F9761D5 /* Pods_CocoaChainKit_Example.framework in Frameworks */,
58 | );
59 | runOnlyForDeploymentPostprocessing = 0;
60 | };
61 | 607FACE21AFB9204008FA782 /* Frameworks */ = {
62 | isa = PBXFrameworksBuildPhase;
63 | buildActionMask = 2147483647;
64 | files = (
65 | 511B97FE1FAC72BD7CBFA2D5 /* Pods_CocoaChainKit_Tests.framework in Frameworks */,
66 | );
67 | runOnlyForDeploymentPostprocessing = 0;
68 | };
69 | /* End PBXFrameworksBuildPhase section */
70 |
71 | /* Begin PBXGroup section */
72 | 607FACC71AFB9204008FA782 = {
73 | isa = PBXGroup;
74 | children = (
75 | 607FACF51AFB993E008FA782 /* Podspec Metadata */,
76 | 607FACD21AFB9204008FA782 /* Example for CocoaChainKit */,
77 | 607FACE81AFB9204008FA782 /* Tests */,
78 | 607FACD11AFB9204008FA782 /* Products */,
79 | A247A261C75642D97CCECBA0 /* Pods */,
80 | 7C74B3A0897F984AAA46486B /* Frameworks */,
81 | );
82 | sourceTree = "";
83 | };
84 | 607FACD11AFB9204008FA782 /* Products */ = {
85 | isa = PBXGroup;
86 | children = (
87 | 607FACD01AFB9204008FA782 /* CocoaChainKit_Example.app */,
88 | 607FACE51AFB9204008FA782 /* CocoaChainKit_Tests.xctest */,
89 | );
90 | name = Products;
91 | sourceTree = "";
92 | };
93 | 607FACD21AFB9204008FA782 /* Example for CocoaChainKit */ = {
94 | isa = PBXGroup;
95 | children = (
96 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */,
97 | 607FACD71AFB9204008FA782 /* ViewController.swift */,
98 | 607FACD91AFB9204008FA782 /* Main.storyboard */,
99 | 607FACDC1AFB9204008FA782 /* Images.xcassets */,
100 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */,
101 | 607FACD31AFB9204008FA782 /* Supporting Files */,
102 | );
103 | name = "Example for CocoaChainKit";
104 | path = CocoaChainKit;
105 | sourceTree = "";
106 | };
107 | 607FACD31AFB9204008FA782 /* Supporting Files */ = {
108 | isa = PBXGroup;
109 | children = (
110 | 607FACD41AFB9204008FA782 /* Info.plist */,
111 | );
112 | name = "Supporting Files";
113 | sourceTree = "";
114 | };
115 | 607FACE81AFB9204008FA782 /* Tests */ = {
116 | isa = PBXGroup;
117 | children = (
118 | 607FACEB1AFB9204008FA782 /* Tests.swift */,
119 | 607FACE91AFB9204008FA782 /* Supporting Files */,
120 | );
121 | path = Tests;
122 | sourceTree = "";
123 | };
124 | 607FACE91AFB9204008FA782 /* Supporting Files */ = {
125 | isa = PBXGroup;
126 | children = (
127 | 607FACEA1AFB9204008FA782 /* Info.plist */,
128 | );
129 | name = "Supporting Files";
130 | sourceTree = "";
131 | };
132 | 607FACF51AFB993E008FA782 /* Podspec Metadata */ = {
133 | isa = PBXGroup;
134 | children = (
135 | 3E7A827D7EEC97F8D413A0A2 /* CocoaChainKit.podspec */,
136 | 2E85C7E5B55A830368DFA1F2 /* README.md */,
137 | 4867660C0735A9EB705259F5 /* LICENSE */,
138 | );
139 | name = "Podspec Metadata";
140 | sourceTree = "";
141 | };
142 | 7C74B3A0897F984AAA46486B /* Frameworks */ = {
143 | isa = PBXGroup;
144 | children = (
145 | B0EA80AFA37335D22311DE8D /* Pods_CocoaChainKit_Example.framework */,
146 | E7A6CFB18269B6085343EB20 /* Pods_CocoaChainKit_Tests.framework */,
147 | );
148 | name = Frameworks;
149 | sourceTree = "";
150 | };
151 | A247A261C75642D97CCECBA0 /* Pods */ = {
152 | isa = PBXGroup;
153 | children = (
154 | 4AE03E8D0B55B46921E93EB7 /* Pods-CocoaChainKit_Example.debug.xcconfig */,
155 | EDFAD5D3952E9C58C1BA967A /* Pods-CocoaChainKit_Example.release.xcconfig */,
156 | 19E2FF6B1A6B19E53B6BF062 /* Pods-CocoaChainKit_Tests.debug.xcconfig */,
157 | 202BD38E687EBEB9D2EBFDD9 /* Pods-CocoaChainKit_Tests.release.xcconfig */,
158 | );
159 | name = Pods;
160 | sourceTree = "";
161 | };
162 | /* End PBXGroup section */
163 |
164 | /* Begin PBXNativeTarget section */
165 | 607FACCF1AFB9204008FA782 /* CocoaChainKit_Example */ = {
166 | isa = PBXNativeTarget;
167 | buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "CocoaChainKit_Example" */;
168 | buildPhases = (
169 | 4B675787BE54A9D219A4BE71 /* [CP] Check Pods Manifest.lock */,
170 | 607FACCC1AFB9204008FA782 /* Sources */,
171 | 607FACCD1AFB9204008FA782 /* Frameworks */,
172 | 607FACCE1AFB9204008FA782 /* Resources */,
173 | 44705D6323E27AF3A8CFDED4 /* [CP] Embed Pods Frameworks */,
174 | );
175 | buildRules = (
176 | );
177 | dependencies = (
178 | );
179 | name = CocoaChainKit_Example;
180 | productName = CocoaChainKit;
181 | productReference = 607FACD01AFB9204008FA782 /* CocoaChainKit_Example.app */;
182 | productType = "com.apple.product-type.application";
183 | };
184 | 607FACE41AFB9204008FA782 /* CocoaChainKit_Tests */ = {
185 | isa = PBXNativeTarget;
186 | buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "CocoaChainKit_Tests" */;
187 | buildPhases = (
188 | 0CC233166A36BA2A716C67F9 /* [CP] Check Pods Manifest.lock */,
189 | 607FACE11AFB9204008FA782 /* Sources */,
190 | 607FACE21AFB9204008FA782 /* Frameworks */,
191 | 607FACE31AFB9204008FA782 /* Resources */,
192 | );
193 | buildRules = (
194 | );
195 | dependencies = (
196 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */,
197 | );
198 | name = CocoaChainKit_Tests;
199 | productName = Tests;
200 | productReference = 607FACE51AFB9204008FA782 /* CocoaChainKit_Tests.xctest */;
201 | productType = "com.apple.product-type.bundle.unit-test";
202 | };
203 | /* End PBXNativeTarget section */
204 |
205 | /* Begin PBXProject section */
206 | 607FACC81AFB9204008FA782 /* Project object */ = {
207 | isa = PBXProject;
208 | attributes = {
209 | LastSwiftUpdateCheck = 0830;
210 | LastUpgradeCheck = 0940;
211 | ORGANIZATIONNAME = CocoaPods;
212 | TargetAttributes = {
213 | 607FACCF1AFB9204008FA782 = {
214 | CreatedOnToolsVersion = 6.3.1;
215 | LastSwiftMigration = 1000;
216 | };
217 | 607FACE41AFB9204008FA782 = {
218 | CreatedOnToolsVersion = 6.3.1;
219 | LastSwiftMigration = 1000;
220 | TestTargetID = 607FACCF1AFB9204008FA782;
221 | };
222 | };
223 | };
224 | buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "CocoaChainKit" */;
225 | compatibilityVersion = "Xcode 3.2";
226 | developmentRegion = English;
227 | hasScannedForEncodings = 0;
228 | knownRegions = (
229 | en,
230 | Base,
231 | );
232 | mainGroup = 607FACC71AFB9204008FA782;
233 | productRefGroup = 607FACD11AFB9204008FA782 /* Products */;
234 | projectDirPath = "";
235 | projectRoot = "";
236 | targets = (
237 | 607FACCF1AFB9204008FA782 /* CocoaChainKit_Example */,
238 | 607FACE41AFB9204008FA782 /* CocoaChainKit_Tests */,
239 | );
240 | };
241 | /* End PBXProject section */
242 |
243 | /* Begin PBXResourcesBuildPhase section */
244 | 607FACCE1AFB9204008FA782 /* Resources */ = {
245 | isa = PBXResourcesBuildPhase;
246 | buildActionMask = 2147483647;
247 | files = (
248 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */,
249 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */,
250 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */,
251 | );
252 | runOnlyForDeploymentPostprocessing = 0;
253 | };
254 | 607FACE31AFB9204008FA782 /* Resources */ = {
255 | isa = PBXResourcesBuildPhase;
256 | buildActionMask = 2147483647;
257 | files = (
258 | );
259 | runOnlyForDeploymentPostprocessing = 0;
260 | };
261 | /* End PBXResourcesBuildPhase section */
262 |
263 | /* Begin PBXShellScriptBuildPhase section */
264 | 0CC233166A36BA2A716C67F9 /* [CP] Check Pods Manifest.lock */ = {
265 | isa = PBXShellScriptBuildPhase;
266 | buildActionMask = 2147483647;
267 | files = (
268 | );
269 | inputPaths = (
270 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
271 | "${PODS_ROOT}/Manifest.lock",
272 | );
273 | name = "[CP] Check Pods Manifest.lock";
274 | outputPaths = (
275 | "$(DERIVED_FILE_DIR)/Pods-CocoaChainKit_Tests-checkManifestLockResult.txt",
276 | );
277 | runOnlyForDeploymentPostprocessing = 0;
278 | shellPath = /bin/sh;
279 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/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# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
280 | showEnvVarsInLog = 0;
281 | };
282 | 44705D6323E27AF3A8CFDED4 /* [CP] Embed Pods Frameworks */ = {
283 | isa = PBXShellScriptBuildPhase;
284 | buildActionMask = 2147483647;
285 | files = (
286 | );
287 | inputPaths = (
288 | "${PODS_ROOT}/Target Support Files/Pods-CocoaChainKit_Example/Pods-CocoaChainKit_Example-frameworks.sh",
289 | "${BUILT_PRODUCTS_DIR}/CocoaChainKit/CocoaChainKit.framework",
290 | );
291 | name = "[CP] Embed Pods Frameworks";
292 | outputPaths = (
293 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CocoaChainKit.framework",
294 | );
295 | runOnlyForDeploymentPostprocessing = 0;
296 | shellPath = /bin/sh;
297 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CocoaChainKit_Example/Pods-CocoaChainKit_Example-frameworks.sh\"\n";
298 | showEnvVarsInLog = 0;
299 | };
300 | 4B675787BE54A9D219A4BE71 /* [CP] Check Pods Manifest.lock */ = {
301 | isa = PBXShellScriptBuildPhase;
302 | buildActionMask = 2147483647;
303 | files = (
304 | );
305 | inputPaths = (
306 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
307 | "${PODS_ROOT}/Manifest.lock",
308 | );
309 | name = "[CP] Check Pods Manifest.lock";
310 | outputPaths = (
311 | "$(DERIVED_FILE_DIR)/Pods-CocoaChainKit_Example-checkManifestLockResult.txt",
312 | );
313 | runOnlyForDeploymentPostprocessing = 0;
314 | shellPath = /bin/sh;
315 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/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# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
316 | showEnvVarsInLog = 0;
317 | };
318 | /* End PBXShellScriptBuildPhase section */
319 |
320 | /* Begin PBXSourcesBuildPhase section */
321 | 607FACCC1AFB9204008FA782 /* Sources */ = {
322 | isa = PBXSourcesBuildPhase;
323 | buildActionMask = 2147483647;
324 | files = (
325 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */,
326 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */,
327 | );
328 | runOnlyForDeploymentPostprocessing = 0;
329 | };
330 | 607FACE11AFB9204008FA782 /* Sources */ = {
331 | isa = PBXSourcesBuildPhase;
332 | buildActionMask = 2147483647;
333 | files = (
334 | 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */,
335 | );
336 | runOnlyForDeploymentPostprocessing = 0;
337 | };
338 | /* End PBXSourcesBuildPhase section */
339 |
340 | /* Begin PBXTargetDependency section */
341 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */ = {
342 | isa = PBXTargetDependency;
343 | target = 607FACCF1AFB9204008FA782 /* CocoaChainKit_Example */;
344 | targetProxy = 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */;
345 | };
346 | /* End PBXTargetDependency section */
347 |
348 | /* Begin PBXVariantGroup section */
349 | 607FACD91AFB9204008FA782 /* Main.storyboard */ = {
350 | isa = PBXVariantGroup;
351 | children = (
352 | 607FACDA1AFB9204008FA782 /* Base */,
353 | );
354 | name = Main.storyboard;
355 | sourceTree = "";
356 | };
357 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = {
358 | isa = PBXVariantGroup;
359 | children = (
360 | 607FACDF1AFB9204008FA782 /* Base */,
361 | );
362 | name = LaunchScreen.xib;
363 | sourceTree = "";
364 | };
365 | /* End PBXVariantGroup section */
366 |
367 | /* Begin XCBuildConfiguration section */
368 | 607FACED1AFB9204008FA782 /* Debug */ = {
369 | isa = XCBuildConfiguration;
370 | buildSettings = {
371 | ALWAYS_SEARCH_USER_PATHS = NO;
372 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
373 | CLANG_CXX_LIBRARY = "libc++";
374 | CLANG_ENABLE_MODULES = YES;
375 | CLANG_ENABLE_OBJC_ARC = YES;
376 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
377 | CLANG_WARN_BOOL_CONVERSION = YES;
378 | CLANG_WARN_COMMA = YES;
379 | CLANG_WARN_CONSTANT_CONVERSION = YES;
380 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
381 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
382 | CLANG_WARN_EMPTY_BODY = YES;
383 | CLANG_WARN_ENUM_CONVERSION = YES;
384 | CLANG_WARN_INFINITE_RECURSION = YES;
385 | CLANG_WARN_INT_CONVERSION = YES;
386 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
387 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
388 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
389 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
390 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
391 | CLANG_WARN_STRICT_PROTOTYPES = YES;
392 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
393 | CLANG_WARN_UNREACHABLE_CODE = YES;
394 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
395 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
396 | COPY_PHASE_STRIP = NO;
397 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
398 | ENABLE_STRICT_OBJC_MSGSEND = YES;
399 | ENABLE_TESTABILITY = YES;
400 | GCC_C_LANGUAGE_STANDARD = gnu99;
401 | GCC_DYNAMIC_NO_PIC = NO;
402 | GCC_NO_COMMON_BLOCKS = YES;
403 | GCC_OPTIMIZATION_LEVEL = 0;
404 | GCC_PREPROCESSOR_DEFINITIONS = (
405 | "DEBUG=1",
406 | "$(inherited)",
407 | );
408 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
409 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
410 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
411 | GCC_WARN_UNDECLARED_SELECTOR = YES;
412 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
413 | GCC_WARN_UNUSED_FUNCTION = YES;
414 | GCC_WARN_UNUSED_VARIABLE = YES;
415 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
416 | MTL_ENABLE_DEBUG_INFO = YES;
417 | ONLY_ACTIVE_ARCH = YES;
418 | SDKROOT = iphoneos;
419 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
420 | };
421 | name = Debug;
422 | };
423 | 607FACEE1AFB9204008FA782 /* Release */ = {
424 | isa = XCBuildConfiguration;
425 | buildSettings = {
426 | ALWAYS_SEARCH_USER_PATHS = NO;
427 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
428 | CLANG_CXX_LIBRARY = "libc++";
429 | CLANG_ENABLE_MODULES = YES;
430 | CLANG_ENABLE_OBJC_ARC = YES;
431 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
432 | CLANG_WARN_BOOL_CONVERSION = YES;
433 | CLANG_WARN_COMMA = YES;
434 | CLANG_WARN_CONSTANT_CONVERSION = YES;
435 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
436 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
437 | CLANG_WARN_EMPTY_BODY = YES;
438 | CLANG_WARN_ENUM_CONVERSION = YES;
439 | CLANG_WARN_INFINITE_RECURSION = YES;
440 | CLANG_WARN_INT_CONVERSION = YES;
441 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
442 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
443 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
444 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
445 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
446 | CLANG_WARN_STRICT_PROTOTYPES = YES;
447 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
448 | CLANG_WARN_UNREACHABLE_CODE = YES;
449 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
450 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
451 | COPY_PHASE_STRIP = NO;
452 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
453 | ENABLE_NS_ASSERTIONS = NO;
454 | ENABLE_STRICT_OBJC_MSGSEND = YES;
455 | GCC_C_LANGUAGE_STANDARD = gnu99;
456 | GCC_NO_COMMON_BLOCKS = YES;
457 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
458 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
459 | GCC_WARN_UNDECLARED_SELECTOR = YES;
460 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
461 | GCC_WARN_UNUSED_FUNCTION = YES;
462 | GCC_WARN_UNUSED_VARIABLE = YES;
463 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
464 | MTL_ENABLE_DEBUG_INFO = NO;
465 | SDKROOT = iphoneos;
466 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
467 | VALIDATE_PRODUCT = YES;
468 | };
469 | name = Release;
470 | };
471 | 607FACF01AFB9204008FA782 /* Debug */ = {
472 | isa = XCBuildConfiguration;
473 | baseConfigurationReference = 4AE03E8D0B55B46921E93EB7 /* Pods-CocoaChainKit_Example.debug.xcconfig */;
474 | buildSettings = {
475 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
476 | INFOPLIST_FILE = CocoaChainKit/Info.plist;
477 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
478 | MODULE_NAME = ExampleApp;
479 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
480 | PRODUCT_NAME = "$(TARGET_NAME)";
481 | SWIFT_VERSION = 4.2;
482 | };
483 | name = Debug;
484 | };
485 | 607FACF11AFB9204008FA782 /* Release */ = {
486 | isa = XCBuildConfiguration;
487 | baseConfigurationReference = EDFAD5D3952E9C58C1BA967A /* Pods-CocoaChainKit_Example.release.xcconfig */;
488 | buildSettings = {
489 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
490 | INFOPLIST_FILE = CocoaChainKit/Info.plist;
491 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
492 | MODULE_NAME = ExampleApp;
493 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
494 | PRODUCT_NAME = "$(TARGET_NAME)";
495 | SWIFT_VERSION = 4.2;
496 | };
497 | name = Release;
498 | };
499 | 607FACF31AFB9204008FA782 /* Debug */ = {
500 | isa = XCBuildConfiguration;
501 | baseConfigurationReference = 19E2FF6B1A6B19E53B6BF062 /* Pods-CocoaChainKit_Tests.debug.xcconfig */;
502 | buildSettings = {
503 | FRAMEWORK_SEARCH_PATHS = "$(inherited)";
504 | GCC_PREPROCESSOR_DEFINITIONS = (
505 | "DEBUG=1",
506 | "$(inherited)",
507 | );
508 | INFOPLIST_FILE = Tests/Info.plist;
509 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
510 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
511 | PRODUCT_NAME = "$(TARGET_NAME)";
512 | SWIFT_VERSION = 4.2;
513 | };
514 | name = Debug;
515 | };
516 | 607FACF41AFB9204008FA782 /* Release */ = {
517 | isa = XCBuildConfiguration;
518 | baseConfigurationReference = 202BD38E687EBEB9D2EBFDD9 /* Pods-CocoaChainKit_Tests.release.xcconfig */;
519 | buildSettings = {
520 | FRAMEWORK_SEARCH_PATHS = "$(inherited)";
521 | INFOPLIST_FILE = Tests/Info.plist;
522 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
523 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
524 | PRODUCT_NAME = "$(TARGET_NAME)";
525 | SWIFT_VERSION = 4.2;
526 | };
527 | name = Release;
528 | };
529 | /* End XCBuildConfiguration section */
530 |
531 | /* Begin XCConfigurationList section */
532 | 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "CocoaChainKit" */ = {
533 | isa = XCConfigurationList;
534 | buildConfigurations = (
535 | 607FACED1AFB9204008FA782 /* Debug */,
536 | 607FACEE1AFB9204008FA782 /* Release */,
537 | );
538 | defaultConfigurationIsVisible = 0;
539 | defaultConfigurationName = Release;
540 | };
541 | 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "CocoaChainKit_Example" */ = {
542 | isa = XCConfigurationList;
543 | buildConfigurations = (
544 | 607FACF01AFB9204008FA782 /* Debug */,
545 | 607FACF11AFB9204008FA782 /* Release */,
546 | );
547 | defaultConfigurationIsVisible = 0;
548 | defaultConfigurationName = Release;
549 | };
550 | 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "CocoaChainKit_Tests" */ = {
551 | isa = XCConfigurationList;
552 | buildConfigurations = (
553 | 607FACF31AFB9204008FA782 /* Debug */,
554 | 607FACF41AFB9204008FA782 /* Release */,
555 | );
556 | defaultConfigurationIsVisible = 0;
557 | defaultConfigurationName = Release;
558 | };
559 | /* End XCConfigurationList section */
560 | };
561 | rootObject = 607FACC81AFB9204008FA782 /* Project object */;
562 | }
563 |
--------------------------------------------------------------------------------
/Example/CocoaChainKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Example/CocoaChainKit.xcodeproj/xcuserdata/pircate.xcuserdatad/xcschemes/CocoaChainKit-Example.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
47 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
65 |
66 |
67 |
68 |
78 |
80 |
86 |
87 |
88 |
89 |
90 |
91 |
97 |
99 |
105 |
106 |
107 |
108 |
110 |
111 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/Example/CocoaChainKit.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Example/CocoaChainKit/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // CocoaChainKit
4 | //
5 | // Created by G-Xi0N on 05/08/2018.
6 | // Copyright (c) 2018 G-Xi0N. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 |
17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
18 | // Override point for customization after application launch.
19 | return true
20 | }
21 |
22 | func applicationWillResignActive(_ application: UIApplication) {
23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
25 | }
26 |
27 | func applicationDidEnterBackground(_ application: UIApplication) {
28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30 | }
31 |
32 | func applicationWillEnterForeground(_ application: UIApplication) {
33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
34 | }
35 |
36 | func applicationDidBecomeActive(_ application: UIApplication) {
37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38 | }
39 |
40 | func applicationWillTerminate(_ application: UIApplication) {
41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42 | }
43 |
44 |
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/Example/CocoaChainKit/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
25 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/Example/CocoaChainKit/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/Example/CocoaChainKit/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ios-marketing",
45 | "size" : "1024x1024",
46 | "scale" : "1x"
47 | }
48 | ],
49 | "info" : {
50 | "version" : 1,
51 | "author" : "xcode"
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/Example/CocoaChainKit/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/Example/CocoaChainKit/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // CocoaChainKit
4 | //
5 | // Created by G-Xi0N on 05/08/2018.
6 | // Copyright (c) 2018 G-Xi0N. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import CocoaChainKit
11 |
12 | class ViewController: UIViewController {
13 |
14 | private lazy var button: UIButton = {
15 | UIButton(type: .custom).chain
16 | .frame(x: 0, y: 0, width: 120, height: 30)
17 | .center(view.center)
18 | .backgroundColor(UIColor.red)
19 | .systemFont(ofSize: 14)
20 | .title("Hello World", for: .normal)
21 | .titleColor(UIColor.blue, for: .normal, .highlighted)
22 | .cornerRadius(15)
23 | .masksToBounds(true)
24 | .addTarget(self, action: #selector(buttonAction), for: .touchUpInside).build
25 | }()
26 |
27 | private lazy var tableView: UITableView = {
28 | UITableView(frame: view.bounds, style: .plain).chain
29 | .rowHeight(44)
30 | .register(UITableViewCell.self, forCellReuseIdentifier: "cellID").build
31 | }()
32 |
33 | private lazy var collectionView: UICollectionView = {
34 | let flowLayout = UICollectionViewFlowLayout().chain
35 | .itemSize(width: 80, height: 80)
36 | .minimumLineSpacing(20)
37 | .minimumInteritemSpacing(10).build
38 | return UICollectionView(frame: CGRect.zero, collectionViewLayout: flowLayout).chain
39 | .backgroundColor(UIColor.white)
40 | .register(UICollectionViewCell.self, forCellWithReuseIdentifier: "cellID")
41 | .register(UICollectionReusableView.self, forSectionHeaderWithReuseIdentifier: "header").build
42 | }()
43 |
44 | override func viewDidLoad() {
45 | super.viewDidLoad()
46 |
47 | view.addSubview(tableView)
48 | view.addSubview(button)
49 |
50 | let attrText = NSMutableAttributedString(string: "Hello World").chain
51 | .systemFont(ofSize: 18)
52 | .foregroundColor(UIColor.yellow, range: NSMakeRange(0, 5))
53 | .backgroundColor(UIColor.blue)
54 | .baselineOffset(5, range: NSMakeRange(6, 5))
55 | .kern(0.5)
56 | .strikethroughStyle(1)
57 | .underlineStyle(1)
58 | .writingDirection([3]).build
59 | button.setAttributedTitle(attrText, for: .normal)
60 |
61 | UserDefaults.standard.chain
62 | .set(123, forKey: "integer")
63 | .set("string", forKey: "string")
64 | .set(false, forKey: "boolean")
65 | .synchronize()
66 |
67 | debugPrint(UserDefaults.standard.integer(forKey: "integer"))
68 | debugPrint(UserDefaults.standard.string(forKey: "string") ?? "")
69 | debugPrint(UserDefaults.standard.bool(forKey: "boolean"))
70 |
71 | DateFormatter().chain
72 | .dateFormat("")
73 | .dateStyle(.full)
74 | .timeZone(.current)
75 |
76 | let name0 = Notification.Name("notification0")
77 | let name1 = Notification.Name("notification1")
78 | let name2 = Notification.Name("notification2")
79 |
80 | NotificationCenter.default.chain
81 | .addObserver(self, selector: #selector(notificationAction0), name: name0)
82 | .addObserver(self, selector: #selector(notificationAction2), name: name2)
83 | .addObserver(self, selector: #selector(notificationAction1), name: name1)
84 |
85 | NotificationCenter.default.chain
86 | .post(name: name1)
87 | .post(Notification(name: name2))
88 | .post(name: name0)
89 | }
90 |
91 | override func didReceiveMemoryWarning() {
92 | super.didReceiveMemoryWarning()
93 | // Dispose of any resources that can be recreated.
94 | }
95 |
96 | @objc private func buttonAction() {
97 | debugPrint("Hello World")
98 | }
99 |
100 | @objc private func notificationAction0() {
101 | debugPrint("notificationAction0")
102 | }
103 |
104 | @objc private func notificationAction1() {
105 | debugPrint("notificationAction1")
106 | }
107 |
108 | @objc private func notificationAction2() {
109 | debugPrint("notificationAction2")
110 | }
111 | }
112 |
113 |
--------------------------------------------------------------------------------
/Example/Podfile:
--------------------------------------------------------------------------------
1 | use_frameworks!
2 |
3 | target 'CocoaChainKit_Example' do
4 | pod 'CocoaChainKit', :path => '../'
5 |
6 | target 'CocoaChainKit_Tests' do
7 | inherit! :search_paths
8 |
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/Example/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - CocoaChainKit (0.6.3)
3 |
4 | DEPENDENCIES:
5 | - CocoaChainKit (from `../`)
6 |
7 | EXTERNAL SOURCES:
8 | CocoaChainKit:
9 | :path: "../"
10 |
11 | SPEC CHECKSUMS:
12 | CocoaChainKit: d82a4dbb94fbd8b9752d5d3c7e57bb85e7c54159
13 |
14 | PODFILE CHECKSUM: 12afcce9d65f9e256f5bcf0764b58231e749e1c1
15 |
16 | COCOAPODS: 1.6.0.beta.2
17 |
--------------------------------------------------------------------------------
/Example/Pods/Local Podspecs/CocoaChainKit.podspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "CocoaChainKit",
3 | "version": "0.6.3",
4 | "summary": "一款链式调用框架.",
5 | "homepage": "https://github.com/Pircate/CocoaChainKit",
6 | "license": {
7 | "type": "MIT",
8 | "file": "LICENSE"
9 | },
10 | "authors": {
11 | "Pircate": "gao497868860@163.com"
12 | },
13 | "source": {
14 | "git": "https://github.com/Pircate/CocoaChainKit.git",
15 | "tag": "0.6.3"
16 | },
17 | "platforms": {
18 | "ios": "9.0"
19 | },
20 | "swift_version": "4.2",
21 | "source_files": "CocoaChainKit/Classes/**/*",
22 | "frameworks": "UIKit"
23 | }
24 |
--------------------------------------------------------------------------------
/Example/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - CocoaChainKit (0.6.3)
3 |
4 | DEPENDENCIES:
5 | - CocoaChainKit (from `../`)
6 |
7 | EXTERNAL SOURCES:
8 | CocoaChainKit:
9 | :path: "../"
10 |
11 | SPEC CHECKSUMS:
12 | CocoaChainKit: d82a4dbb94fbd8b9752d5d3c7e57bb85e7c54159
13 |
14 | PODFILE CHECKSUM: 12afcce9d65f9e256f5bcf0764b58231e749e1c1
15 |
16 | COCOAPODS: 1.6.0.beta.2
17 |
--------------------------------------------------------------------------------
/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/CocoaChainKit.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
66 |
67 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/Example/Pods/Pods.xcodeproj/xcuserdata/pircate.xcuserdatad/xcschemes/CocoaChainKit.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/CocoaChainKit/CocoaChainKit-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 0.6.3
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/CocoaChainKit/CocoaChainKit-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_CocoaChainKit : NSObject
3 | @end
4 | @implementation PodsDummy_CocoaChainKit
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/CocoaChainKit/CocoaChainKit-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/CocoaChainKit/CocoaChainKit-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double CocoaChainKitVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char CocoaChainKitVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/CocoaChainKit/CocoaChainKit.modulemap:
--------------------------------------------------------------------------------
1 | framework module CocoaChainKit {
2 | umbrella header "CocoaChainKit-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/CocoaChainKit/CocoaChainKit.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/CocoaChainKit
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | OTHER_LDFLAGS = $(inherited) -framework "UIKit"
4 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
5 | PODS_BUILD_DIR = ${BUILD_DIR}
6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_ROOT = ${SRCROOT}
8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../..
9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
10 | SKIP_INSTALL = YES
11 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/CocoaChainKit/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 0.6.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-CocoaChainKit_Example/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-CocoaChainKit_Example/Pods-CocoaChainKit_Example-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-CocoaChainKit_Example/Pods-CocoaChainKit_Example-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## CocoaChainKit
5 |
6 | Copyright (c) 2018 G-Xi0N
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining a copy
9 | of this software and associated documentation files (the "Software"), to deal
10 | in the Software without restriction, including without limitation the rights
11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | copies of the Software, and to permit persons to whom the Software is
13 | furnished to do so, subject to the following conditions:
14 |
15 | The above copyright notice and this permission notice shall be included in
16 | all copies or substantial portions of the Software.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 | THE SOFTWARE.
25 |
26 | Generated by CocoaPods - https://cocoapods.org
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-CocoaChainKit_Example/Pods-CocoaChainKit_Example-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | Copyright (c) 2018 G-Xi0N <gao497868860@163.com>
18 |
19 | Permission is hereby granted, free of charge, to any person obtaining a copy
20 | of this software and associated documentation files (the "Software"), to deal
21 | in the Software without restriction, including without limitation the rights
22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23 | copies of the Software, and to permit persons to whom the Software is
24 | furnished to do so, subject to the following conditions:
25 |
26 | The above copyright notice and this permission notice shall be included in
27 | all copies or substantial portions of the Software.
28 |
29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
35 | THE SOFTWARE.
36 |
37 | License
38 | MIT
39 | Title
40 | CocoaChainKit
41 | Type
42 | PSGroupSpecifier
43 |
44 |
45 | FooterText
46 | Generated by CocoaPods - https://cocoapods.org
47 | Title
48 |
49 | Type
50 | PSGroupSpecifier
51 |
52 |
53 | StringsTable
54 | Acknowledgements
55 | Title
56 | Acknowledgements
57 |
58 |
59 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-CocoaChainKit_Example/Pods-CocoaChainKit_Example-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_CocoaChainKit_Example : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_CocoaChainKit_Example
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-CocoaChainKit_Example/Pods-CocoaChainKit_Example-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 | set -u
4 | set -o pipefail
5 |
6 | function on_error {
7 | echo "$(realpath -mq "${0}"):$1: error: Unexpected failure"
8 | }
9 | trap 'on_error $LINENO' ERR
10 |
11 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
12 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
13 | # frameworks to, so exit 0 (signalling the script phase was successful).
14 | exit 0
15 | fi
16 |
17 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
18 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
19 |
20 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}"
21 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
22 |
23 | # Used as a return value for each invocation of `strip_invalid_archs` function.
24 | STRIP_BINARY_RETVAL=0
25 |
26 | # This protects against multiple targets copying the same framework dependency at the same time. The solution
27 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
28 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
29 |
30 | # Copies and strips a vendored framework
31 | install_framework()
32 | {
33 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
34 | local source="${BUILT_PRODUCTS_DIR}/$1"
35 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
36 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
37 | elif [ -r "$1" ]; then
38 | local source="$1"
39 | fi
40 |
41 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
42 |
43 | if [ -L "${source}" ]; then
44 | echo "Symlinked..."
45 | source="$(readlink "${source}")"
46 | fi
47 |
48 | # Use filter instead of exclude so missing patterns don't throw errors.
49 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
50 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
51 |
52 | local basename
53 | basename="$(basename -s .framework "$1")"
54 | binary="${destination}/${basename}.framework/${basename}"
55 |
56 | if ! [ -r "$binary" ]; then
57 | binary="${destination}/${basename}"
58 | elif [ -L "${binary}" ]; then
59 | echo "Destination binary is symlinked..."
60 | dirname="$(dirname "${binary}")"
61 | binary="${dirname}/$(readlink "${binary}")"
62 | fi
63 |
64 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
65 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
66 | strip_invalid_archs "$binary"
67 | fi
68 |
69 | # Resign the code if required by the build settings to avoid unstable apps
70 | code_sign_if_enabled "${destination}/$(basename "$1")"
71 |
72 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
73 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
74 | local swift_runtime_libs
75 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u)
76 | for lib in $swift_runtime_libs; do
77 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
78 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
79 | code_sign_if_enabled "${destination}/${lib}"
80 | done
81 | fi
82 | }
83 |
84 | # Copies and strips a vendored dSYM
85 | install_dsym() {
86 | local source="$1"
87 | if [ -r "$source" ]; then
88 | # Copy the dSYM into a the targets temp dir.
89 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\""
90 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}"
91 |
92 | local basename
93 | basename="$(basename -s .framework.dSYM "$source")"
94 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}"
95 |
96 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
97 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then
98 | strip_invalid_archs "$binary"
99 | fi
100 |
101 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then
102 | # Move the stripped file into its final destination.
103 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\""
104 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
105 | else
106 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
107 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM"
108 | fi
109 | fi
110 | }
111 |
112 | # Signs a framework with the provided identity
113 | code_sign_if_enabled() {
114 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
115 | # Use the current code_sign_identity
116 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
117 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
118 |
119 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
120 | code_sign_cmd="$code_sign_cmd &"
121 | fi
122 | echo "$code_sign_cmd"
123 | eval "$code_sign_cmd"
124 | fi
125 | }
126 |
127 | # Strip invalid architectures
128 | strip_invalid_archs() {
129 | binary="$1"
130 | # Get architectures for current target binary
131 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
132 | # Intersect them with the architectures we are building for
133 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
134 | # If there are no archs supported by this binary then warn the user
135 | if [[ -z "$intersected_archs" ]]; then
136 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
137 | STRIP_BINARY_RETVAL=0
138 | return
139 | fi
140 | stripped=""
141 | for arch in $binary_archs; do
142 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then
143 | # Strip non-valid architectures in-place
144 | lipo -remove "$arch" -output "$binary" "$binary"
145 | stripped="$stripped $arch"
146 | fi
147 | done
148 | if [[ "$stripped" ]]; then
149 | echo "Stripped $binary of architectures:$stripped"
150 | fi
151 | STRIP_BINARY_RETVAL=1
152 | }
153 |
154 |
155 | if [[ "$CONFIGURATION" == "Debug" ]]; then
156 | install_framework "${BUILT_PRODUCTS_DIR}/CocoaChainKit/CocoaChainKit.framework"
157 | fi
158 | if [[ "$CONFIGURATION" == "Release" ]]; then
159 | install_framework "${BUILT_PRODUCTS_DIR}/CocoaChainKit/CocoaChainKit.framework"
160 | fi
161 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
162 | wait
163 | fi
164 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-CocoaChainKit_Example/Pods-CocoaChainKit_Example-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 | set -u
4 | set -o pipefail
5 |
6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then
7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy
8 | # resources to, so exit 0 (signalling the script phase was successful).
9 | exit 0
10 | fi
11 |
12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
13 |
14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
15 | > "$RESOURCES_TO_COPY"
16 |
17 | XCASSET_FILES=()
18 |
19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution
20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
22 |
23 | case "${TARGETED_DEVICE_FAMILY:-}" in
24 | 1,2)
25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
26 | ;;
27 | 1)
28 | TARGET_DEVICE_ARGS="--target-device iphone"
29 | ;;
30 | 2)
31 | TARGET_DEVICE_ARGS="--target-device ipad"
32 | ;;
33 | 3)
34 | TARGET_DEVICE_ARGS="--target-device tv"
35 | ;;
36 | 4)
37 | TARGET_DEVICE_ARGS="--target-device watch"
38 | ;;
39 | *)
40 | TARGET_DEVICE_ARGS="--target-device mac"
41 | ;;
42 | esac
43 |
44 | install_resource()
45 | {
46 | if [[ "$1" = /* ]] ; then
47 | RESOURCE_PATH="$1"
48 | else
49 | RESOURCE_PATH="${PODS_ROOT}/$1"
50 | fi
51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then
52 | cat << EOM
53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
54 | EOM
55 | exit 1
56 | fi
57 | case $RESOURCE_PATH in
58 | *.storyboard)
59 | 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}" || true
60 | 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}
61 | ;;
62 | *.xib)
63 | 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}" || true
64 | 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}
65 | ;;
66 | *.framework)
67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
71 | ;;
72 | *.xcdatamodel)
73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true
74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
75 | ;;
76 | *.xcdatamodeld)
77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true
78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
79 | ;;
80 | *.xcmappingmodel)
81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true
82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
83 | ;;
84 | *.xcassets)
85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
87 | ;;
88 | *)
89 | echo "$RESOURCE_PATH" || true
90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
91 | ;;
92 | esac
93 | }
94 |
95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
100 | fi
101 | rm -f "$RESOURCES_TO_COPY"
102 |
103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ]
104 | then
105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
107 | while read line; do
108 | if [[ $line != "${PODS_ROOT}*" ]]; then
109 | XCASSET_FILES+=("$line")
110 | fi
111 | done <<<"$OTHER_XCASSETS"
112 |
113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then
114 | 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}"
115 | else
116 | 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}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist"
117 | fi
118 | fi
119 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-CocoaChainKit_Example/Pods-CocoaChainKit_Example-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double Pods_CocoaChainKit_ExampleVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_CocoaChainKit_ExampleVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-CocoaChainKit_Example/Pods-CocoaChainKit_Example.debug.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaChainKit"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaChainKit/CocoaChainKit.framework/Headers"
5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
6 | OTHER_LDFLAGS = $(inherited) -framework "CocoaChainKit" -framework "UIKit"
7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
8 | PODS_BUILD_DIR = ${BUILD_DIR}
9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
11 | PODS_ROOT = ${SRCROOT}/Pods
12 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-CocoaChainKit_Example/Pods-CocoaChainKit_Example.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_CocoaChainKit_Example {
2 | umbrella header "Pods-CocoaChainKit_Example-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-CocoaChainKit_Example/Pods-CocoaChainKit_Example.release.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaChainKit"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaChainKit/CocoaChainKit.framework/Headers"
5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
6 | OTHER_LDFLAGS = $(inherited) -framework "CocoaChainKit" -framework "UIKit"
7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
8 | PODS_BUILD_DIR = ${BUILD_DIR}
9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
11 | PODS_ROOT = ${SRCROOT}/Pods
12 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-CocoaChainKit_Tests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-CocoaChainKit_Tests/Pods-CocoaChainKit_Tests-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-CocoaChainKit_Tests/Pods-CocoaChainKit_Tests-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 | Generated by CocoaPods - https://cocoapods.org
4 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-CocoaChainKit_Tests/Pods-CocoaChainKit_Tests-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | Generated by CocoaPods - https://cocoapods.org
18 | Title
19 |
20 | Type
21 | PSGroupSpecifier
22 |
23 |
24 | StringsTable
25 | Acknowledgements
26 | Title
27 | Acknowledgements
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-CocoaChainKit_Tests/Pods-CocoaChainKit_Tests-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_CocoaChainKit_Tests : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_CocoaChainKit_Tests
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-CocoaChainKit_Tests/Pods-CocoaChainKit_Tests-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 | set -u
4 | set -o pipefail
5 |
6 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
7 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
8 | # frameworks to, so exit 0 (signalling the script phase was successful).
9 | exit 0
10 | fi
11 |
12 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
13 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
14 |
15 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}"
16 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
17 |
18 | # Used as a return value for each invocation of `strip_invalid_archs` function.
19 | STRIP_BINARY_RETVAL=0
20 |
21 | # This protects against multiple targets copying the same framework dependency at the same time. The solution
22 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
23 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
24 |
25 | # Copies and strips a vendored framework
26 | install_framework()
27 | {
28 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
29 | local source="${BUILT_PRODUCTS_DIR}/$1"
30 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
31 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
32 | elif [ -r "$1" ]; then
33 | local source="$1"
34 | fi
35 |
36 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
37 |
38 | if [ -L "${source}" ]; then
39 | echo "Symlinked..."
40 | source="$(readlink "${source}")"
41 | fi
42 |
43 | # Use filter instead of exclude so missing patterns don't throw errors.
44 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
45 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
46 |
47 | local basename
48 | basename="$(basename -s .framework "$1")"
49 | binary="${destination}/${basename}.framework/${basename}"
50 | if ! [ -r "$binary" ]; then
51 | binary="${destination}/${basename}"
52 | fi
53 |
54 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
55 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
56 | strip_invalid_archs "$binary"
57 | fi
58 |
59 | # Resign the code if required by the build settings to avoid unstable apps
60 | code_sign_if_enabled "${destination}/$(basename "$1")"
61 |
62 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
63 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
64 | local swift_runtime_libs
65 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
66 | for lib in $swift_runtime_libs; do
67 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
68 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
69 | code_sign_if_enabled "${destination}/${lib}"
70 | done
71 | fi
72 | }
73 |
74 | # Copies and strips a vendored dSYM
75 | install_dsym() {
76 | local source="$1"
77 | if [ -r "$source" ]; then
78 | # Copy the dSYM into a the targets temp dir.
79 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\""
80 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}"
81 |
82 | local basename
83 | basename="$(basename -s .framework.dSYM "$source")"
84 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}"
85 |
86 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
87 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then
88 | strip_invalid_archs "$binary"
89 | fi
90 |
91 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then
92 | # Move the stripped file into its final destination.
93 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\""
94 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
95 | else
96 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
97 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM"
98 | fi
99 | fi
100 | }
101 |
102 | # Signs a framework with the provided identity
103 | code_sign_if_enabled() {
104 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
105 | # Use the current code_sign_identitiy
106 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
107 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
108 |
109 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
110 | code_sign_cmd="$code_sign_cmd &"
111 | fi
112 | echo "$code_sign_cmd"
113 | eval "$code_sign_cmd"
114 | fi
115 | }
116 |
117 | # Strip invalid architectures
118 | strip_invalid_archs() {
119 | binary="$1"
120 | # Get architectures for current target binary
121 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
122 | # Intersect them with the architectures we are building for
123 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
124 | # If there are no archs supported by this binary then warn the user
125 | if [[ -z "$intersected_archs" ]]; then
126 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
127 | STRIP_BINARY_RETVAL=0
128 | return
129 | fi
130 | stripped=""
131 | for arch in $binary_archs; do
132 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then
133 | # Strip non-valid architectures in-place
134 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1
135 | stripped="$stripped $arch"
136 | fi
137 | done
138 | if [[ "$stripped" ]]; then
139 | echo "Stripped $binary of architectures:$stripped"
140 | fi
141 | STRIP_BINARY_RETVAL=1
142 | }
143 |
144 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
145 | wait
146 | fi
147 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-CocoaChainKit_Tests/Pods-CocoaChainKit_Tests-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 | set -u
4 | set -o pipefail
5 |
6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then
7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy
8 | # resources to, so exit 0 (signalling the script phase was successful).
9 | exit 0
10 | fi
11 |
12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
13 |
14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
15 | > "$RESOURCES_TO_COPY"
16 |
17 | XCASSET_FILES=()
18 |
19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution
20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
22 |
23 | case "${TARGETED_DEVICE_FAMILY:-}" in
24 | 1,2)
25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
26 | ;;
27 | 1)
28 | TARGET_DEVICE_ARGS="--target-device iphone"
29 | ;;
30 | 2)
31 | TARGET_DEVICE_ARGS="--target-device ipad"
32 | ;;
33 | 3)
34 | TARGET_DEVICE_ARGS="--target-device tv"
35 | ;;
36 | 4)
37 | TARGET_DEVICE_ARGS="--target-device watch"
38 | ;;
39 | *)
40 | TARGET_DEVICE_ARGS="--target-device mac"
41 | ;;
42 | esac
43 |
44 | install_resource()
45 | {
46 | if [[ "$1" = /* ]] ; then
47 | RESOURCE_PATH="$1"
48 | else
49 | RESOURCE_PATH="${PODS_ROOT}/$1"
50 | fi
51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then
52 | cat << EOM
53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
54 | EOM
55 | exit 1
56 | fi
57 | case $RESOURCE_PATH in
58 | *.storyboard)
59 | 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}" || true
60 | 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}
61 | ;;
62 | *.xib)
63 | 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}" || true
64 | 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}
65 | ;;
66 | *.framework)
67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
71 | ;;
72 | *.xcdatamodel)
73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true
74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
75 | ;;
76 | *.xcdatamodeld)
77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true
78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
79 | ;;
80 | *.xcmappingmodel)
81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true
82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
83 | ;;
84 | *.xcassets)
85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
87 | ;;
88 | *)
89 | echo "$RESOURCE_PATH" || true
90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
91 | ;;
92 | esac
93 | }
94 |
95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
100 | fi
101 | rm -f "$RESOURCES_TO_COPY"
102 |
103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ]
104 | then
105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
107 | while read line; do
108 | if [[ $line != "${PODS_ROOT}*" ]]; then
109 | XCASSET_FILES+=("$line")
110 | fi
111 | done <<<"$OTHER_XCASSETS"
112 |
113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then
114 | 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}"
115 | else
116 | 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}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist"
117 | fi
118 | fi
119 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-CocoaChainKit_Tests/Pods-CocoaChainKit_Tests-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double Pods_CocoaChainKit_TestsVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_CocoaChainKit_TestsVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-CocoaChainKit_Tests/Pods-CocoaChainKit_Tests.debug.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaChainKit"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaChainKit/CocoaChainKit.framework/Headers"
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_LDFLAGS = $(inherited) -framework "CocoaChainKit" -framework "UIKit"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
9 | PODS_ROOT = ${SRCROOT}/Pods
10 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-CocoaChainKit_Tests/Pods-CocoaChainKit_Tests.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_CocoaChainKit_Tests {
2 | umbrella header "Pods-CocoaChainKit_Tests-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-CocoaChainKit_Tests/Pods-CocoaChainKit_Tests.release.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaChainKit"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaChainKit/CocoaChainKit.framework/Headers"
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_LDFLAGS = $(inherited) -framework "CocoaChainKit" -framework "UIKit"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
9 | PODS_ROOT = ${SRCROOT}/Pods
10 |
--------------------------------------------------------------------------------
/Example/Tests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Example/Tests/Tests.swift:
--------------------------------------------------------------------------------
1 | // https://github.com/Quick/Quick
2 |
3 | //import Quick
4 | //import Nimble
5 | //import CocoaChainKit
6 | //
7 | //class TableOfContentsSpec: QuickSpec {
8 | // override func spec() {
9 | // describe("these will fail") {
10 | //
11 | // it("can do maths") {
12 | // expect(1) == 2
13 | // }
14 | //
15 | // it("can read") {
16 | // expect("number") == "string"
17 | // }
18 | //
19 | // it("will eventually fail") {
20 | // expect("time").toEventually( equal("done") )
21 | // }
22 | //
23 | // context("these will pass") {
24 | //
25 | // it("can do maths") {
26 | // expect(23) == 23
27 | // }
28 | //
29 | // it("can read") {
30 | // expect("🐮") == "🐮"
31 | // }
32 | //
33 | // it("will eventually pass") {
34 | // var time = "passing"
35 | //
36 | // DispatchQueue.main.async {
37 | // time = "done"
38 | // }
39 | //
40 | // waitUntil { done in
41 | // Thread.sleep(forTimeInterval: 0.5)
42 | // expect(time) == "done"
43 | //
44 | // done()
45 | // }
46 | // }
47 | // }
48 | // }
49 | // }
50 | //}
51 |
--------------------------------------------------------------------------------
/Example/before.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pircate/CocoaChainKit/65a6ceada4429ef166df2fdec18ffd4a1eeef628/Example/before.png
--------------------------------------------------------------------------------
/Example/cocoa_chain_kit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pircate/CocoaChainKit/65a6ceada4429ef166df2fdec18ffd4a1eeef628/Example/cocoa_chain_kit.png
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2018 G-Xi0N
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # CocoaChainKit
2 |
3 | [](https://travis-ci.org/Pircate/CocoaChainKit)
4 | [](https://cocoapods.org/pods/CocoaChainKit)
5 | [](https://github.com/Carthage/Carthage)
6 | [](https://cocoapods.org/pods/CocoaChainKit)
7 | 
8 |
9 | ## Example
10 |
11 | To run the example project, clone the repo, and run `pod install` from the Example directory first.
12 |
13 | ## Requirements
14 |
15 | * iOS 9.0
16 | * Swift 4.2
17 |
18 | ## Installation
19 |
20 | CocoaChainKit is available through [CocoaPods](https://cocoapods.org) or [Carthage](https://github.com/Carthage/Carthage). To install
21 | it, simply add the following line to your Podfile or Cartfile:
22 |
23 | #### Podfile
24 | ```ruby
25 | pod 'CocoaChainKit'
26 | ```
27 |
28 | #### Cartfile
29 | ```ruby
30 | github "Pircate/CocoaChainKit"
31 | ```
32 |
33 | ## Usage
34 |
35 | ### before
36 |
37 | 
38 |
39 | ### use chain kit
40 |
41 | 
42 |
43 | ## Author
44 |
45 | Pircate, gao497868860@163.com
46 |
47 | ## License
48 |
49 | CocoaChainKit is available under the MIT license. See the LICENSE file for more info.
50 |
--------------------------------------------------------------------------------
/_Pods.xcodeproj:
--------------------------------------------------------------------------------
1 | Example/Pods/Pods.xcodeproj
--------------------------------------------------------------------------------