├── .gitignore
├── .travis.yml
├── LICENSE
├── README.md
├── Sources
├── Xia.bundle
│ ├── XiaIconInfo@2x.png
│ ├── XiaIconSuccess@2x.png
│ └── XiaIconWarning@2x.png
└── Xia.swift
├── Xia.podspec
├── XiaDemo
├── Podfile
├── Podfile.lock
├── Pods
│ ├── Local Podspecs
│ │ └── Xia.podspec.json
│ ├── Manifest.lock
│ ├── Pods.xcodeproj
│ │ └── project.pbxproj
│ ├── SnapKit
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── Source
│ │ │ ├── Constraint.swift
│ │ │ ├── ConstraintAttributes.swift
│ │ │ ├── ConstraintConfig.swift
│ │ │ ├── ConstraintConstantTarget.swift
│ │ │ ├── ConstraintDSL.swift
│ │ │ ├── ConstraintDescription.swift
│ │ │ ├── ConstraintInsetTarget.swift
│ │ │ ├── ConstraintInsets.swift
│ │ │ ├── ConstraintItem.swift
│ │ │ ├── ConstraintLayoutGuide+Extensions.swift
│ │ │ ├── ConstraintLayoutGuide.swift
│ │ │ ├── ConstraintLayoutGuideDSL.swift
│ │ │ ├── ConstraintLayoutSupport.swift
│ │ │ ├── ConstraintLayoutSupportDSL.swift
│ │ │ ├── ConstraintMaker.swift
│ │ │ ├── ConstraintMakerEditable.swift
│ │ │ ├── ConstraintMakerExtendable.swift
│ │ │ ├── ConstraintMakerFinalizable.swift
│ │ │ ├── ConstraintMakerPriortizable.swift
│ │ │ ├── ConstraintMakerRelatable.swift
│ │ │ ├── ConstraintMultiplierTarget.swift
│ │ │ ├── ConstraintOffsetTarget.swift
│ │ │ ├── ConstraintPriority.swift
│ │ │ ├── ConstraintPriorityTarget.swift
│ │ │ ├── ConstraintRelatableTarget.swift
│ │ │ ├── ConstraintRelation.swift
│ │ │ ├── ConstraintView+Extensions.swift
│ │ │ ├── ConstraintView.swift
│ │ │ ├── ConstraintViewDSL.swift
│ │ │ ├── Debugging.swift
│ │ │ ├── LayoutConstraint.swift
│ │ │ ├── LayoutConstraintItem.swift
│ │ │ └── UILayoutSupport+Extensions.swift
│ └── Target Support Files
│ │ ├── Pods-XiaDemo
│ │ ├── Info.plist
│ │ ├── Pods-XiaDemo-acknowledgements.markdown
│ │ ├── Pods-XiaDemo-acknowledgements.plist
│ │ ├── Pods-XiaDemo-dummy.m
│ │ ├── Pods-XiaDemo-frameworks.sh
│ │ ├── Pods-XiaDemo-resources.sh
│ │ ├── Pods-XiaDemo-umbrella.h
│ │ ├── Pods-XiaDemo.debug.xcconfig
│ │ ├── Pods-XiaDemo.modulemap
│ │ └── Pods-XiaDemo.release.xcconfig
│ │ ├── Pods-XiaDemoTests
│ │ ├── Info.plist
│ │ ├── Pods-XiaDemoTests-acknowledgements.markdown
│ │ ├── Pods-XiaDemoTests-acknowledgements.plist
│ │ ├── Pods-XiaDemoTests-dummy.m
│ │ ├── Pods-XiaDemoTests-frameworks.sh
│ │ ├── Pods-XiaDemoTests-resources.sh
│ │ ├── Pods-XiaDemoTests-umbrella.h
│ │ ├── Pods-XiaDemoTests.debug.xcconfig
│ │ ├── Pods-XiaDemoTests.modulemap
│ │ └── Pods-XiaDemoTests.release.xcconfig
│ │ ├── Pods-XiaDemoUITests
│ │ ├── Info.plist
│ │ ├── Pods-XiaDemoUITests-acknowledgements.markdown
│ │ ├── Pods-XiaDemoUITests-acknowledgements.plist
│ │ ├── Pods-XiaDemoUITests-dummy.m
│ │ ├── Pods-XiaDemoUITests-frameworks.sh
│ │ ├── Pods-XiaDemoUITests-resources.sh
│ │ ├── Pods-XiaDemoUITests-umbrella.h
│ │ ├── Pods-XiaDemoUITests.debug.xcconfig
│ │ ├── Pods-XiaDemoUITests.modulemap
│ │ └── Pods-XiaDemoUITests.release.xcconfig
│ │ ├── SnapKit
│ │ ├── Info.plist
│ │ ├── SnapKit-dummy.m
│ │ ├── SnapKit-prefix.pch
│ │ ├── SnapKit-umbrella.h
│ │ ├── SnapKit.modulemap
│ │ └── SnapKit.xcconfig
│ │ └── Xia
│ │ ├── Info.plist
│ │ ├── Xia-dummy.m
│ │ ├── Xia-prefix.pch
│ │ ├── Xia-umbrella.h
│ │ ├── Xia.modulemap
│ │ └── Xia.xcconfig
├── XiaDemo.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ └── contents.xcworkspacedata
├── XiaDemo.xcworkspace
│ └── contents.xcworkspacedata
├── XiaDemo
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── Info.plist
│ └── ViewController.swift
├── XiaDemoTests
│ ├── Info.plist
│ └── XiaDemoTests.swift
└── XiaDemoUITests
│ ├── Info.plist
│ └── XiaDemoUITests.swift
└── XiaDemoImage
├── XiaDemoImage.png
├── XiaDemoImageInfo.png
├── XiaDemoImageSuccess.png
└── XiaDemoImageWarning.png
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 |
5 | ## Build generated
6 | build/
7 | DerivedData/
8 |
9 | ## Various settings
10 | *.pbxuser
11 | !default.pbxuser
12 | *.mode1v3
13 | !default.mode1v3
14 | *.mode2v3
15 | !default.mode2v3
16 | *.perspectivev3
17 | !default.perspectivev3
18 | xcuserdata/
19 |
20 | ## Other
21 | *.moved-aside
22 | *.xcuserstate
23 |
24 | ## Obj-C/Swift specific
25 | *.hmap
26 | *.ipa
27 | *.dSYM.zip
28 | *.dSYM
29 |
30 | ## Playgrounds
31 | timeline.xctimeline
32 | playground.xcworkspace
33 |
34 | # Swift Package Manager
35 | #
36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
37 | # Packages/
38 | .build/
39 |
40 | # CocoaPods
41 | #
42 | # We recommend against adding the Pods directory to your .gitignore. However
43 | # you should judge for yourself, the pros and cons are mentioned at:
44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
45 | #
46 | # Pods/
47 |
48 | # Carthage
49 | #
50 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
51 | # Carthage/Checkouts
52 |
53 | Carthage/Build
54 |
55 | # fastlane
56 | #
57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
58 | # screenshots whenever they are needed.
59 | # For more information about the recommended setup visit:
60 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
61 |
62 | fastlane/report.xml
63 | fastlane/Preview.html
64 | fastlane/screenshots
65 | fastlane/test_output
66 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: objective-c
2 | osx_image: xcode8.2
3 |
4 | env:
5 | - ACTION=test PLATFORM=iOS DESTINATION='platform=iOS Simulator,name=iPhone 6S'
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Leo (leodaxia@gmail.com)
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Xia
2 |
3 | [](https://travis-ci.org/iTofu/Xia)
4 | [](http://cocoadocs.org/docsets/Xia)
5 | [](https://raw.githubusercontent.com/iTofu/Xia/master/LICENSE)
6 | [](http://cocoadocs.org/docsets/Xia)
7 | [](https://LeoDev.me)
8 |
9 | 🌟 Naughty flexible alert view above the navigation bar. Xia is a part of [DaXia](https://github.com/iTofu/DaXia).
10 |
11 |
12 |
13 | ```
14 | In me the tiger sniffs the rose.
15 |
16 | 心有猛虎,细嗅蔷薇。
17 | ```
18 |
19 | Welcome to my blog:https://LeoDev.me
20 |
21 |
22 |
23 | ## Contents
24 |
25 | * [Requirements](https://github.com/iTofu/Xia#requirements)
26 | * [Installation](https://github.com/iTofu/Xia#installation)
27 | * [Usage](https://github.com/iTofu/Xia#usage)
28 | * [Preview](https://github.com/iTofu/Xia#preview)
29 | * [ChangeLog](https://github.com/iTofu/Xia#changelog)
30 | * [Support](https://github.com/iTofu/Xia#support)
31 | * [License](https://github.com/iTofu/Xia#license)
32 |
33 |
34 |
35 | ## Requirements
36 |
37 | * iOS 8.0+
38 | * Xcode 8.0+
39 | * Swift 3.0+
40 |
41 |
42 |
43 | ## Installation
44 |
45 | ### CocoaPods
46 |
47 | [CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:
48 |
49 | ```bash
50 | $ gem install cocoapods
51 | ```
52 |
53 | > CocoaPods 1.1.0+ is required to build Xia.
54 |
55 | To integrate Xia into your Xcode project using CocoaPods, specify it in your `Podfile`:
56 |
57 | ```ruby
58 | use_frameworks!
59 |
60 | target '' do
61 | pod 'Xia'
62 | end
63 | ```
64 |
65 | ### Manually
66 |
67 | If you prefer not to use the aforementioned dependency manager, you can integrate Xia into your project manually.
68 |
69 |
70 |
71 | ## Usage
72 |
73 | * Quick Start:
74 |
75 | ```swift
76 | import Xia
77 |
78 | func showXia() {
79 |
80 | Xia.showInfo("Praise at most 10 people every day")
81 |
82 | Xia.showSuccess("Praised success")
83 |
84 | Xia.showWarning("Failed, Please try again later")
85 | }
86 | ```
87 |
88 | * Resources:
89 |
90 | * [F.A.Q.](https://github.com/iTofu/Xia/issues?q=)
91 |
92 |
93 | ## Preview
94 |
95 |
96 |
97 |
98 | ## ChangeLog
99 |
100 | ### V 0.0.4
101 |
102 | * Add swipe gesture recognizer.
103 |
104 | ### V 0.0.3
105 |
106 | * Public `textColor`.
107 |
108 | ### V 0.0.2
109 |
110 | * Improve.
111 |
112 | ### V 0.0.1
113 |
114 | * Hello World!
115 |
116 |
117 |
118 | ## Support
119 |
120 | * If you have any question, just [commit a issue](https://github.com/iTofu/Xia/issues/new).
121 |
122 | * Mail: `echo bGVvZGF4aWFAZ21haWwuY29tCg== | base64 -D`
123 |
124 | * Blog: https://LeoDev.me
125 |
126 | * Donations:
127 |
128 | * PayPal:
129 |
130 | [](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=leodaxia@gmail.com&item_name=leodaxia@gmail.com)
131 |
132 | * Alipay or Wechat Pay:
133 |
134 |
135 |
136 | Please note: donation does not imply any type of service contract.
137 |
138 |
139 | ## License
140 |
141 | Xia is released under the [MIT License](https://github.com/iTofu/Xia/blob/master/LICENSE).
142 |
--------------------------------------------------------------------------------
/Sources/Xia.bundle/XiaIconInfo@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iTofu/Xia/565342f555ed522ef8997dd0b779e5467ad4b72f/Sources/Xia.bundle/XiaIconInfo@2x.png
--------------------------------------------------------------------------------
/Sources/Xia.bundle/XiaIconSuccess@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iTofu/Xia/565342f555ed522ef8997dd0b779e5467ad4b72f/Sources/Xia.bundle/XiaIconSuccess@2x.png
--------------------------------------------------------------------------------
/Sources/Xia.bundle/XiaIconWarning@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iTofu/Xia/565342f555ed522ef8997dd0b779e5467ad4b72f/Sources/Xia.bundle/XiaIconWarning@2x.png
--------------------------------------------------------------------------------
/Sources/Xia.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Xia.swift
3 | // Xia
4 | //
5 | // Created by Leo on 27/02/2017.
6 | //
7 | // Copyright (c) 2017 Leo
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in all
17 | // copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 | // SOFTWARE.
26 |
27 |
28 | import UIKit
29 | import SnapKit
30 |
31 | public enum XiaType {
32 | case Info
33 | case Success
34 | case Warning
35 | }
36 |
37 | open class Xia: UIView {
38 |
39 | static let xiaBundlePath: String = Bundle(for: Xia.self).path(forResource: "Xia", ofType: "bundle")!
40 | static let infoImagePath: String = xiaBundlePath.xiaStringByAppendingPathComponent("XiaIconInfo@2x.png")
41 | static let succImagePath: String = xiaBundlePath.xiaStringByAppendingPathComponent("XiaIconSuccess@2x.png")
42 | static let warnImagePath: String = xiaBundlePath.xiaStringByAppendingPathComponent("XiaIconWarning@2x.png")
43 | open static let infoImage: UIImage = UIImage(contentsOfFile: infoImagePath)!
44 | open static let succImage: UIImage = UIImage(contentsOfFile: succImagePath)!
45 | open static let warnImage: UIImage = UIImage(contentsOfFile: warnImagePath)!
46 |
47 | open var autoHide = true {
48 | didSet {
49 | self.timer?.invalidate()
50 | self.timer = nil
51 | }
52 | }
53 | open var delay = 3.0
54 |
55 | open var textColor = UIColor.black {
56 | didSet {
57 | self.textLabel.textColor = textColor
58 | }
59 | }
60 | open var textFont = UIFont.systemFont(ofSize: 15.0) {
61 | didSet {
62 | self.textLabel.font = textFont
63 | }
64 | }
65 |
66 | fileprivate let iconView = UIImageView()
67 | fileprivate let textLabel = UILabel()
68 |
69 | private var timer: Timer?
70 |
71 | override init(frame: CGRect) {
72 | super.init(frame: frame)
73 |
74 | setupMainView()
75 | }
76 |
77 | convenience init() {
78 | self.init(frame: CGRect.zero)
79 | }
80 |
81 | required public init?(coder aDecoder: NSCoder) {
82 | super.init(coder: aDecoder)
83 |
84 | setupMainView()
85 | }
86 |
87 | private func setupMainView() {
88 | self.backgroundColor = UIColor.white
89 |
90 | let container = UIView()
91 | self.addSubview(container)
92 | container.snp.makeConstraints { (make) in
93 | make.left.right.equalToSuperview()
94 | make.bottom.equalToSuperview().offset(1.0)
95 | make.height.equalTo(44.0)
96 | }
97 |
98 | container.addSubview(self.iconView)
99 | iconView.snp.makeConstraints { (make) in
100 | make.centerY.equalToSuperview()
101 | make.left.equalToSuperview().offset(10.0)
102 | make.size.equalTo(CGSize(width: 20.0, height: 20.0))
103 | }
104 |
105 | self.textLabel.textColor = self.textColor
106 | self.textLabel.font = self.textFont
107 | self.textLabel.adjustsFontSizeToFitWidth = true
108 | container.addSubview(self.textLabel)
109 | textLabel.snp.makeConstraints { (make) in
110 | make.left.equalTo(iconView.snp.right).offset(8.0)
111 | make.right.equalToSuperview().offset(-10.0)
112 | make.top.bottom.equalToSuperview()
113 | }
114 |
115 | let swipeGR = UISwipeGestureRecognizer(
116 | target: self,
117 | action: #selector(onSwipe)
118 | )
119 | swipeGR.direction = .up
120 | self.addGestureRecognizer(swipeGR)
121 | }
122 |
123 | @objc
124 | private func onSwipe() {
125 | self.hide()
126 |
127 | self.timer?.invalidate()
128 | self.timer = nil
129 | }
130 |
131 | @discardableResult
132 | public class func show(type: XiaType, text: String?, textColor: UIColor = .black, backgroundColor: UIColor = .white) -> Xia {
133 | return Xia().show(type: type, text: text, textColor: textColor, backgroundColor: backgroundColor)
134 | }
135 |
136 | @discardableResult
137 | public class func showInfo(_ text: String?, textColor: UIColor = .black, backgroundColor: UIColor = .white) -> Xia {
138 | return self.show(type: .Info, text: text, textColor: textColor, backgroundColor: backgroundColor)
139 | }
140 |
141 | @discardableResult
142 | public class func showSuccess(_ text: String?, textColor: UIColor = .black, backgroundColor: UIColor = .white) -> Xia {
143 | return self.show(type: .Success, text: text, textColor: textColor, backgroundColor: backgroundColor)
144 | }
145 |
146 | @discardableResult
147 | public class func showWarning(_ text: String?, textColor: UIColor = .white, backgroundColor: UIColor = .orange) -> Xia {
148 | return self.show(type: .Warning, text: text, textColor: textColor, backgroundColor: backgroundColor)
149 | }
150 |
151 | @discardableResult
152 | public func show(type: XiaType, text: String?, textColor: UIColor = .black, backgroundColor: UIColor = .white) -> Xia {
153 | switch type {
154 | case .Info:
155 | self.iconView.image = Xia.infoImage
156 | case .Success:
157 | self.iconView.image = Xia.succImage
158 | case .Warning:
159 | self.iconView.image = Xia.warnImage
160 | }
161 |
162 | self.textLabel.text = text
163 | self.textColor = textColor
164 |
165 | self.backgroundColor = backgroundColor;
166 |
167 | return self.show()
168 | }
169 |
170 | @discardableResult
171 | public func showInfo(_ text: String?, textColor: UIColor = .black, backgroundColor: UIColor = .white) -> Xia {
172 | return self.show(type: .Info, text: text, textColor: textColor, backgroundColor: backgroundColor)
173 | }
174 |
175 | @discardableResult
176 | public func showSuccess(_ text: String?, textColor: UIColor = .black, backgroundColor: UIColor = .white) -> Xia {
177 | return self.show(type: .Success, text: text, textColor: textColor, backgroundColor: backgroundColor)
178 | }
179 |
180 | @discardableResult
181 | public func showWarning(_ text: String?, textColor: UIColor = .white, backgroundColor: UIColor = .orange) -> Xia {
182 | return self.show(type: .Warning, text: text, textColor: textColor, backgroundColor: backgroundColor)
183 | }
184 |
185 | @discardableResult
186 | public func show() -> Xia {
187 | if let keyWindow = UIApplication.shared.keyWindow {
188 | self.xiaInstallShadow()
189 |
190 | keyWindow.addSubview(self)
191 | self.snp.makeConstraints({ (make) in
192 | make.left.right.equalToSuperview()
193 | make.height.equalTo(100.0)
194 | make.bottom.equalTo(keyWindow.snp.top)
195 | })
196 |
197 | keyWindow.layoutIfNeeded()
198 | UIView.animate(withDuration: 0.5, delay: 0, usingSpringWithDamping: 0.6, initialSpringVelocity: 1, options: .allowUserInteraction, animations: {
199 | self.snp.updateConstraints({ (make) in
200 | make.bottom.equalTo(keyWindow.snp.top).offset(65.0)
201 | })
202 | keyWindow.layoutIfNeeded()
203 | }, completion: nil)
204 |
205 | if self.autoHide {
206 | self.timer = Timer.scheduledTimer(timeInterval: self.delay, target: self, selector: #selector(hideFromTimer), userInfo: nil, repeats: false)
207 | RunLoop.main.add(self.timer!, forMode: RunLoopMode.commonModes)
208 | }
209 | } else {
210 | print("Warning: No keyWindow!")
211 | }
212 |
213 | return self
214 | }
215 |
216 | @objc
217 | private func hideFromTimer() {
218 | self.hide()
219 | }
220 |
221 | public func hide(completion: (() -> Void)? = nil) {
222 | if let keyWindow = self.superview {
223 | UIView.animate(withDuration: 0.5, delay: 0, usingSpringWithDamping: 0.6, initialSpringVelocity: 1, options: .allowUserInteraction, animations: {
224 | self.snp.updateConstraints({ (make) in
225 | make.bottom.equalTo(keyWindow.snp.top)
226 | })
227 | keyWindow.layoutIfNeeded()
228 | }, completion: { (finished) in
229 | self.removeFromSuperview()
230 |
231 | completion?()
232 | })
233 | }
234 | }
235 | }
236 |
237 | extension String {
238 |
239 | func xiaStringByAppendingPathComponent(_ path: String) -> String {
240 | let nsSt = self as NSString
241 | return nsSt.appendingPathComponent(path)
242 | }
243 | }
244 |
245 | extension UIView {
246 | func xiaInstallShadow() {
247 | layer.masksToBounds = false
248 | layer.shadowColor = UIColor.black.cgColor
249 | layer.shadowOffset = CGSize(width: 0, height: 2.0)
250 | layer.shadowOpacity = 0.1
251 | layer.shadowRadius = 2.0
252 | }
253 | }
254 |
--------------------------------------------------------------------------------
/Xia.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 |
3 | s.name = "Xia"
4 | s.version = "0.0.4"
5 | s.summary = "🌟 Naughty flexible alert view above the navigation bar. Support: https://LeoDev.me"
6 | s.homepage = "https://github.com/iTofu/Xia"
7 | s.license = "MIT"
8 | s.author = { "Leo" => "leodaxia@gmail.com" }
9 | s.social_media_url = "https://LeoDev.me"
10 | s.platform = :ios, "8.0"
11 | s.source = { :git => "https://github.com/iTofu/Xia.git", :tag => s.version }
12 | s.source_files = "Sources/*.swift"
13 | s.resource = "Sources/Xia.bundle"
14 | s.requires_arc = true
15 |
16 | s.ios.deployment_target = "8.0"
17 |
18 | s.dependency "SnapKit", "~> 3.2.0"
19 |
20 | end
21 |
--------------------------------------------------------------------------------
/XiaDemo/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment the next line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | target 'XiaDemo' do
5 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
6 | use_frameworks!
7 |
8 | # Pods for XiaDemo
9 | # pod 'SnapKit', '~> 3.2.0'
10 |
11 | pod 'Xia', :path => '../'
12 |
13 | target 'XiaDemoTests' do
14 | inherit! :search_paths
15 | # Pods for testing
16 | end
17 |
18 | target 'XiaDemoUITests' do
19 | inherit! :search_paths
20 | # Pods for testing
21 | end
22 |
23 | end
24 |
--------------------------------------------------------------------------------
/XiaDemo/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - SnapKit (3.2.0)
3 | - Xia (0.0.2):
4 | - SnapKit (~> 3.2.0)
5 |
6 | DEPENDENCIES:
7 | - Xia (from `../`)
8 |
9 | EXTERNAL SOURCES:
10 | Xia:
11 | :path: "../"
12 |
13 | SPEC CHECKSUMS:
14 | SnapKit: 1ca44df72cfa543218d177cb8aab029d10d86ea7
15 | Xia: c7ebcafc32b592a7c5e783c18e176d61cd5f2a14
16 |
17 | PODFILE CHECKSUM: d1bf904a1823dae1042d48f767dadcae6b2216a0
18 |
19 | COCOAPODS: 1.2.0
20 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Local Podspecs/Xia.podspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Xia",
3 | "version": "0.0.2",
4 | "summary": "🌟 Naughty flexible alert view above the navigation bar. Support: https://LeoDev.me",
5 | "homepage": "https://github.com/iTofu/Xia",
6 | "license": "MIT",
7 | "authors": {
8 | "Leo": "devtip@163.com"
9 | },
10 | "social_media_url": "https://LeoDev.me",
11 | "platforms": {
12 | "ios": "8.0"
13 | },
14 | "source": {
15 | "git": "https://github.com/iTofu/Xia.git",
16 | "tag": "0.0.2"
17 | },
18 | "source_files": "Sources/*.swift",
19 | "resources": "Sources/Xia.bundle",
20 | "requires_arc": true,
21 | "dependencies": {
22 | "SnapKit": [
23 | "~> 3.2.0"
24 | ]
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - SnapKit (3.2.0)
3 | - Xia (0.0.2):
4 | - SnapKit (~> 3.2.0)
5 |
6 | DEPENDENCIES:
7 | - Xia (from `../`)
8 |
9 | EXTERNAL SOURCES:
10 | Xia:
11 | :path: "../"
12 |
13 | SPEC CHECKSUMS:
14 | SnapKit: 1ca44df72cfa543218d177cb8aab029d10d86ea7
15 | Xia: c7ebcafc32b592a7c5e783c18e176d61cd5f2a14
16 |
17 | PODFILE CHECKSUM: d1bf904a1823dae1042d48f767dadcae6b2216a0
18 |
19 | COCOAPODS: 1.2.0
20 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
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 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | SnapKit is a DSL to make Auto Layout easy on both iOS and OS X.
4 |
5 | [](https://travis-ci.org/SnapKit/SnapKit)
6 | [](https://github.com/SnapKit/SnapKit)
7 | [](https://cocoapods.org/pods/SnapKit)
8 | [](https://github.com/Carthage/Carthage)
9 |
10 | #### ⚠️ **To use with Swift 2.x please ensure you are using == 0.22.0** ⚠️
11 | #### ⚠️ **To use with Swift 3.x please ensure you are using >= 3.0.0** ⚠️
12 |
13 | ## Contents
14 |
15 | - [Requirements](#requirements)
16 | - [Migration Guides](#migration-guides)
17 | - [Communication](#communication)
18 | - [Installation](#installation)
19 | - [Usage](#usage)
20 | - [Credits](#credits)
21 | - [License](#license)
22 |
23 | ## Requirements
24 |
25 | - iOS 8.0+ / Mac OS X 10.11+ / tvOS 9.0+
26 | - Xcode 8.0+
27 | - Swift 3.0+
28 |
29 | ## Migration Guides
30 |
31 | - [SnapKit 3.0 Migration Guide](https://github.com/SnapKit/SnapKit/blob/master/Documentation/SnapKit%203.0%20Migration%20Guide.md)
32 |
33 | ## Communication
34 |
35 | - If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/snapkit). (Tag 'snapkit')
36 | - If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/snapkit).
37 | - If you **found a bug**, open an issue.
38 | - If you **have a feature request**, open an issue.
39 | - If you **want to contribute**, submit a pull request.
40 |
41 |
42 | ## Installation
43 |
44 | ### CocoaPods
45 |
46 | [CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:
47 |
48 | ```bash
49 | $ gem install cocoapods
50 | ```
51 |
52 | > CocoaPods 1.1.0+ is required to build SnapKit 3.0.0+.
53 |
54 | To integrate SnapKit into your Xcode project using CocoaPods, specify it in your `Podfile`:
55 |
56 | ```ruby
57 | source 'https://github.com/CocoaPods/Specs.git'
58 | platform :ios, '10.0'
59 | use_frameworks!
60 |
61 | target '' do
62 | pod 'SnapKit', '~> 3.2.0'
63 | end
64 | ```
65 |
66 | Then, run the following command:
67 |
68 | ```bash
69 | $ pod install
70 | ```
71 |
72 | ### Carthage
73 |
74 | [Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
75 |
76 | You can install Carthage with [Homebrew](http://brew.sh/) using the following command:
77 |
78 | ```bash
79 | $ brew update
80 | $ brew install carthage
81 | ```
82 |
83 | To integrate SnapKit into your Xcode project using Carthage, specify it in your `Cartfile`:
84 |
85 | ```ogdl
86 | github "SnapKit/SnapKit" ~> 3.2.0
87 | ```
88 |
89 | Run `carthage update` to build the framework and drag the built `SnapKit.framework` into your Xcode project.
90 |
91 | ### Manually
92 |
93 | If you prefer not to use either of the aforementioned dependency managers, you can integrate SnapKit into your project manually.
94 |
95 | ---
96 |
97 | ## Usage
98 |
99 | ### Quick Start
100 |
101 | ```swift
102 | import SnapKit
103 |
104 | class MyViewController: UIViewController {
105 |
106 | lazy var box = UIView()
107 |
108 | override func viewDidLoad() {
109 | super.viewDidLoad()
110 |
111 | self.view.addSubview(box)
112 | box.snp.makeConstraints { (make) -> Void in
113 | make.width.height.equalTo(50)
114 | make.center.equalTo(self.view)
115 | }
116 | }
117 |
118 | }
119 | ```
120 |
121 | ### Resources
122 |
123 | - [Documentation](http://snapkit.io/docs/)
124 | - [F.A.Q.](http://snapkit.io/faq/)
125 |
126 | ## Credits
127 |
128 | - Robert Payne ([@robertjpayne](https://twitter.com/robertjpayne))
129 | - Many other contributors
130 |
131 | ## License
132 |
133 | SnapKit is released under the MIT license. See LICENSE for details.
134 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintAttributes.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | internal struct ConstraintAttributes : OptionSet {
32 |
33 | internal init(rawValue: UInt) {
34 | self.rawValue = rawValue
35 | }
36 | internal init(_ rawValue: UInt) {
37 | self.init(rawValue: rawValue)
38 | }
39 | internal init(nilLiteral: ()) {
40 | self.rawValue = 0
41 | }
42 |
43 | internal private(set) var rawValue: UInt
44 | internal static var allZeros: ConstraintAttributes { return self.init(0) }
45 | internal static func convertFromNilLiteral() -> ConstraintAttributes { return self.init(0) }
46 | internal var boolValue: Bool { return self.rawValue != 0 }
47 |
48 | internal func toRaw() -> UInt { return self.rawValue }
49 | internal static func fromRaw(_ raw: UInt) -> ConstraintAttributes? { return self.init(raw) }
50 | internal static func fromMask(_ raw: UInt) -> ConstraintAttributes { return self.init(raw) }
51 |
52 | // normal
53 |
54 | internal static var none: ConstraintAttributes { return self.init(0) }
55 | internal static var left: ConstraintAttributes { return self.init(1) }
56 | internal static var top: ConstraintAttributes { return self.init(2) }
57 | internal static var right: ConstraintAttributes { return self.init(4) }
58 | internal static var bottom: ConstraintAttributes { return self.init(8) }
59 | internal static var leading: ConstraintAttributes { return self.init(16) }
60 | internal static var trailing: ConstraintAttributes { return self.init(32) }
61 | internal static var width: ConstraintAttributes { return self.init(64) }
62 | internal static var height: ConstraintAttributes { return self.init(128) }
63 | internal static var centerX: ConstraintAttributes { return self.init(256) }
64 | internal static var centerY: ConstraintAttributes { return self.init(512) }
65 | internal static var lastBaseline: ConstraintAttributes { return self.init(1024) }
66 |
67 | @available(iOS 8.0, OSX 10.11, *)
68 | internal static var firstBaseline: ConstraintAttributes { return self.init(2048) }
69 |
70 | @available(iOS 8.0, *)
71 | internal static var leftMargin: ConstraintAttributes { return self.init(4096) }
72 |
73 | @available(iOS 8.0, *)
74 | internal static var rightMargin: ConstraintAttributes { return self.init(8192) }
75 |
76 | @available(iOS 8.0, *)
77 | internal static var topMargin: ConstraintAttributes { return self.init(16384) }
78 |
79 | @available(iOS 8.0, *)
80 | internal static var bottomMargin: ConstraintAttributes { return self.init(32768) }
81 |
82 | @available(iOS 8.0, *)
83 | internal static var leadingMargin: ConstraintAttributes { return self.init(65536) }
84 |
85 | @available(iOS 8.0, *)
86 | internal static var trailingMargin: ConstraintAttributes { return self.init(131072) }
87 |
88 | @available(iOS 8.0, *)
89 | internal static var centerXWithinMargins: ConstraintAttributes { return self.init(262144) }
90 |
91 | @available(iOS 8.0, *)
92 | internal static var centerYWithinMargins: ConstraintAttributes { return self.init(524288) }
93 |
94 | // aggregates
95 |
96 | internal static var edges: ConstraintAttributes { return self.init(15) }
97 | internal static var size: ConstraintAttributes { return self.init(192) }
98 | internal static var center: ConstraintAttributes { return self.init(768) }
99 |
100 | @available(iOS 8.0, *)
101 | internal static var margins: ConstraintAttributes { return self.init(61440) }
102 |
103 | @available(iOS 8.0, *)
104 | internal static var centerWithinMargins: ConstraintAttributes { return self.init(786432) }
105 |
106 | internal var layoutAttributes:[NSLayoutAttribute] {
107 | var attrs = [NSLayoutAttribute]()
108 | if (self.contains(ConstraintAttributes.left)) {
109 | attrs.append(.left)
110 | }
111 | if (self.contains(ConstraintAttributes.top)) {
112 | attrs.append(.top)
113 | }
114 | if (self.contains(ConstraintAttributes.right)) {
115 | attrs.append(.right)
116 | }
117 | if (self.contains(ConstraintAttributes.bottom)) {
118 | attrs.append(.bottom)
119 | }
120 | if (self.contains(ConstraintAttributes.leading)) {
121 | attrs.append(.leading)
122 | }
123 | if (self.contains(ConstraintAttributes.trailing)) {
124 | attrs.append(.trailing)
125 | }
126 | if (self.contains(ConstraintAttributes.width)) {
127 | attrs.append(.width)
128 | }
129 | if (self.contains(ConstraintAttributes.height)) {
130 | attrs.append(.height)
131 | }
132 | if (self.contains(ConstraintAttributes.centerX)) {
133 | attrs.append(.centerX)
134 | }
135 | if (self.contains(ConstraintAttributes.centerY)) {
136 | attrs.append(.centerY)
137 | }
138 | if (self.contains(ConstraintAttributes.lastBaseline)) {
139 | attrs.append(.lastBaseline)
140 | }
141 |
142 | #if os(iOS) || os(tvOS)
143 | if (self.contains(ConstraintAttributes.firstBaseline)) {
144 | attrs.append(.firstBaseline)
145 | }
146 | if (self.contains(ConstraintAttributes.leftMargin)) {
147 | attrs.append(.leftMargin)
148 | }
149 | if (self.contains(ConstraintAttributes.rightMargin)) {
150 | attrs.append(.rightMargin)
151 | }
152 | if (self.contains(ConstraintAttributes.topMargin)) {
153 | attrs.append(.topMargin)
154 | }
155 | if (self.contains(ConstraintAttributes.bottomMargin)) {
156 | attrs.append(.bottomMargin)
157 | }
158 | if (self.contains(ConstraintAttributes.leadingMargin)) {
159 | attrs.append(.leadingMargin)
160 | }
161 | if (self.contains(ConstraintAttributes.trailingMargin)) {
162 | attrs.append(.trailingMargin)
163 | }
164 | if (self.contains(ConstraintAttributes.centerXWithinMargins)) {
165 | attrs.append(.centerXWithinMargins)
166 | }
167 | if (self.contains(ConstraintAttributes.centerYWithinMargins)) {
168 | attrs.append(.centerYWithinMargins)
169 | }
170 | #endif
171 |
172 | return attrs
173 | }
174 | }
175 |
176 | internal func + (left: ConstraintAttributes, right: ConstraintAttributes) -> ConstraintAttributes {
177 | return left.union(right)
178 | }
179 |
180 | internal func +=(left: inout ConstraintAttributes, right: ConstraintAttributes) {
181 | left.formUnion(right)
182 | }
183 |
184 | internal func -=(left: inout ConstraintAttributes, right: ConstraintAttributes) {
185 | left.subtract(right)
186 | }
187 |
188 | internal func ==(left: ConstraintAttributes, right: ConstraintAttributes) -> Bool {
189 | return left.rawValue == right.rawValue
190 | }
191 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintConfig.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | public typealias ConstraintInterfaceLayoutDirection = UIUserInterfaceLayoutDirection
27 | #else
28 | import AppKit
29 | public typealias ConstraintInterfaceLayoutDirection = NSUserInterfaceLayoutDirection
30 | #endif
31 |
32 |
33 | public struct ConstraintConfig {
34 |
35 | public static var interfaceLayoutDirection: ConstraintInterfaceLayoutDirection = .leftToRight
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintConstantTarget.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public protocol ConstraintConstantTarget {
32 | }
33 |
34 | extension CGPoint: ConstraintConstantTarget {
35 | }
36 |
37 | extension CGSize: ConstraintConstantTarget {
38 | }
39 |
40 | extension ConstraintInsets: ConstraintConstantTarget {
41 | }
42 |
43 | extension ConstraintConstantTarget {
44 |
45 | internal func constraintConstantTargetValueFor(layoutAttribute: NSLayoutAttribute) -> CGFloat {
46 | if let value = self as? CGFloat {
47 | return value
48 | }
49 |
50 | if let value = self as? Float {
51 | return CGFloat(value)
52 | }
53 |
54 | if let value = self as? Double {
55 | return CGFloat(value)
56 | }
57 |
58 | if let value = self as? Int {
59 | return CGFloat(value)
60 | }
61 |
62 | if let value = self as? UInt {
63 | return CGFloat(value)
64 | }
65 |
66 | if let value = self as? CGSize {
67 | if layoutAttribute == .width {
68 | return value.width
69 | } else if layoutAttribute == .height {
70 | return value.height
71 | } else {
72 | return 0.0
73 | }
74 | }
75 |
76 | if let value = self as? CGPoint {
77 | #if os(iOS) || os(tvOS)
78 | switch layoutAttribute {
79 | case .left, .right, .leading, .trailing, .centerX, .leftMargin, .rightMargin, .leadingMargin, .trailingMargin, .centerXWithinMargins:
80 | return value.x
81 | case .top, .bottom, .centerY, .topMargin, .bottomMargin, .centerYWithinMargins, .lastBaseline, .firstBaseline:
82 | return value.y
83 | case .width, .height, .notAnAttribute:
84 | return 0.0
85 | }
86 | #else
87 | switch layoutAttribute {
88 | case .left, .right, .leading, .trailing, .centerX:
89 | return value.x
90 | case .top, .bottom, .centerY, .lastBaseline, .firstBaseline:
91 | return value.y
92 | case .width, .height, .notAnAttribute:
93 | return 0.0
94 | }
95 | #endif
96 | }
97 |
98 | if let value = self as? ConstraintInsets {
99 | #if os(iOS) || os(tvOS)
100 | switch layoutAttribute {
101 | case .left, .leftMargin, .centerX, .centerXWithinMargins:
102 | return value.left
103 | case .top, .topMargin, .centerY, .centerYWithinMargins, .lastBaseline, .firstBaseline:
104 | return value.top
105 | case .right, .rightMargin:
106 | return -value.right
107 | case .bottom, .bottomMargin:
108 | return -value.bottom
109 | case .leading, .leadingMargin:
110 | return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? value.left : value.right
111 | case .trailing, .trailingMargin:
112 | return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? -value.right : -value.left
113 | case .width:
114 | return -(value.left + value.right)
115 | case .height:
116 | return -(value.top + value.bottom)
117 | case .notAnAttribute:
118 | return 0.0
119 | }
120 | #else
121 | switch layoutAttribute {
122 | case .left, .centerX:
123 | return value.left
124 | case .top, .centerY, .lastBaseline, .firstBaseline:
125 | return value.top
126 | case .right:
127 | return -value.right
128 | case .bottom:
129 | return -value.bottom
130 | case .leading:
131 | return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? value.left : value.right
132 | case .trailing:
133 | return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? -value.right : -value.left
134 | case .width:
135 | return -(value.left + value.right)
136 | case .height:
137 | return -(value.top + value.bottom)
138 | case .notAnAttribute:
139 | return 0.0
140 | }
141 | #endif
142 | }
143 |
144 | return 0.0
145 | }
146 |
147 | }
148 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintDSL.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public protocol ConstraintDSL {
32 |
33 | var target: AnyObject? { get }
34 |
35 | func setLabel(_ value: String?)
36 | func label() -> String?
37 |
38 | }
39 | extension ConstraintDSL {
40 |
41 | public func setLabel(_ value: String?) {
42 | objc_setAssociatedObject(self.target, &labelKey, value, .OBJC_ASSOCIATION_COPY_NONATOMIC)
43 | }
44 | public func label() -> String? {
45 | return objc_getAssociatedObject(self.target, &labelKey) as? String
46 | }
47 |
48 | }
49 | private var labelKey: UInt8 = 0
50 |
51 |
52 | public protocol ConstraintBasicAttributesDSL : ConstraintDSL {
53 | }
54 | extension ConstraintBasicAttributesDSL {
55 |
56 | // MARK: Basics
57 |
58 | public var left: ConstraintItem {
59 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.left)
60 | }
61 |
62 | public var top: ConstraintItem {
63 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.top)
64 | }
65 |
66 | public var right: ConstraintItem {
67 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.right)
68 | }
69 |
70 | public var bottom: ConstraintItem {
71 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.bottom)
72 | }
73 |
74 | public var leading: ConstraintItem {
75 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.leading)
76 | }
77 |
78 | public var trailing: ConstraintItem {
79 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.trailing)
80 | }
81 |
82 | public var width: ConstraintItem {
83 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.width)
84 | }
85 |
86 | public var height: ConstraintItem {
87 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.height)
88 | }
89 |
90 | public var centerX: ConstraintItem {
91 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.centerX)
92 | }
93 |
94 | public var centerY: ConstraintItem {
95 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.centerY)
96 | }
97 |
98 | public var edges: ConstraintItem {
99 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.edges)
100 | }
101 |
102 | public var size: ConstraintItem {
103 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.size)
104 | }
105 |
106 | public var center: ConstraintItem {
107 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.center)
108 | }
109 |
110 | }
111 |
112 | public protocol ConstraintAttributesDSL : ConstraintBasicAttributesDSL {
113 | }
114 | extension ConstraintAttributesDSL {
115 |
116 | // MARK: Baselines
117 |
118 | @available(*, deprecated:3.0, message:"Use .lastBaseline instead")
119 | public var baseline: ConstraintItem {
120 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.lastBaseline)
121 | }
122 |
123 | @available(iOS 8.0, OSX 10.11, *)
124 | public var lastBaseline: ConstraintItem {
125 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.lastBaseline)
126 | }
127 |
128 | @available(iOS 8.0, OSX 10.11, *)
129 | public var firstBaseline: ConstraintItem {
130 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.firstBaseline)
131 | }
132 |
133 | // MARK: Margins
134 |
135 | @available(iOS 8.0, *)
136 | public var leftMargin: ConstraintItem {
137 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.leftMargin)
138 | }
139 |
140 | @available(iOS 8.0, *)
141 | public var topMargin: ConstraintItem {
142 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.topMargin)
143 | }
144 |
145 | @available(iOS 8.0, *)
146 | public var rightMargin: ConstraintItem {
147 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.rightMargin)
148 | }
149 |
150 | @available(iOS 8.0, *)
151 | public var bottomMargin: ConstraintItem {
152 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.bottomMargin)
153 | }
154 |
155 | @available(iOS 8.0, *)
156 | public var leadingMargin: ConstraintItem {
157 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.leadingMargin)
158 | }
159 |
160 | @available(iOS 8.0, *)
161 | public var trailingMargin: ConstraintItem {
162 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.trailingMargin)
163 | }
164 |
165 | @available(iOS 8.0, *)
166 | public var centerXWithinMargins: ConstraintItem {
167 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.centerXWithinMargins)
168 | }
169 |
170 | @available(iOS 8.0, *)
171 | public var centerYWithinMargins: ConstraintItem {
172 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.centerYWithinMargins)
173 | }
174 |
175 | @available(iOS 8.0, *)
176 | public var margins: ConstraintItem {
177 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.margins)
178 | }
179 |
180 | @available(iOS 8.0, *)
181 | public var centerWithinMargins: ConstraintItem {
182 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.centerWithinMargins)
183 | }
184 |
185 | }
186 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintDescription.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public class ConstraintDescription {
32 |
33 | internal let item: LayoutConstraintItem
34 | internal var attributes: ConstraintAttributes
35 | internal var relation: ConstraintRelation? = nil
36 | internal var sourceLocation: (String, UInt)? = nil
37 | internal var label: String? = nil
38 | internal var related: ConstraintItem? = nil
39 | internal var multiplier: ConstraintMultiplierTarget = 1.0
40 | internal var constant: ConstraintConstantTarget = 0.0
41 | internal var priority: ConstraintPriorityTarget = 1000.0
42 | internal lazy var constraint: Constraint? = {
43 | guard let relation = self.relation,
44 | let related = self.related,
45 | let sourceLocation = self.sourceLocation else {
46 | return nil
47 | }
48 | let from = ConstraintItem(target: self.item, attributes: self.attributes)
49 |
50 | return Constraint(
51 | from: from,
52 | to: related,
53 | relation: relation,
54 | sourceLocation: sourceLocation,
55 | label: self.label,
56 | multiplier: self.multiplier,
57 | constant: self.constant,
58 | priority: self.priority
59 | )
60 | }()
61 |
62 | // MARK: Initialization
63 |
64 | internal init(item: LayoutConstraintItem, attributes: ConstraintAttributes) {
65 | self.item = item
66 | self.attributes = attributes
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintInsetTarget.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public protocol ConstraintInsetTarget: ConstraintConstantTarget {
32 | }
33 |
34 | extension Int: ConstraintInsetTarget {
35 | }
36 |
37 | extension UInt: ConstraintInsetTarget {
38 | }
39 |
40 | extension Float: ConstraintInsetTarget {
41 | }
42 |
43 | extension Double: ConstraintInsetTarget {
44 | }
45 |
46 | extension CGFloat: ConstraintInsetTarget {
47 | }
48 |
49 | extension ConstraintInsets: ConstraintInsetTarget {
50 | }
51 |
52 | extension ConstraintInsetTarget {
53 |
54 | internal var constraintInsetTargetValue: ConstraintInsets {
55 | if let amount = self as? ConstraintInsets {
56 | return amount
57 | } else if let amount = self as? Float {
58 | return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount))
59 | } else if let amount = self as? Double {
60 | return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount))
61 | } else if let amount = self as? CGFloat {
62 | return ConstraintInsets(top: amount, left: amount, bottom: amount, right: amount)
63 | } else if let amount = self as? Int {
64 | return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount))
65 | } else if let amount = self as? UInt {
66 | return ConstraintInsets(top: CGFloat(amount), left: CGFloat(amount), bottom: CGFloat(amount), right: CGFloat(amount))
67 | } else {
68 | return ConstraintInsets(top: 0, left: 0, bottom: 0, right: 0)
69 | }
70 | }
71 |
72 | }
73 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintInsets.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | #if os(iOS) || os(tvOS)
32 | public typealias ConstraintInsets = UIEdgeInsets
33 | #else
34 | public typealias ConstraintInsets = EdgeInsets
35 | #endif
36 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintItem.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public final class ConstraintItem {
32 |
33 | internal weak var target: AnyObject?
34 | internal let attributes: ConstraintAttributes
35 |
36 | internal init(target: AnyObject?, attributes: ConstraintAttributes) {
37 | self.target = target
38 | self.attributes = attributes
39 | }
40 |
41 | internal var layoutConstraintItem: LayoutConstraintItem? {
42 | return self.target as? LayoutConstraintItem
43 | }
44 |
45 | }
46 |
47 | public func ==(lhs: ConstraintItem, rhs: ConstraintItem) -> Bool {
48 | // pointer equality
49 | guard lhs !== rhs else {
50 | return true
51 | }
52 |
53 | // must both have valid targets and identical attributes
54 | guard let target1 = lhs.target,
55 | let target2 = rhs.target,
56 | target1 === target2 && lhs.attributes == rhs.attributes else {
57 | return false
58 | }
59 |
60 | return true
61 | }
62 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintLayoutGuide+Extensions.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #endif
27 |
28 |
29 | @available(iOS 9.0, OSX 10.11, *)
30 | public extension ConstraintLayoutGuide {
31 |
32 | public var snp: ConstraintLayoutGuideDSL {
33 | return ConstraintLayoutGuideDSL(guide: self)
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintLayoutGuide.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | #if os(iOS) || os(tvOS)
32 | @available(iOS 9.0, *)
33 | public typealias ConstraintLayoutGuide = UILayoutGuide
34 | #else
35 | @available(OSX 10.11, *)
36 | public typealias ConstraintLayoutGuide = NSLayoutGuide
37 | #endif
38 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | @available(iOS 9.0, OSX 10.11, *)
32 | public struct ConstraintLayoutGuideDSL: ConstraintAttributesDSL {
33 |
34 | @discardableResult
35 | public func prepareConstraints(_ closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] {
36 | return ConstraintMaker.prepareConstraints(item: self.guide, closure: closure)
37 | }
38 |
39 | public func makeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) {
40 | ConstraintMaker.makeConstraints(item: self.guide, closure: closure)
41 | }
42 |
43 | public func remakeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) {
44 | ConstraintMaker.remakeConstraints(item: self.guide, closure: closure)
45 | }
46 |
47 | public func updateConstraints(_ closure: (_ make: ConstraintMaker) -> Void) {
48 | ConstraintMaker.updateConstraints(item: self.guide, closure: closure)
49 | }
50 |
51 | public func removeConstraints() {
52 | ConstraintMaker.removeConstraints(item: self.guide)
53 | }
54 |
55 | public var target: AnyObject? {
56 | return self.guide
57 | }
58 |
59 | internal let guide: ConstraintLayoutGuide
60 |
61 | internal init(guide: ConstraintLayoutGuide) {
62 | self.guide = guide
63 |
64 | }
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintLayoutSupport.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | #if os(iOS) || os(tvOS)
32 | @available(iOS 8.0, *)
33 | public typealias ConstraintLayoutSupport = UILayoutSupport
34 | #else
35 | public class ConstraintLayoutSupport {}
36 | #endif
37 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintLayoutSupportDSL.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | @available(iOS 8.0, *)
32 | public struct ConstraintLayoutSupportDSL: ConstraintDSL {
33 |
34 | public var target: AnyObject? {
35 | return self.support
36 | }
37 |
38 | internal let support: ConstraintLayoutSupport
39 |
40 | internal init(support: ConstraintLayoutSupport) {
41 | self.support = support
42 |
43 | }
44 |
45 | public var top: ConstraintItem {
46 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.top)
47 | }
48 |
49 | public var bottom: ConstraintItem {
50 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.bottom)
51 | }
52 |
53 | public var height: ConstraintItem {
54 | return ConstraintItem(target: self.target, attributes: ConstraintAttributes.height)
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintMaker.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 | public class ConstraintMaker {
31 |
32 | public var left: ConstraintMakerExtendable {
33 | return self.makeExtendableWithAttributes(.left)
34 | }
35 |
36 | public var top: ConstraintMakerExtendable {
37 | return self.makeExtendableWithAttributes(.top)
38 | }
39 |
40 | public var bottom: ConstraintMakerExtendable {
41 | return self.makeExtendableWithAttributes(.bottom)
42 | }
43 |
44 | public var right: ConstraintMakerExtendable {
45 | return self.makeExtendableWithAttributes(.right)
46 | }
47 |
48 | public var leading: ConstraintMakerExtendable {
49 | return self.makeExtendableWithAttributes(.leading)
50 | }
51 |
52 | public var trailing: ConstraintMakerExtendable {
53 | return self.makeExtendableWithAttributes(.trailing)
54 | }
55 |
56 | public var width: ConstraintMakerExtendable {
57 | return self.makeExtendableWithAttributes(.width)
58 | }
59 |
60 | public var height: ConstraintMakerExtendable {
61 | return self.makeExtendableWithAttributes(.height)
62 | }
63 |
64 | public var centerX: ConstraintMakerExtendable {
65 | return self.makeExtendableWithAttributes(.centerX)
66 | }
67 |
68 | public var centerY: ConstraintMakerExtendable {
69 | return self.makeExtendableWithAttributes(.centerY)
70 | }
71 |
72 | @available(*, deprecated:3.0, message:"Use lastBaseline instead")
73 | public var baseline: ConstraintMakerExtendable {
74 | return self.makeExtendableWithAttributes(.lastBaseline)
75 | }
76 |
77 | public var lastBaseline: ConstraintMakerExtendable {
78 | return self.makeExtendableWithAttributes(.lastBaseline)
79 | }
80 |
81 | @available(iOS 8.0, OSX 10.11, *)
82 | public var firstBaseline: ConstraintMakerExtendable {
83 | return self.makeExtendableWithAttributes(.firstBaseline)
84 | }
85 |
86 | @available(iOS 8.0, *)
87 | public var leftMargin: ConstraintMakerExtendable {
88 | return self.makeExtendableWithAttributes(.leftMargin)
89 | }
90 |
91 | @available(iOS 8.0, *)
92 | public var rightMargin: ConstraintMakerExtendable {
93 | return self.makeExtendableWithAttributes(.rightMargin)
94 | }
95 |
96 | @available(iOS 8.0, *)
97 | public var topMargin: ConstraintMakerExtendable {
98 | return self.makeExtendableWithAttributes(.topMargin)
99 | }
100 |
101 | @available(iOS 8.0, *)
102 | public var bottomMargin: ConstraintMakerExtendable {
103 | return self.makeExtendableWithAttributes(.bottomMargin)
104 | }
105 |
106 | @available(iOS 8.0, *)
107 | public var leadingMargin: ConstraintMakerExtendable {
108 | return self.makeExtendableWithAttributes(.leadingMargin)
109 | }
110 |
111 | @available(iOS 8.0, *)
112 | public var trailingMargin: ConstraintMakerExtendable {
113 | return self.makeExtendableWithAttributes(.trailingMargin)
114 | }
115 |
116 | @available(iOS 8.0, *)
117 | public var centerXWithinMargins: ConstraintMakerExtendable {
118 | return self.makeExtendableWithAttributes(.centerXWithinMargins)
119 | }
120 |
121 | @available(iOS 8.0, *)
122 | public var centerYWithinMargins: ConstraintMakerExtendable {
123 | return self.makeExtendableWithAttributes(.centerYWithinMargins)
124 | }
125 |
126 | public var edges: ConstraintMakerExtendable {
127 | return self.makeExtendableWithAttributes(.edges)
128 | }
129 | public var size: ConstraintMakerExtendable {
130 | return self.makeExtendableWithAttributes(.size)
131 | }
132 | public var center: ConstraintMakerExtendable {
133 | return self.makeExtendableWithAttributes(.center)
134 | }
135 |
136 | @available(iOS 8.0, *)
137 | public var margins: ConstraintMakerExtendable {
138 | return self.makeExtendableWithAttributes(.margins)
139 | }
140 |
141 | @available(iOS 8.0, *)
142 | public var centerWithinMargins: ConstraintMakerExtendable {
143 | return self.makeExtendableWithAttributes(.centerWithinMargins)
144 | }
145 |
146 | private let item: LayoutConstraintItem
147 | private var descriptions = [ConstraintDescription]()
148 |
149 | internal init(item: LayoutConstraintItem) {
150 | self.item = item
151 | self.item.prepare()
152 | }
153 |
154 | internal func makeExtendableWithAttributes(_ attributes: ConstraintAttributes) -> ConstraintMakerExtendable {
155 | let description = ConstraintDescription(item: self.item, attributes: attributes)
156 | self.descriptions.append(description)
157 | return ConstraintMakerExtendable(description)
158 | }
159 |
160 | internal static func prepareConstraints(item: LayoutConstraintItem, closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] {
161 | let maker = ConstraintMaker(item: item)
162 | closure(maker)
163 | var constraints: [Constraint] = []
164 | for description in maker.descriptions {
165 | guard let constraint = description.constraint else {
166 | continue
167 | }
168 | constraints.append(constraint)
169 | }
170 | return constraints
171 | }
172 |
173 | internal static func makeConstraints(item: LayoutConstraintItem, closure: (_ make: ConstraintMaker) -> Void) {
174 | let maker = ConstraintMaker(item: item)
175 | closure(maker)
176 | var constraints: [Constraint] = []
177 | for description in maker.descriptions {
178 | guard let constraint = description.constraint else {
179 | continue
180 | }
181 | constraints.append(constraint)
182 | }
183 | for constraint in constraints {
184 | constraint.activateIfNeeded(updatingExisting: false)
185 | }
186 | }
187 |
188 | internal static func remakeConstraints(item: LayoutConstraintItem, closure: (_ make: ConstraintMaker) -> Void) {
189 | self.removeConstraints(item: item)
190 | self.makeConstraints(item: item, closure: closure)
191 | }
192 |
193 | internal static func updateConstraints(item: LayoutConstraintItem, closure: (_ make: ConstraintMaker) -> Void) {
194 | guard item.constraints.count > 0 else {
195 | self.makeConstraints(item: item, closure: closure)
196 | return
197 | }
198 |
199 | let maker = ConstraintMaker(item: item)
200 | closure(maker)
201 | var constraints: [Constraint] = []
202 | for description in maker.descriptions {
203 | guard let constraint = description.constraint else {
204 | continue
205 | }
206 | constraints.append(constraint)
207 | }
208 | for constraint in constraints {
209 | constraint.activateIfNeeded(updatingExisting: true)
210 | }
211 | }
212 |
213 | internal static func removeConstraints(item: LayoutConstraintItem) {
214 | let constraints = item.constraints
215 | for constraint in constraints {
216 | constraint.deactivateIfNeeded()
217 | }
218 | }
219 |
220 | }
221 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintMakerEditable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public class ConstraintMakerEditable: ConstraintMakerPriortizable {
32 |
33 | @discardableResult
34 | public func multipliedBy(_ amount: ConstraintMultiplierTarget) -> ConstraintMakerEditable {
35 | self.description.multiplier = amount
36 | return self
37 | }
38 |
39 | @discardableResult
40 | public func dividedBy(_ amount: ConstraintMultiplierTarget) -> ConstraintMakerEditable {
41 | return self.multipliedBy(1.0 / amount.constraintMultiplierTargetValue)
42 | }
43 |
44 | @discardableResult
45 | public func offset(_ amount: ConstraintOffsetTarget) -> ConstraintMakerEditable {
46 | self.description.constant = amount.constraintOffsetTargetValue
47 | return self
48 | }
49 |
50 | @discardableResult
51 | public func inset(_ amount: ConstraintInsetTarget) -> ConstraintMakerEditable {
52 | self.description.constant = amount.constraintInsetTargetValue
53 | return self
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintMakerExtendable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public class ConstraintMakerExtendable: ConstraintMakerRelatable {
32 |
33 | public var left: ConstraintMakerExtendable {
34 | self.description.attributes += .left
35 | return self
36 | }
37 |
38 | public var top: ConstraintMakerExtendable {
39 | self.description.attributes += .top
40 | return self
41 | }
42 |
43 | public var bottom: ConstraintMakerExtendable {
44 | self.description.attributes += .bottom
45 | return self
46 | }
47 |
48 | public var right: ConstraintMakerExtendable {
49 | self.description.attributes += .right
50 | return self
51 | }
52 |
53 | public var leading: ConstraintMakerExtendable {
54 | self.description.attributes += .leading
55 | return self
56 | }
57 |
58 | public var trailing: ConstraintMakerExtendable {
59 | self.description.attributes += .trailing
60 | return self
61 | }
62 |
63 | public var width: ConstraintMakerExtendable {
64 | self.description.attributes += .width
65 | return self
66 | }
67 |
68 | public var height: ConstraintMakerExtendable {
69 | self.description.attributes += .height
70 | return self
71 | }
72 |
73 | public var centerX: ConstraintMakerExtendable {
74 | self.description.attributes += .centerX
75 | return self
76 | }
77 |
78 | public var centerY: ConstraintMakerExtendable {
79 | self.description.attributes += .centerY
80 | return self
81 | }
82 |
83 | @available(*, deprecated:3.0, message:"Use lastBaseline instead")
84 | public var baseline: ConstraintMakerExtendable {
85 | self.description.attributes += .lastBaseline
86 | return self
87 | }
88 |
89 | public var lastBaseline: ConstraintMakerExtendable {
90 | self.description.attributes += .lastBaseline
91 | return self
92 | }
93 |
94 | @available(iOS 8.0, OSX 10.11, *)
95 | public var firstBaseline: ConstraintMakerExtendable {
96 | self.description.attributes += .firstBaseline
97 | return self
98 | }
99 |
100 | @available(iOS 8.0, *)
101 | public var leftMargin: ConstraintMakerExtendable {
102 | self.description.attributes += .leftMargin
103 | return self
104 | }
105 |
106 | @available(iOS 8.0, *)
107 | public var rightMargin: ConstraintMakerExtendable {
108 | self.description.attributes += .rightMargin
109 | return self
110 | }
111 |
112 | @available(iOS 8.0, *)
113 | public var topMargin: ConstraintMakerExtendable {
114 | self.description.attributes += .topMargin
115 | return self
116 | }
117 |
118 | @available(iOS 8.0, *)
119 | public var bottomMargin: ConstraintMakerExtendable {
120 | self.description.attributes += .bottomMargin
121 | return self
122 | }
123 |
124 | @available(iOS 8.0, *)
125 | public var leadingMargin: ConstraintMakerExtendable {
126 | self.description.attributes += .leadingMargin
127 | return self
128 | }
129 |
130 | @available(iOS 8.0, *)
131 | public var trailingMargin: ConstraintMakerExtendable {
132 | self.description.attributes += .trailingMargin
133 | return self
134 | }
135 |
136 | @available(iOS 8.0, *)
137 | public var centerXWithinMargins: ConstraintMakerExtendable {
138 | self.description.attributes += .centerXWithinMargins
139 | return self
140 | }
141 |
142 | @available(iOS 8.0, *)
143 | public var centerYWithinMargins: ConstraintMakerExtendable {
144 | self.description.attributes += .centerYWithinMargins
145 | return self
146 | }
147 |
148 | public var edges: ConstraintMakerExtendable {
149 | self.description.attributes += .edges
150 | return self
151 | }
152 | public var size: ConstraintMakerExtendable {
153 | self.description.attributes += .size
154 | return self
155 | }
156 |
157 | @available(iOS 8.0, *)
158 | public var margins: ConstraintMakerExtendable {
159 | self.description.attributes += .margins
160 | return self
161 | }
162 |
163 | @available(iOS 8.0, *)
164 | public var centerWithinMargins: ConstraintMakerExtendable {
165 | self.description.attributes += .centerWithinMargins
166 | return self
167 | }
168 |
169 | }
170 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintMakerFinalizable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public class ConstraintMakerFinalizable {
32 |
33 | internal let description: ConstraintDescription
34 |
35 | internal init(_ description: ConstraintDescription) {
36 | self.description = description
37 | }
38 |
39 | @discardableResult
40 | public func labeled(_ label: String) -> ConstraintMakerFinalizable {
41 | self.description.label = label
42 | return self
43 | }
44 |
45 | public var constraint: Constraint {
46 | return self.description.constraint!
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintMakerPriortizable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public class ConstraintMakerPriortizable: ConstraintMakerFinalizable {
32 |
33 | @discardableResult
34 | public func priority(_ amount: ConstraintPriority) -> ConstraintMakerFinalizable {
35 | self.description.priority = amount.value
36 | return self
37 | }
38 |
39 | @discardableResult
40 | public func priority(_ amount: ConstraintPriorityTarget) -> ConstraintMakerFinalizable {
41 | self.description.priority = amount
42 | return self
43 | }
44 |
45 | @available(*, deprecated:3.0, message:"Use priority(.required) instead.")
46 | @discardableResult
47 | public func priorityRequired() -> ConstraintMakerFinalizable {
48 | return self.priority(.required)
49 | }
50 |
51 | @available(*, deprecated:3.0, message:"Use priority(.high) instead.")
52 | @discardableResult
53 | public func priorityHigh() -> ConstraintMakerFinalizable {
54 | return self.priority(.high)
55 | }
56 |
57 | @available(*, deprecated:3.0, message:"Use priority(.medium) instead.")
58 | @discardableResult
59 | public func priorityMedium() -> ConstraintMakerFinalizable {
60 | return self.priority(.medium)
61 | }
62 |
63 | @available(*, deprecated:3.0, message:"Use priority(.low) instead.")
64 | @discardableResult
65 | public func priorityLow() -> ConstraintMakerFinalizable {
66 | return self.priority(.low)
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintMakerRelatable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public class ConstraintMakerRelatable {
32 |
33 | internal let description: ConstraintDescription
34 |
35 | internal init(_ description: ConstraintDescription) {
36 | self.description = description
37 | }
38 |
39 | internal func relatedTo(_ other: ConstraintRelatableTarget, relation: ConstraintRelation, file: String, line: UInt) -> ConstraintMakerEditable {
40 | let related: ConstraintItem
41 | let constant: ConstraintConstantTarget
42 |
43 | if let other = other as? ConstraintItem {
44 | guard other.attributes == ConstraintAttributes.none ||
45 | other.attributes.layoutAttributes.count <= 1 ||
46 | other.attributes.layoutAttributes == self.description.attributes.layoutAttributes ||
47 | other.attributes == .edges && self.description.attributes == .margins ||
48 | other.attributes == .margins && self.description.attributes == .edges else {
49 | fatalError("Cannot constraint to multiple non identical attributes. (\(file), \(line))");
50 | }
51 |
52 | related = other
53 | constant = 0.0
54 | } else if let other = other as? ConstraintView {
55 | related = ConstraintItem(target: other, attributes: ConstraintAttributes.none)
56 | constant = 0.0
57 | } else if let other = other as? ConstraintConstantTarget {
58 | related = ConstraintItem(target: nil, attributes: ConstraintAttributes.none)
59 | constant = other
60 | } else if #available(iOS 9.0, OSX 10.11, *), let other = other as? ConstraintLayoutGuide {
61 | related = ConstraintItem(target: other, attributes: ConstraintAttributes.none)
62 | constant = 0.0
63 | } else {
64 | fatalError("Invalid constraint. (\(file), \(line))")
65 | }
66 |
67 | let editable = ConstraintMakerEditable(self.description)
68 | editable.description.sourceLocation = (file, line)
69 | editable.description.relation = relation
70 | editable.description.related = related
71 | editable.description.constant = constant
72 | return editable
73 | }
74 |
75 | @discardableResult
76 | public func equalTo(_ other: ConstraintRelatableTarget, _ file: String = #file, _ line: UInt = #line) -> ConstraintMakerEditable {
77 | return self.relatedTo(other, relation: .equal, file: file, line: line)
78 | }
79 |
80 | @discardableResult
81 | public func equalToSuperview(_ file: String = #file, _ line: UInt = #line) -> ConstraintMakerEditable {
82 | guard let other = self.description.item.superview else {
83 | fatalError("Expected superview but found nil when attempting make constraint `equalToSuperview`.")
84 | }
85 | return self.relatedTo(other, relation: .equal, file: file, line: line)
86 | }
87 |
88 | @discardableResult
89 | public func lessThanOrEqualTo(_ other: ConstraintRelatableTarget, _ file: String = #file, _ line: UInt = #line) -> ConstraintMakerEditable {
90 | return self.relatedTo(other, relation: .lessThanOrEqual, file: file, line: line)
91 | }
92 |
93 | @discardableResult
94 | public func lessThanOrEqualToSuperview(_ file: String = #file, _ line: UInt = #line) -> ConstraintMakerEditable {
95 | guard let other = self.description.item.superview else {
96 | fatalError("Expected superview but found nil when attempting make constraint `lessThanOrEqualToSuperview`.")
97 | }
98 | return self.relatedTo(other, relation: .lessThanOrEqual, file: file, line: line)
99 | }
100 |
101 | @discardableResult
102 | public func greaterThanOrEqualTo(_ other: ConstraintRelatableTarget, _ file: String = #file, line: UInt = #line) -> ConstraintMakerEditable {
103 | return self.relatedTo(other, relation: .greaterThanOrEqual, file: file, line: line)
104 | }
105 |
106 | @discardableResult
107 | public func greaterThanOrEqualToSuperview(_ file: String = #file, line: UInt = #line) -> ConstraintMakerEditable {
108 | guard let other = self.description.item.superview else {
109 | fatalError("Expected superview but found nil when attempting make constraint `greaterThanOrEqualToSuperview`.")
110 | }
111 | return self.relatedTo(other, relation: .greaterThanOrEqual, file: file, line: line)
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintMultiplierTarget.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public protocol ConstraintMultiplierTarget {
32 |
33 | var constraintMultiplierTargetValue: CGFloat { get }
34 |
35 | }
36 |
37 | extension Int: ConstraintMultiplierTarget {
38 |
39 | public var constraintMultiplierTargetValue: CGFloat {
40 | return CGFloat(self)
41 | }
42 |
43 | }
44 |
45 | extension UInt: ConstraintMultiplierTarget {
46 |
47 | public var constraintMultiplierTargetValue: CGFloat {
48 | return CGFloat(self)
49 | }
50 |
51 | }
52 |
53 | extension Float: ConstraintMultiplierTarget {
54 |
55 | public var constraintMultiplierTargetValue: CGFloat {
56 | return CGFloat(self)
57 | }
58 |
59 | }
60 |
61 | extension Double: ConstraintMultiplierTarget {
62 |
63 | public var constraintMultiplierTargetValue: CGFloat {
64 | return CGFloat(self)
65 | }
66 |
67 | }
68 |
69 | extension CGFloat: ConstraintMultiplierTarget {
70 |
71 | public var constraintMultiplierTargetValue: CGFloat {
72 | return self
73 | }
74 |
75 | }
76 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintOffsetTarget.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public protocol ConstraintOffsetTarget: ConstraintConstantTarget {
32 | }
33 |
34 | extension Int: ConstraintOffsetTarget {
35 | }
36 |
37 | extension UInt: ConstraintOffsetTarget {
38 | }
39 |
40 | extension Float: ConstraintOffsetTarget {
41 | }
42 |
43 | extension Double: ConstraintOffsetTarget {
44 | }
45 |
46 | extension CGFloat: ConstraintOffsetTarget {
47 | }
48 |
49 | extension ConstraintOffsetTarget {
50 |
51 | internal var constraintOffsetTargetValue: CGFloat {
52 | let offset: CGFloat
53 | if let amount = self as? Float {
54 | offset = CGFloat(amount)
55 | } else if let amount = self as? Double {
56 | offset = CGFloat(amount)
57 | } else if let amount = self as? CGFloat {
58 | offset = CGFloat(amount)
59 | } else if let amount = self as? Int {
60 | offset = CGFloat(amount)
61 | } else if let amount = self as? UInt {
62 | offset = CGFloat(amount)
63 | } else {
64 | offset = 0.0
65 | }
66 | return offset
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintPriority.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public struct ConstraintPriority : ExpressibleByFloatLiteral, Equatable {
32 | public typealias FloatLiteralType = Float
33 |
34 | public let value: Float
35 |
36 | public init(floatLiteral value: Float) {
37 | self.value = value
38 | }
39 |
40 | public init(_ value: Float) {
41 | self.value = value
42 | }
43 |
44 | public static var required: ConstraintPriority {
45 | return 1000.0
46 | }
47 |
48 | public static var high: ConstraintPriority {
49 | return 750.0
50 | }
51 |
52 | public static var medium: ConstraintPriority {
53 | #if os(OSX)
54 | return 501.0
55 | #else
56 | return 500.0
57 | #endif
58 |
59 | }
60 |
61 | public static var low: ConstraintPriority {
62 | return 250.0
63 | }
64 |
65 | public static func ==(lhs: ConstraintPriority, rhs: ConstraintPriority) -> Bool {
66 | return lhs.value == rhs.value
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintPriorityTarget.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public protocol ConstraintPriorityTarget {
32 |
33 | var constraintPriorityTargetValue: Float { get }
34 |
35 | }
36 |
37 | extension Int: ConstraintPriorityTarget {
38 |
39 | public var constraintPriorityTargetValue: Float {
40 | return Float(self)
41 | }
42 |
43 | }
44 |
45 | extension UInt: ConstraintPriorityTarget {
46 |
47 | public var constraintPriorityTargetValue: Float {
48 | return Float(self)
49 | }
50 |
51 | }
52 |
53 | extension Float: ConstraintPriorityTarget {
54 |
55 | public var constraintPriorityTargetValue: Float {
56 | return self
57 | }
58 |
59 | }
60 |
61 | extension Double: ConstraintPriorityTarget {
62 |
63 | public var constraintPriorityTargetValue: Float {
64 | return Float(self)
65 | }
66 |
67 | }
68 |
69 | extension CGFloat: ConstraintPriorityTarget {
70 |
71 | public var constraintPriorityTargetValue: Float {
72 | return Float(self)
73 | }
74 |
75 | }
76 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintRelatableTarget.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public protocol ConstraintRelatableTarget {
32 | }
33 |
34 | extension Int: ConstraintRelatableTarget {
35 | }
36 |
37 | extension UInt: ConstraintRelatableTarget {
38 | }
39 |
40 | extension Float: ConstraintRelatableTarget {
41 | }
42 |
43 | extension Double: ConstraintRelatableTarget {
44 | }
45 |
46 | extension CGFloat: ConstraintRelatableTarget {
47 | }
48 |
49 | extension CGSize: ConstraintRelatableTarget {
50 | }
51 |
52 | extension CGPoint: ConstraintRelatableTarget {
53 | }
54 |
55 | extension ConstraintInsets: ConstraintRelatableTarget {
56 | }
57 |
58 | extension ConstraintItem: ConstraintRelatableTarget {
59 | }
60 |
61 | extension ConstraintView: ConstraintRelatableTarget {
62 | }
63 |
64 | @available(iOS 9.0, OSX 10.11, *)
65 | extension ConstraintLayoutGuide: ConstraintRelatableTarget {
66 | }
67 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintRelation.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | internal enum ConstraintRelation : Int {
32 | case equal = 1
33 | case lessThanOrEqual
34 | case greaterThanOrEqual
35 |
36 | internal var layoutRelation: NSLayoutRelation {
37 | get {
38 | switch(self) {
39 | case .equal:
40 | return .equal
41 | case .lessThanOrEqual:
42 | return .lessThanOrEqual
43 | case .greaterThanOrEqual:
44 | return .greaterThanOrEqual
45 | }
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintView+Extensions.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public extension ConstraintView {
32 |
33 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.")
34 | public var snp_left: ConstraintItem { return self.snp.left }
35 |
36 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.")
37 | public var snp_top: ConstraintItem { return self.snp.top }
38 |
39 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.")
40 | public var snp_right: ConstraintItem { return self.snp.right }
41 |
42 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.")
43 | public var snp_bottom: ConstraintItem { return self.snp.bottom }
44 |
45 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.")
46 | public var snp_leading: ConstraintItem { return self.snp.leading }
47 |
48 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.")
49 | public var snp_trailing: ConstraintItem { return self.snp.trailing }
50 |
51 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.")
52 | public var snp_width: ConstraintItem { return self.snp.width }
53 |
54 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.")
55 | public var snp_height: ConstraintItem { return self.snp.height }
56 |
57 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.")
58 | public var snp_centerX: ConstraintItem { return self.snp.centerX }
59 |
60 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.")
61 | public var snp_centerY: ConstraintItem { return self.snp.centerY }
62 |
63 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.")
64 | public var snp_baseline: ConstraintItem { return self.snp.baseline }
65 |
66 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.")
67 | @available(iOS 8.0, OSX 10.11, *)
68 | public var snp_lastBaseline: ConstraintItem { return self.snp.lastBaseline }
69 |
70 | @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.")
71 | @available(iOS 8.0, OSX 10.11, *)
72 | public var snp_firstBaseline: ConstraintItem { return self.snp.firstBaseline }
73 |
74 | @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.")
75 | @available(iOS 8.0, *)
76 | public var snp_leftMargin: ConstraintItem { return self.snp.leftMargin }
77 |
78 | @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.")
79 | @available(iOS 8.0, *)
80 | public var snp_topMargin: ConstraintItem { return self.snp.topMargin }
81 |
82 | @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.")
83 | @available(iOS 8.0, *)
84 | public var snp_rightMargin: ConstraintItem { return self.snp.rightMargin }
85 |
86 | @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.")
87 | @available(iOS 8.0, *)
88 | public var snp_bottomMargin: ConstraintItem { return self.snp.bottomMargin }
89 |
90 | @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.")
91 | @available(iOS 8.0, *)
92 | public var snp_leadingMargin: ConstraintItem { return self.snp.leadingMargin }
93 |
94 | @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.")
95 | @available(iOS 8.0, *)
96 | public var snp_trailingMargin: ConstraintItem { return self.snp.trailingMargin }
97 |
98 | @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.")
99 | @available(iOS 8.0, *)
100 | public var snp_centerXWithinMargins: ConstraintItem { return self.snp.centerXWithinMargins }
101 |
102 | @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.")
103 | @available(iOS 8.0, *)
104 | public var snp_centerYWithinMargins: ConstraintItem { return self.snp.centerYWithinMargins }
105 |
106 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.")
107 | public var snp_edges: ConstraintItem { return self.snp.edges }
108 |
109 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.")
110 | public var snp_size: ConstraintItem { return self.snp.size }
111 |
112 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.")
113 | public var snp_center: ConstraintItem { return self.snp.center }
114 |
115 | @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.")
116 | @available(iOS 8.0, *)
117 | public var snp_margins: ConstraintItem { return self.snp.margins }
118 |
119 | @available(iOS, deprecated:3.0, message:"Use newer snp.* syntax.")
120 | @available(iOS 8.0, *)
121 | public var snp_centerWithinMargins: ConstraintItem { return self.snp.centerWithinMargins }
122 |
123 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.")
124 | public func snp_prepareConstraints(_ closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] {
125 | return self.snp.prepareConstraints(closure)
126 | }
127 |
128 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.")
129 | public func snp_makeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) {
130 | self.snp.makeConstraints(closure)
131 | }
132 |
133 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.")
134 | public func snp_remakeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) {
135 | self.snp.remakeConstraints(closure)
136 | }
137 |
138 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.")
139 | public func snp_updateConstraints(_ closure: (_ make: ConstraintMaker) -> Void) {
140 | self.snp.updateConstraints(closure)
141 | }
142 |
143 | @available(*, deprecated:3.0, message:"Use newer snp.* syntax.")
144 | public func snp_removeConstraints() {
145 | self.snp.removeConstraints()
146 | }
147 |
148 | public var snp: ConstraintViewDSL {
149 | return ConstraintViewDSL(view: self)
150 | }
151 |
152 | }
153 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | #if os(iOS) || os(tvOS)
32 | public typealias ConstraintView = UIView
33 | #else
34 | public typealias ConstraintView = NSView
35 | #endif
36 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/ConstraintViewDSL.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public struct ConstraintViewDSL: ConstraintAttributesDSL {
32 |
33 | @discardableResult
34 | public func prepareConstraints(_ closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] {
35 | return ConstraintMaker.prepareConstraints(item: self.view, closure: closure)
36 | }
37 |
38 | public func makeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) {
39 | ConstraintMaker.makeConstraints(item: self.view, closure: closure)
40 | }
41 |
42 | public func remakeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) {
43 | ConstraintMaker.remakeConstraints(item: self.view, closure: closure)
44 | }
45 |
46 | public func updateConstraints(_ closure: (_ make: ConstraintMaker) -> Void) {
47 | ConstraintMaker.updateConstraints(item: self.view, closure: closure)
48 | }
49 |
50 | public func removeConstraints() {
51 | ConstraintMaker.removeConstraints(item: self.view)
52 | }
53 |
54 | public var contentHuggingHorizontalPriority: Float {
55 | get {
56 | return self.view.contentHuggingPriority(for: .horizontal)
57 | }
58 | set {
59 | self.view.setContentHuggingPriority(newValue, for: .horizontal)
60 | }
61 | }
62 |
63 | public var contentHuggingVerticalPriority: Float {
64 | get {
65 | return self.view.contentHuggingPriority(for: .vertical)
66 | }
67 | set {
68 | self.view.setContentHuggingPriority(newValue, for: .vertical)
69 | }
70 | }
71 |
72 | public var contentCompressionResistanceHorizontalPriority: Float {
73 | get {
74 | return self.view.contentCompressionResistancePriority(for: .horizontal)
75 | }
76 | set {
77 | self.view.setContentCompressionResistancePriority(newValue, for: .horizontal)
78 | }
79 | }
80 |
81 | public var contentCompressionResistanceVerticalPriority: Float {
82 | get {
83 | return self.view.contentCompressionResistancePriority(for: .vertical)
84 | }
85 | set {
86 | self.view.setContentCompressionResistancePriority(newValue, for: .vertical)
87 | }
88 | }
89 |
90 | public var target: AnyObject? {
91 | return self.view
92 | }
93 |
94 | internal let view: ConstraintView
95 |
96 | internal init(view: ConstraintView) {
97 | self.view = view
98 |
99 | }
100 |
101 | }
102 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/Debugging.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 | public extension LayoutConstraint {
31 |
32 | override public var description: String {
33 | var description = "<"
34 |
35 | description += descriptionForObject(self)
36 |
37 | if let firstItem = conditionalOptional(from: self.firstItem) {
38 | description += " \(descriptionForObject(firstItem))"
39 | }
40 |
41 | if self.firstAttribute != .notAnAttribute {
42 | description += ".\(descriptionForAttribute(self.firstAttribute))"
43 | }
44 |
45 | description += " \(descriptionForRelation(self.relation))"
46 |
47 | if let secondItem = self.secondItem {
48 | description += " \(descriptionForObject(secondItem))"
49 | }
50 |
51 | if self.secondAttribute != .notAnAttribute {
52 | description += ".\(descriptionForAttribute(self.secondAttribute))"
53 | }
54 |
55 | if self.multiplier != 1.0 {
56 | description += " * \(self.multiplier)"
57 | }
58 |
59 | if self.secondAttribute == .notAnAttribute {
60 | description += " \(self.constant)"
61 | } else {
62 | if self.constant > 0.0 {
63 | description += " + \(self.constant)"
64 | } else if self.constant < 0.0 {
65 | description += " - \(abs(self.constant))"
66 | }
67 | }
68 |
69 | if self.priority != 1000.0 {
70 | description += " ^\(self.priority)"
71 | }
72 |
73 | description += ">"
74 |
75 | return description
76 | }
77 |
78 | }
79 |
80 | private func descriptionForRelation(_ relation: NSLayoutRelation) -> String {
81 | switch relation {
82 | case .equal: return "=="
83 | case .greaterThanOrEqual: return ">="
84 | case .lessThanOrEqual: return "<="
85 | }
86 | }
87 |
88 | private func descriptionForAttribute(_ attribute: NSLayoutAttribute) -> String {
89 | #if os(iOS) || os(tvOS)
90 | switch attribute {
91 | case .notAnAttribute: return "notAnAttribute"
92 | case .top: return "top"
93 | case .left: return "left"
94 | case .bottom: return "bottom"
95 | case .right: return "right"
96 | case .leading: return "leading"
97 | case .trailing: return "trailing"
98 | case .width: return "width"
99 | case .height: return "height"
100 | case .centerX: return "centerX"
101 | case .centerY: return "centerY"
102 | case .lastBaseline: return "lastBaseline"
103 | case .firstBaseline: return "firstBaseline"
104 | case .topMargin: return "topMargin"
105 | case .leftMargin: return "leftMargin"
106 | case .bottomMargin: return "bottomMargin"
107 | case .rightMargin: return "rightMargin"
108 | case .leadingMargin: return "leadingMargin"
109 | case .trailingMargin: return "trailingMargin"
110 | case .centerXWithinMargins: return "centerXWithinMargins"
111 | case .centerYWithinMargins: return "centerYWithinMargins"
112 | }
113 | #else
114 | switch attribute {
115 | case .notAnAttribute: return "notAnAttribute"
116 | case .top: return "top"
117 | case .left: return "left"
118 | case .bottom: return "bottom"
119 | case .right: return "right"
120 | case .leading: return "leading"
121 | case .trailing: return "trailing"
122 | case .width: return "width"
123 | case .height: return "height"
124 | case .centerX: return "centerX"
125 | case .centerY: return "centerY"
126 | case .lastBaseline: return "lastBaseline"
127 | case .firstBaseline: return "firstBaseline"
128 | }
129 | #endif
130 | }
131 |
132 | private func conditionalOptional(from object: Optional) -> Optional {
133 | return object
134 | }
135 |
136 | private func conditionalOptional(from object: T) -> Optional {
137 | return Optional.some(object)
138 | }
139 |
140 | private func descriptionForObject(_ object: AnyObject) -> String {
141 | let pointerDescription = String(format: "%p", UInt(bitPattern: ObjectIdentifier(object)))
142 | var desc = ""
143 |
144 | desc += type(of: object).description()
145 |
146 | if let object = object as? ConstraintView {
147 | desc += ":\(object.snp.label() ?? pointerDescription)"
148 | } else if let object = object as? LayoutConstraint {
149 | desc += ":\(object.label ?? pointerDescription)"
150 | } else {
151 | desc += ":\(pointerDescription)"
152 | }
153 |
154 | if let object = object as? LayoutConstraint, let file = object.constraint?.sourceLocation.0, let line = object.constraint?.sourceLocation.1 {
155 | desc += "@\((file as NSString).lastPathComponent)#\(line)"
156 | }
157 |
158 | desc += ""
159 | return desc
160 | }
161 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/LayoutConstraint.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public class LayoutConstraint : NSLayoutConstraint {
32 |
33 | public var label: String? {
34 | get {
35 | return self.identifier
36 | }
37 | set {
38 | self.identifier = newValue
39 | }
40 | }
41 |
42 | internal weak var constraint: Constraint? = nil
43 |
44 | }
45 |
46 | internal func ==(lhs: LayoutConstraint, rhs: LayoutConstraint) -> Bool {
47 | guard lhs.firstItem === rhs.firstItem &&
48 | lhs.secondItem === rhs.secondItem &&
49 | lhs.firstAttribute == rhs.firstAttribute &&
50 | lhs.secondAttribute == rhs.secondAttribute &&
51 | lhs.relation == rhs.relation &&
52 | lhs.priority == rhs.priority &&
53 | lhs.multiplier == rhs.multiplier else {
54 | return false
55 | }
56 | return true
57 | }
58 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/LayoutConstraintItem.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #else
27 | import AppKit
28 | #endif
29 |
30 |
31 | public protocol LayoutConstraintItem: class {
32 | }
33 |
34 | @available(iOS 9.0, OSX 10.11, *)
35 | extension ConstraintLayoutGuide : LayoutConstraintItem {
36 | }
37 |
38 | extension ConstraintView : LayoutConstraintItem {
39 | }
40 |
41 |
42 | extension LayoutConstraintItem {
43 |
44 | internal func prepare() {
45 | if let view = self as? ConstraintView {
46 | view.translatesAutoresizingMaskIntoConstraints = false
47 | }
48 | }
49 |
50 | internal var superview: ConstraintView? {
51 | if let view = self as? ConstraintView {
52 | return view.superview
53 | }
54 |
55 | if #available(iOS 9.0, OSX 10.11, *), let guide = self as? ConstraintLayoutGuide {
56 | return guide.owningView
57 | }
58 |
59 | return nil
60 | }
61 | internal var constraints: [Constraint] {
62 | return self.constraintsSet.allObjects as! [Constraint]
63 | }
64 |
65 | internal func add(constraints: [Constraint]) {
66 | let constraintsSet = self.constraintsSet
67 | for constraint in constraints {
68 | constraintsSet.add(constraint)
69 | }
70 | }
71 |
72 | internal func remove(constraints: [Constraint]) {
73 | let constraintsSet = self.constraintsSet
74 | for constraint in constraints {
75 | constraintsSet.remove(constraint)
76 | }
77 | }
78 |
79 | private var constraintsSet: NSMutableSet {
80 | let constraintsSet: NSMutableSet
81 |
82 | if let existing = objc_getAssociatedObject(self, &constraintsKey) as? NSMutableSet {
83 | constraintsSet = existing
84 | } else {
85 | constraintsSet = NSMutableSet()
86 | objc_setAssociatedObject(self, &constraintsKey, constraintsSet, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
87 | }
88 | return constraintsSet
89 |
90 | }
91 |
92 | }
93 | private var constraintsKey: UInt8 = 0
94 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/SnapKit/Source/UILayoutSupport+Extensions.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SnapKit
3 | //
4 | // Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 |
24 | #if os(iOS) || os(tvOS)
25 | import UIKit
26 | #endif
27 |
28 |
29 | @available(iOS 8.0, *)
30 | public extension ConstraintLayoutSupport {
31 |
32 | public var snp: ConstraintLayoutSupportDSL {
33 | return ConstraintLayoutSupportDSL(support: self)
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemo/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 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemo/Pods-XiaDemo-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## SnapKit
5 |
6 | Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
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 |
27 | ## Xia
28 |
29 | MIT License
30 |
31 | Copyright (c) 2017 Leo (leodaxia@gmail.com)
32 |
33 | Permission is hereby granted, free of charge, to any person obtaining a copy
34 | of this software and associated documentation files (the "Software"), to deal
35 | in the Software without restriction, including without limitation the rights
36 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
37 | copies of the Software, and to permit persons to whom the Software is
38 | furnished to do so, subject to the following conditions:
39 |
40 | The above copyright notice and this permission notice shall be included in all
41 | copies or substantial portions of the Software.
42 |
43 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
44 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
45 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
46 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
47 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
48 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
49 | SOFTWARE.
50 |
51 | Generated by CocoaPods - https://cocoapods.org
52 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemo/Pods-XiaDemo-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) 2011-Present SnapKit Team - https://github.com/SnapKit
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 | SnapKit
41 | Type
42 | PSGroupSpecifier
43 |
44 |
45 | FooterText
46 | MIT License
47 |
48 | Copyright (c) 2017 Leo (leodaxia@gmail.com)
49 |
50 | Permission is hereby granted, free of charge, to any person obtaining a copy
51 | of this software and associated documentation files (the "Software"), to deal
52 | in the Software without restriction, including without limitation the rights
53 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
54 | copies of the Software, and to permit persons to whom the Software is
55 | furnished to do so, subject to the following conditions:
56 |
57 | The above copyright notice and this permission notice shall be included in all
58 | copies or substantial portions of the Software.
59 |
60 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
61 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
62 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
63 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
64 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
65 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
66 | SOFTWARE.
67 |
68 | License
69 | MIT
70 | Title
71 | Xia
72 | Type
73 | PSGroupSpecifier
74 |
75 |
76 | FooterText
77 | Generated by CocoaPods - https://cocoapods.org
78 | Title
79 |
80 | Type
81 | PSGroupSpecifier
82 |
83 |
84 | StringsTable
85 | Acknowledgements
86 | Title
87 | Acknowledgements
88 |
89 |
90 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemo/Pods-XiaDemo-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_XiaDemo : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_XiaDemo
5 | @end
6 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemo/Pods-XiaDemo-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
6 |
7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
8 |
9 | install_framework()
10 | {
11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
12 | local source="${BUILT_PRODUCTS_DIR}/$1"
13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
15 | elif [ -r "$1" ]; then
16 | local source="$1"
17 | fi
18 |
19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
20 |
21 | if [ -L "${source}" ]; then
22 | echo "Symlinked..."
23 | source="$(readlink "${source}")"
24 | fi
25 |
26 | # use filter instead of exclude so missing patterns dont' throw errors
27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
29 |
30 | local basename
31 | basename="$(basename -s .framework "$1")"
32 | binary="${destination}/${basename}.framework/${basename}"
33 | if ! [ -r "$binary" ]; then
34 | binary="${destination}/${basename}"
35 | fi
36 |
37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
39 | strip_invalid_archs "$binary"
40 | fi
41 |
42 | # Resign the code if required by the build settings to avoid unstable apps
43 | code_sign_if_enabled "${destination}/$(basename "$1")"
44 |
45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
47 | local swift_runtime_libs
48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
49 | for lib in $swift_runtime_libs; do
50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
52 | code_sign_if_enabled "${destination}/${lib}"
53 | done
54 | fi
55 | }
56 |
57 | # Signs a framework with the provided identity
58 | code_sign_if_enabled() {
59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
60 | # Use the current code_sign_identitiy
61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
62 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'"
63 |
64 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
65 | code_sign_cmd="$code_sign_cmd &"
66 | fi
67 | echo "$code_sign_cmd"
68 | eval "$code_sign_cmd"
69 | fi
70 | }
71 |
72 | # Strip invalid architectures
73 | strip_invalid_archs() {
74 | binary="$1"
75 | # Get architectures for current file
76 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
77 | stripped=""
78 | for arch in $archs; do
79 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
80 | # Strip non-valid architectures in-place
81 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1
82 | stripped="$stripped $arch"
83 | fi
84 | done
85 | if [[ "$stripped" ]]; then
86 | echo "Stripped $binary of architectures:$stripped"
87 | fi
88 | }
89 |
90 |
91 | if [[ "$CONFIGURATION" == "Debug" ]]; then
92 | install_framework "$BUILT_PRODUCTS_DIR/SnapKit/SnapKit.framework"
93 | install_framework "$BUILT_PRODUCTS_DIR/Xia/Xia.framework"
94 | fi
95 | if [[ "$CONFIGURATION" == "Release" ]]; then
96 | install_framework "$BUILT_PRODUCTS_DIR/SnapKit/SnapKit.framework"
97 | install_framework "$BUILT_PRODUCTS_DIR/Xia/Xia.framework"
98 | fi
99 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
100 | wait
101 | fi
102 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemo/Pods-XiaDemo-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
5 |
6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
7 | > "$RESOURCES_TO_COPY"
8 |
9 | XCASSET_FILES=()
10 |
11 | case "${TARGETED_DEVICE_FAMILY}" in
12 | 1,2)
13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
14 | ;;
15 | 1)
16 | TARGET_DEVICE_ARGS="--target-device iphone"
17 | ;;
18 | 2)
19 | TARGET_DEVICE_ARGS="--target-device ipad"
20 | ;;
21 | 3)
22 | TARGET_DEVICE_ARGS="--target-device tv"
23 | ;;
24 | *)
25 | TARGET_DEVICE_ARGS="--target-device mac"
26 | ;;
27 | esac
28 |
29 | install_resource()
30 | {
31 | if [[ "$1" = /* ]] ; then
32 | RESOURCE_PATH="$1"
33 | else
34 | RESOURCE_PATH="${PODS_ROOT}/$1"
35 | fi
36 | if [[ ! -e "$RESOURCE_PATH" ]] ; then
37 | cat << EOM
38 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
39 | EOM
40 | exit 1
41 | fi
42 | case $RESOURCE_PATH in
43 | *.storyboard)
44 | 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}"
45 | 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}
46 | ;;
47 | *.xib)
48 | 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}"
49 | 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}
50 | ;;
51 | *.framework)
52 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
53 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
54 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
55 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
56 | ;;
57 | *.xcdatamodel)
58 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
59 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
60 | ;;
61 | *.xcdatamodeld)
62 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
63 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
64 | ;;
65 | *.xcmappingmodel)
66 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
67 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
68 | ;;
69 | *.xcassets)
70 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
71 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
72 | ;;
73 | *)
74 | echo "$RESOURCE_PATH"
75 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
76 | ;;
77 | esac
78 | }
79 |
80 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
81 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
82 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
83 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
84 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
85 | fi
86 | rm -f "$RESOURCES_TO_COPY"
87 |
88 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
89 | then
90 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
91 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
92 | while read line; do
93 | if [[ $line != "${PODS_ROOT}*" ]]; then
94 | XCASSET_FILES+=("$line")
95 | fi
96 | done <<<"$OTHER_XCASSETS"
97 |
98 | 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}"
99 | fi
100 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemo/Pods-XiaDemo-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_XiaDemoVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_XiaDemoVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemo/Pods-XiaDemo.debug.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SnapKit" "$PODS_CONFIGURATION_BUILD_DIR/Xia"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/SnapKit/SnapKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Xia/Xia.framework/Headers"
6 | OTHER_LDFLAGS = $(inherited) -framework "SnapKit" -framework "Xia"
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_ROOT = ${SRCROOT}/Pods
11 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemo/Pods-XiaDemo.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_XiaDemo {
2 | umbrella header "Pods-XiaDemo-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemo/Pods-XiaDemo.release.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SnapKit" "$PODS_CONFIGURATION_BUILD_DIR/Xia"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/SnapKit/SnapKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Xia/Xia.framework/Headers"
6 | OTHER_LDFLAGS = $(inherited) -framework "SnapKit" -framework "Xia"
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_ROOT = ${SRCROOT}/Pods
11 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemoTests/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 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemoTests/Pods-XiaDemoTests-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 | Generated by CocoaPods - https://cocoapods.org
4 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemoTests/Pods-XiaDemoTests-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 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemoTests/Pods-XiaDemoTests-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_XiaDemoTests : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_XiaDemoTests
5 | @end
6 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemoTests/Pods-XiaDemoTests-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
6 |
7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
8 |
9 | install_framework()
10 | {
11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
12 | local source="${BUILT_PRODUCTS_DIR}/$1"
13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
15 | elif [ -r "$1" ]; then
16 | local source="$1"
17 | fi
18 |
19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
20 |
21 | if [ -L "${source}" ]; then
22 | echo "Symlinked..."
23 | source="$(readlink "${source}")"
24 | fi
25 |
26 | # use filter instead of exclude so missing patterns dont' throw errors
27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
29 |
30 | local basename
31 | basename="$(basename -s .framework "$1")"
32 | binary="${destination}/${basename}.framework/${basename}"
33 | if ! [ -r "$binary" ]; then
34 | binary="${destination}/${basename}"
35 | fi
36 |
37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
39 | strip_invalid_archs "$binary"
40 | fi
41 |
42 | # Resign the code if required by the build settings to avoid unstable apps
43 | code_sign_if_enabled "${destination}/$(basename "$1")"
44 |
45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
47 | local swift_runtime_libs
48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
49 | for lib in $swift_runtime_libs; do
50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
52 | code_sign_if_enabled "${destination}/${lib}"
53 | done
54 | fi
55 | }
56 |
57 | # Signs a framework with the provided identity
58 | code_sign_if_enabled() {
59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
60 | # Use the current code_sign_identitiy
61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
62 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'"
63 |
64 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
65 | code_sign_cmd="$code_sign_cmd &"
66 | fi
67 | echo "$code_sign_cmd"
68 | eval "$code_sign_cmd"
69 | fi
70 | }
71 |
72 | # Strip invalid architectures
73 | strip_invalid_archs() {
74 | binary="$1"
75 | # Get architectures for current file
76 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
77 | stripped=""
78 | for arch in $archs; do
79 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
80 | # Strip non-valid architectures in-place
81 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1
82 | stripped="$stripped $arch"
83 | fi
84 | done
85 | if [[ "$stripped" ]]; then
86 | echo "Stripped $binary of architectures:$stripped"
87 | fi
88 | }
89 |
90 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
91 | wait
92 | fi
93 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemoTests/Pods-XiaDemoTests-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
5 |
6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
7 | > "$RESOURCES_TO_COPY"
8 |
9 | XCASSET_FILES=()
10 |
11 | case "${TARGETED_DEVICE_FAMILY}" in
12 | 1,2)
13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
14 | ;;
15 | 1)
16 | TARGET_DEVICE_ARGS="--target-device iphone"
17 | ;;
18 | 2)
19 | TARGET_DEVICE_ARGS="--target-device ipad"
20 | ;;
21 | 3)
22 | TARGET_DEVICE_ARGS="--target-device tv"
23 | ;;
24 | *)
25 | TARGET_DEVICE_ARGS="--target-device mac"
26 | ;;
27 | esac
28 |
29 | install_resource()
30 | {
31 | if [[ "$1" = /* ]] ; then
32 | RESOURCE_PATH="$1"
33 | else
34 | RESOURCE_PATH="${PODS_ROOT}/$1"
35 | fi
36 | if [[ ! -e "$RESOURCE_PATH" ]] ; then
37 | cat << EOM
38 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
39 | EOM
40 | exit 1
41 | fi
42 | case $RESOURCE_PATH in
43 | *.storyboard)
44 | 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}"
45 | 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}
46 | ;;
47 | *.xib)
48 | 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}"
49 | 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}
50 | ;;
51 | *.framework)
52 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
53 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
54 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
55 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
56 | ;;
57 | *.xcdatamodel)
58 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
59 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
60 | ;;
61 | *.xcdatamodeld)
62 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
63 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
64 | ;;
65 | *.xcmappingmodel)
66 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
67 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
68 | ;;
69 | *.xcassets)
70 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
71 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
72 | ;;
73 | *)
74 | echo "$RESOURCE_PATH"
75 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
76 | ;;
77 | esac
78 | }
79 |
80 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
81 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
82 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
83 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
84 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
85 | fi
86 | rm -f "$RESOURCES_TO_COPY"
87 |
88 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
89 | then
90 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
91 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
92 | while read line; do
93 | if [[ $line != "${PODS_ROOT}*" ]]; then
94 | XCASSET_FILES+=("$line")
95 | fi
96 | done <<<"$OTHER_XCASSETS"
97 |
98 | 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}"
99 | fi
100 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemoTests/Pods-XiaDemoTests-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_XiaDemoTestsVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_XiaDemoTestsVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemoTests/Pods-XiaDemoTests.debug.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SnapKit" "$PODS_CONFIGURATION_BUILD_DIR/Xia"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/SnapKit/SnapKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Xia/Xia.framework/Headers"
5 | PODS_BUILD_DIR = $BUILD_DIR
6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_ROOT = ${SRCROOT}/Pods
8 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemoTests/Pods-XiaDemoTests.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_XiaDemoTests {
2 | umbrella header "Pods-XiaDemoTests-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemoTests/Pods-XiaDemoTests.release.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SnapKit" "$PODS_CONFIGURATION_BUILD_DIR/Xia"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/SnapKit/SnapKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Xia/Xia.framework/Headers"
5 | PODS_BUILD_DIR = $BUILD_DIR
6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_ROOT = ${SRCROOT}/Pods
8 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemoUITests/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 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemoUITests/Pods-XiaDemoUITests-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 | Generated by CocoaPods - https://cocoapods.org
4 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemoUITests/Pods-XiaDemoUITests-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 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemoUITests/Pods-XiaDemoUITests-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_XiaDemoUITests : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_XiaDemoUITests
5 | @end
6 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemoUITests/Pods-XiaDemoUITests-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
6 |
7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
8 |
9 | install_framework()
10 | {
11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
12 | local source="${BUILT_PRODUCTS_DIR}/$1"
13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
15 | elif [ -r "$1" ]; then
16 | local source="$1"
17 | fi
18 |
19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
20 |
21 | if [ -L "${source}" ]; then
22 | echo "Symlinked..."
23 | source="$(readlink "${source}")"
24 | fi
25 |
26 | # use filter instead of exclude so missing patterns dont' throw errors
27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
29 |
30 | local basename
31 | basename="$(basename -s .framework "$1")"
32 | binary="${destination}/${basename}.framework/${basename}"
33 | if ! [ -r "$binary" ]; then
34 | binary="${destination}/${basename}"
35 | fi
36 |
37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
39 | strip_invalid_archs "$binary"
40 | fi
41 |
42 | # Resign the code if required by the build settings to avoid unstable apps
43 | code_sign_if_enabled "${destination}/$(basename "$1")"
44 |
45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
47 | local swift_runtime_libs
48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
49 | for lib in $swift_runtime_libs; do
50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
52 | code_sign_if_enabled "${destination}/${lib}"
53 | done
54 | fi
55 | }
56 |
57 | # Signs a framework with the provided identity
58 | code_sign_if_enabled() {
59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
60 | # Use the current code_sign_identitiy
61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
62 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'"
63 |
64 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
65 | code_sign_cmd="$code_sign_cmd &"
66 | fi
67 | echo "$code_sign_cmd"
68 | eval "$code_sign_cmd"
69 | fi
70 | }
71 |
72 | # Strip invalid architectures
73 | strip_invalid_archs() {
74 | binary="$1"
75 | # Get architectures for current file
76 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
77 | stripped=""
78 | for arch in $archs; do
79 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
80 | # Strip non-valid architectures in-place
81 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1
82 | stripped="$stripped $arch"
83 | fi
84 | done
85 | if [[ "$stripped" ]]; then
86 | echo "Stripped $binary of architectures:$stripped"
87 | fi
88 | }
89 |
90 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
91 | wait
92 | fi
93 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemoUITests/Pods-XiaDemoUITests-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
5 |
6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
7 | > "$RESOURCES_TO_COPY"
8 |
9 | XCASSET_FILES=()
10 |
11 | case "${TARGETED_DEVICE_FAMILY}" in
12 | 1,2)
13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
14 | ;;
15 | 1)
16 | TARGET_DEVICE_ARGS="--target-device iphone"
17 | ;;
18 | 2)
19 | TARGET_DEVICE_ARGS="--target-device ipad"
20 | ;;
21 | 3)
22 | TARGET_DEVICE_ARGS="--target-device tv"
23 | ;;
24 | *)
25 | TARGET_DEVICE_ARGS="--target-device mac"
26 | ;;
27 | esac
28 |
29 | install_resource()
30 | {
31 | if [[ "$1" = /* ]] ; then
32 | RESOURCE_PATH="$1"
33 | else
34 | RESOURCE_PATH="${PODS_ROOT}/$1"
35 | fi
36 | if [[ ! -e "$RESOURCE_PATH" ]] ; then
37 | cat << EOM
38 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
39 | EOM
40 | exit 1
41 | fi
42 | case $RESOURCE_PATH in
43 | *.storyboard)
44 | 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}"
45 | 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}
46 | ;;
47 | *.xib)
48 | 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}"
49 | 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}
50 | ;;
51 | *.framework)
52 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
53 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
54 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
55 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
56 | ;;
57 | *.xcdatamodel)
58 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
59 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
60 | ;;
61 | *.xcdatamodeld)
62 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
63 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
64 | ;;
65 | *.xcmappingmodel)
66 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
67 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
68 | ;;
69 | *.xcassets)
70 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
71 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
72 | ;;
73 | *)
74 | echo "$RESOURCE_PATH"
75 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
76 | ;;
77 | esac
78 | }
79 |
80 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
81 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
82 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
83 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
84 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
85 | fi
86 | rm -f "$RESOURCES_TO_COPY"
87 |
88 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
89 | then
90 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
91 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
92 | while read line; do
93 | if [[ $line != "${PODS_ROOT}*" ]]; then
94 | XCASSET_FILES+=("$line")
95 | fi
96 | done <<<"$OTHER_XCASSETS"
97 |
98 | 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}"
99 | fi
100 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemoUITests/Pods-XiaDemoUITests-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_XiaDemoUITestsVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_XiaDemoUITestsVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemoUITests/Pods-XiaDemoUITests.debug.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SnapKit" "$PODS_CONFIGURATION_BUILD_DIR/Xia"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/SnapKit/SnapKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Xia/Xia.framework/Headers"
5 | PODS_BUILD_DIR = $BUILD_DIR
6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_ROOT = ${SRCROOT}/Pods
8 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemoUITests/Pods-XiaDemoUITests.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_XiaDemoUITests {
2 | umbrella header "Pods-XiaDemoUITests-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Pods-XiaDemoUITests/Pods-XiaDemoUITests.release.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SnapKit" "$PODS_CONFIGURATION_BUILD_DIR/Xia"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/SnapKit/SnapKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Xia/Xia.framework/Headers"
5 | PODS_BUILD_DIR = $BUILD_DIR
6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_ROOT = ${SRCROOT}/Pods
8 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/SnapKit/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 | 3.2.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/SnapKit/SnapKit-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_SnapKit : NSObject
3 | @end
4 | @implementation PodsDummy_SnapKit
5 | @end
6 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/SnapKit/SnapKit-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 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/SnapKit/SnapKit-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 SnapKitVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char SnapKitVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/SnapKit/SnapKit.modulemap:
--------------------------------------------------------------------------------
1 | framework module SnapKit {
2 | umbrella header "SnapKit-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/SnapKit/SnapKit.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/SnapKit
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
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}/SnapKit
9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
10 | SKIP_INSTALL = YES
11 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Xia/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.0.2
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Xia/Xia-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Xia : NSObject
3 | @end
4 | @implementation PodsDummy_Xia
5 | @end
6 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Xia/Xia-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 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Xia/Xia-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 XiaVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char XiaVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Xia/Xia.modulemap:
--------------------------------------------------------------------------------
1 | framework module Xia {
2 | umbrella header "Xia-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/XiaDemo/Pods/Target Support Files/Xia/Xia.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Xia
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SnapKit"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
5 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
6 | PODS_BUILD_DIR = $BUILD_DIR
7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_ROOT = ${SRCROOT}
9 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../..
10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
11 | SKIP_INSTALL = YES
12 |
--------------------------------------------------------------------------------
/XiaDemo/XiaDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/XiaDemo/XiaDemo.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/XiaDemo/XiaDemo/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // XiaDemo
4 | //
5 | // Created by Leo on 27/02/2017.
6 | // Copyright © 2017 Leo. 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: [UIApplicationLaunchOptionsKey: 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 invalidate graphics rendering callbacks. 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 active 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 |
--------------------------------------------------------------------------------
/XiaDemo/XiaDemo/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "ipad",
35 | "size" : "29x29",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "29x29",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "40x40",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "40x40",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "76x76",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "76x76",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
--------------------------------------------------------------------------------
/XiaDemo/XiaDemo/Base.lproj/LaunchScreen.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 |
--------------------------------------------------------------------------------
/XiaDemo/XiaDemo/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 |
37 |
50 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/XiaDemo/XiaDemo/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 | 0.0.4
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 | UIViewControllerBasedStatusBarAppearance
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/XiaDemo/XiaDemo/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // XiaDemo
4 | //
5 | // Created by Leo on 27/02/2017.
6 | // Copyright © 2017 Leo. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import Xia
11 |
12 | class ViewController: UIViewController {
13 |
14 | override func viewDidLoad() {
15 | super.viewDidLoad()
16 |
17 | let navBar = self.navigationController?.navigationBar
18 | navBar?.backgroundColor = UIColor.blue
19 | }
20 |
21 | func generateXia() -> Xia {
22 | return Xia()
23 | }
24 |
25 | @IBAction func onShowInfo() {
26 | UIApplication.shared.setStatusBarStyle(.default, animated: true)
27 |
28 | Xia.showInfo("每天最多给 10 个人点赞哦")
29 | }
30 |
31 | @IBAction func onShowSuccess() {
32 | UIApplication.shared.setStatusBarStyle(.default, animated: true)
33 |
34 | Xia.showSuccess("点赞成功")
35 | }
36 |
37 | @IBAction func onShowWarning() {
38 | UIApplication.shared.setStatusBarStyle(.lightContent, animated: true)
39 |
40 | let xia = Xia()
41 | xia.autoHide = false
42 | xia.textFont = UIFont.boldSystemFont(ofSize: 14.0)
43 | xia.showWarning("点赞失败,请稍后重试", backgroundColor: UIColor.red)
44 |
45 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + .seconds(5)) {
46 | UIApplication.shared.setStatusBarStyle(.default, animated: true)
47 |
48 | xia.hide()
49 | }
50 | }
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/XiaDemo/XiaDemoTests/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 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/XiaDemo/XiaDemoTests/XiaDemoTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // XiaDemoTests.swift
3 | // XiaDemoTests
4 | //
5 | // Created by Leo on 27/02/2017.
6 | // Copyright © 2017 Leo. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | @testable import XiaDemo
11 |
12 | class XiaDemoTests: XCTestCase {
13 |
14 | override func setUp() {
15 | super.setUp()
16 | // Put setup code here. This method is called before the invocation of each test method in the class.
17 | }
18 |
19 | override func tearDown() {
20 | // Put teardown code here. This method is called after the invocation of each test method in the class.
21 | super.tearDown()
22 | }
23 |
24 | func testExample() {
25 | // This is an example of a functional test case.
26 | // Use XCTAssert and related functions to verify your tests produce the correct results.
27 | }
28 |
29 | func testPerformanceExample() {
30 | // This is an example of a performance test case.
31 | self.measure {
32 | // Put the code you want to measure the time of here.
33 | }
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/XiaDemo/XiaDemoUITests/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 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/XiaDemo/XiaDemoUITests/XiaDemoUITests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // XiaDemoUITests.swift
3 | // XiaDemoUITests
4 | //
5 | // Created by Leo on 27/02/2017.
6 | // Copyright © 2017 Leo. All rights reserved.
7 | //
8 |
9 | import XCTest
10 |
11 | class XiaDemoUITests: XCTestCase {
12 |
13 | override func setUp() {
14 | super.setUp()
15 |
16 | // Put setup code here. This method is called before the invocation of each test method in the class.
17 |
18 | // In UI tests it is usually best to stop immediately when a failure occurs.
19 | continueAfterFailure = false
20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
21 | XCUIApplication().launch()
22 |
23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
24 | }
25 |
26 | override func tearDown() {
27 | // Put teardown code here. This method is called after the invocation of each test method in the class.
28 | super.tearDown()
29 | }
30 |
31 | func testExample() {
32 | // Use recording to get started writing UI tests.
33 | // Use XCTAssert and related functions to verify your tests produce the correct results.
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/XiaDemoImage/XiaDemoImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iTofu/Xia/565342f555ed522ef8997dd0b779e5467ad4b72f/XiaDemoImage/XiaDemoImage.png
--------------------------------------------------------------------------------
/XiaDemoImage/XiaDemoImageInfo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iTofu/Xia/565342f555ed522ef8997dd0b779e5467ad4b72f/XiaDemoImage/XiaDemoImageInfo.png
--------------------------------------------------------------------------------
/XiaDemoImage/XiaDemoImageSuccess.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iTofu/Xia/565342f555ed522ef8997dd0b779e5467ad4b72f/XiaDemoImage/XiaDemoImageSuccess.png
--------------------------------------------------------------------------------
/XiaDemoImage/XiaDemoImageWarning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iTofu/Xia/565342f555ed522ef8997dd0b779e5467ad4b72f/XiaDemoImage/XiaDemoImageWarning.png
--------------------------------------------------------------------------------