├── Podfile
├── Podfile.lock
├── Pods
├── Manifest.lock
├── Pods.xcodeproj
│ ├── project.pbxproj
│ └── xcuserdata
│ │ ├── aa.xcuserdatad
│ │ └── xcschemes
│ │ │ ├── Pods-WaterfallLayoutDemo.xcscheme
│ │ │ ├── SnapKit.xcscheme
│ │ │ └── xcschememanagement.plist
│ │ └── zhoujianping.xcuserdatad
│ │ └── xcschemes
│ │ ├── Pods-WaterfallLayoutDemo.xcscheme
│ │ ├── SnapKit.xcscheme
│ │ ├── pop.xcscheme
│ │ └── xcschememanagement.plist
├── SnapKit
│ ├── LICENSE
│ ├── README.md
│ └── Sources
│ │ ├── Constraint.swift
│ │ ├── ConstraintAttributes.swift
│ │ ├── ConstraintConfig.swift
│ │ ├── ConstraintConstantTarget.swift
│ │ ├── ConstraintDSL.swift
│ │ ├── ConstraintDescription.swift
│ │ ├── ConstraintDirectionalInsetTarget.swift
│ │ ├── ConstraintDirectionalInsets.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
│ │ ├── ConstraintMakerPrioritizable.swift
│ │ ├── ConstraintMakerRelatable+Extensions.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
│ │ ├── Typealiases.swift
│ │ └── UILayoutSupport+Extensions.swift
├── Target Support Files
│ ├── Pods-WaterfallLayoutDemo
│ │ ├── Pods-WaterfallLayoutDemo-Info.plist
│ │ ├── Pods-WaterfallLayoutDemo-acknowledgements.markdown
│ │ ├── Pods-WaterfallLayoutDemo-acknowledgements.plist
│ │ ├── Pods-WaterfallLayoutDemo-dummy.m
│ │ ├── Pods-WaterfallLayoutDemo-frameworks-Debug-input-files.xcfilelist
│ │ ├── Pods-WaterfallLayoutDemo-frameworks-Debug-output-files.xcfilelist
│ │ ├── Pods-WaterfallLayoutDemo-frameworks-Release-input-files.xcfilelist
│ │ ├── Pods-WaterfallLayoutDemo-frameworks-Release-output-files.xcfilelist
│ │ ├── Pods-WaterfallLayoutDemo-frameworks.sh
│ │ ├── Pods-WaterfallLayoutDemo-umbrella.h
│ │ ├── Pods-WaterfallLayoutDemo.debug.xcconfig
│ │ ├── Pods-WaterfallLayoutDemo.modulemap
│ │ └── Pods-WaterfallLayoutDemo.release.xcconfig
│ ├── SnapKit
│ │ ├── SnapKit-Info.plist
│ │ ├── SnapKit-dummy.m
│ │ ├── SnapKit-prefix.pch
│ │ ├── SnapKit-umbrella.h
│ │ ├── SnapKit.debug.xcconfig
│ │ ├── SnapKit.modulemap
│ │ └── SnapKit.release.xcconfig
│ └── pop
│ │ ├── pop-Info.plist
│ │ ├── pop-dummy.m
│ │ ├── pop-prefix.pch
│ │ ├── pop-umbrella.h
│ │ ├── pop.debug.xcconfig
│ │ ├── pop.modulemap
│ │ └── pop.release.xcconfig
└── pop
│ ├── LICENSE
│ ├── README.md
│ └── pop
│ ├── POP.h
│ ├── POPAction.h
│ ├── POPAnimatableProperty.h
│ ├── POPAnimatableProperty.mm
│ ├── POPAnimatablePropertyTypes.h
│ ├── POPAnimation.h
│ ├── POPAnimation.mm
│ ├── POPAnimationEvent.h
│ ├── POPAnimationEvent.mm
│ ├── POPAnimationEventInternal.h
│ ├── POPAnimationExtras.h
│ ├── POPAnimationExtras.mm
│ ├── POPAnimationInternal.h
│ ├── POPAnimationPrivate.h
│ ├── POPAnimationRuntime.h
│ ├── POPAnimationRuntime.mm
│ ├── POPAnimationTracer.h
│ ├── POPAnimationTracer.mm
│ ├── POPAnimationTracerInternal.h
│ ├── POPAnimator.h
│ ├── POPAnimator.mm
│ ├── POPAnimatorPrivate.h
│ ├── POPBasicAnimation.h
│ ├── POPBasicAnimation.mm
│ ├── POPBasicAnimationInternal.h
│ ├── POPCGUtils.h
│ ├── POPCGUtils.mm
│ ├── POPCustomAnimation.h
│ ├── POPCustomAnimation.mm
│ ├── POPDecayAnimation.h
│ ├── POPDecayAnimation.mm
│ ├── POPDecayAnimationInternal.h
│ ├── POPDefines.h
│ ├── POPGeometry.h
│ ├── POPGeometry.mm
│ ├── POPLayerExtras.h
│ ├── POPLayerExtras.mm
│ ├── POPMath.h
│ ├── POPMath.mm
│ ├── POPPropertyAnimation.h
│ ├── POPPropertyAnimation.mm
│ ├── POPPropertyAnimationInternal.h
│ ├── POPSpringAnimation.h
│ ├── POPSpringAnimation.mm
│ ├── POPSpringAnimationInternal.h
│ ├── POPSpringSolver.h
│ ├── POPVector.h
│ ├── POPVector.mm
│ └── WebCore
│ ├── FloatConversion.h
│ ├── TransformationMatrix.cpp
│ ├── TransformationMatrix.h
│ └── UnitBezier.h
├── README.md
├── WaterfallLayoutDemo.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ ├── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
│ └── xcuserdata
│ │ └── aa.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
└── xcuserdata
│ ├── aa.xcuserdatad
│ └── xcschemes
│ │ └── xcschememanagement.plist
│ └── zhoujianping.xcuserdatad
│ └── xcschemes
│ └── xcschememanagement.plist
├── WaterfallLayoutDemo.xcworkspace
├── contents.xcworkspacedata
├── xcshareddata
│ └── IDEWorkspaceChecks.plist
└── xcuserdata
│ ├── aa.xcuserdatad
│ ├── UserInterfaceState.xcuserstate
│ └── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ └── zhoujianping.xcuserdatad
│ ├── UserInterfaceState.xcuserstate
│ └── xcdebugger
│ └── Breakpoints_v2.xcbkptlist
└── WaterfallLayoutDemo
├── AppDelegate.swift
├── Assets.xcassets
├── AccentColor.colorset
│ └── Contents.json
├── AppIcon.appiconset
│ └── Contents.json
└── Contents.json
├── Base.lproj
├── LaunchScreen.storyboard
└── Main.storyboard
├── Browse
└── BrowseImageView.swift
├── Cell
└── WaterfallCell.swift
├── Data
├── WaterfallModel.swift
└── WaterfallStore.swift
├── Extensions.swift
├── Info.plist
├── JPBlurView
├── JPBlurAnimationView.swift
└── JPBlurView.swift
├── Pictures
├── girl_1.jpg
├── girl_10.jpg
├── girl_11.jpg
├── girl_12.jpg
├── girl_13.jpg
├── girl_14.jpg
├── girl_15.jpg
├── girl_16.jpg
├── girl_2.jpg
├── girl_3.jpg
├── girl_4.jpg
├── girl_5.jpg
├── girl_6.jpg
├── girl_7.jpg
├── girl_8.jpg
└── girl_9.jpg
├── SceneDelegate.swift
├── ScreenRotator.swift
├── ViewController.swift
├── WaterfallLayout-Bridging-Header.h
└── WaterfallLayout
└── WaterfallLayout.swift
/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment the next line to define a global platform for your project
2 | platform :ios, '13.0'
3 |
4 | target 'WaterfallLayoutDemo' do
5 | use_frameworks!
6 |
7 | pod 'SnapKit'
8 | pod 'pop'
9 |
10 | post_install do |installer|
11 | installer.pods_project.targets.each do |target|
12 | target.build_configurations.each do |config|
13 | config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
14 | end
15 | end
16 | end
17 |
18 | end
19 |
--------------------------------------------------------------------------------
/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - pop (1.0.12)
3 | - SnapKit (5.6.0)
4 |
5 | DEPENDENCIES:
6 | - pop
7 | - SnapKit
8 |
9 | SPEC REPOS:
10 | trunk:
11 | - pop
12 | - SnapKit
13 |
14 | SPEC CHECKSUMS:
15 | pop: d582054913807fd11fd50bfe6a539d91c7e1a55a
16 | SnapKit: e01d52ebb8ddbc333eefe2132acf85c8227d9c25
17 |
18 | PODFILE CHECKSUM: dc7b2f31b783d0ae4b894bf35d116f97120c6b93
19 |
20 | COCOAPODS: 1.12.1
21 |
--------------------------------------------------------------------------------
/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - pop (1.0.12)
3 | - SnapKit (5.6.0)
4 |
5 | DEPENDENCIES:
6 | - pop
7 | - SnapKit
8 |
9 | SPEC REPOS:
10 | trunk:
11 | - pop
12 | - SnapKit
13 |
14 | SPEC CHECKSUMS:
15 | pop: d582054913807fd11fd50bfe6a539d91c7e1a55a
16 | SnapKit: e01d52ebb8ddbc333eefe2132acf85c8227d9c25
17 |
18 | PODFILE CHECKSUM: dc7b2f31b783d0ae4b894bf35d116f97120c6b93
19 |
20 | COCOAPODS: 1.12.1
21 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/aa.xcuserdatad/xcschemes/Pods-WaterfallLayoutDemo.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
50 |
51 |
53 |
54 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/aa.xcuserdatad/xcschemes/SnapKit.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
50 |
51 |
53 |
54 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/aa.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Pods-WaterfallLayoutDemo.xcscheme
8 |
9 | isShown
10 |
11 | orderHint
12 | 0
13 |
14 | SnapKit.xcscheme
15 |
16 | isShown
17 |
18 | orderHint
19 | 1
20 |
21 |
22 | SuppressBuildableAutocreation
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/zhoujianping.xcuserdatad/xcschemes/Pods-WaterfallLayoutDemo.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
50 |
51 |
53 |
54 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/zhoujianping.xcuserdatad/xcschemes/SnapKit.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
50 |
51 |
53 |
54 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/zhoujianping.xcuserdatad/xcschemes/pop.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
50 |
51 |
53 |
54 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/zhoujianping.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Pods-WaterfallLayoutDemo.xcscheme
8 |
9 | isShown
10 |
11 | orderHint
12 | 0
13 |
14 | SnapKit.xcscheme
15 |
16 | isShown
17 |
18 | orderHint
19 | 2
20 |
21 | pop.xcscheme
22 |
23 | isShown
24 |
25 | orderHint
26 | 1
27 |
28 |
29 | SuppressBuildableAutocreation
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/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 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/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 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/ConstraintDirectionalInsetTarget.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 | #if os(iOS) || os(tvOS)
31 | public protocol ConstraintDirectionalInsetTarget: ConstraintConstantTarget {
32 | }
33 |
34 | @available(iOS 11.0, tvOS 11.0, *)
35 | extension ConstraintDirectionalInsets: ConstraintDirectionalInsetTarget {
36 | }
37 |
38 | extension ConstraintDirectionalInsetTarget {
39 |
40 | @available(iOS 11.0, tvOS 11.0, *)
41 | internal var constraintDirectionalInsetTargetValue: ConstraintDirectionalInsets {
42 | if let amount = self as? ConstraintDirectionalInsets {
43 | return amount
44 | } else {
45 | return ConstraintDirectionalInsets(top: 0, leading: 0, bottom: 0, trailing: 0)
46 | }
47 | }
48 | }
49 | #endif
50 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/ConstraintDirectionalInsets.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 11.0, tvOS 11.0, *)
33 | public typealias ConstraintDirectionalInsets = NSDirectionalEdgeInsets
34 | #endif
35 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/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 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/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 = NSEdgeInsets
35 | #endif
36 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/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 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/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 | var snp: ConstraintLayoutGuideDSL {
33 | return ConstraintLayoutGuideDSL(guide: self)
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/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 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/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 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/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 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/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 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/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: ConstraintMakerPrioritizable {
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 | #if os(iOS) || os(tvOS)
57 | @discardableResult
58 | @available(iOS 11.0, tvOS 11.0, *)
59 | public func inset(_ amount: ConstraintDirectionalInsetTarget) -> ConstraintMakerEditable {
60 | self.description.constant = amount.constraintDirectionalInsetTargetValue
61 | return self
62 | }
63 | #endif
64 | }
65 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/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 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/ConstraintMakerPrioritizable.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 | @available(*, deprecated, message:"Use ConstraintMakerPrioritizable instead.")
31 | public typealias ConstraintMakerPriortizable = ConstraintMakerPrioritizable
32 |
33 | public class ConstraintMakerPrioritizable: ConstraintMakerFinalizable {
34 |
35 | @discardableResult
36 | public func priority(_ amount: ConstraintPriority) -> ConstraintMakerFinalizable {
37 | self.description.priority = amount.value
38 | return self
39 | }
40 |
41 | @discardableResult
42 | public func priority(_ amount: ConstraintPriorityTarget) -> ConstraintMakerFinalizable {
43 | self.description.priority = amount
44 | return self
45 | }
46 |
47 | @available(*, deprecated, message:"Use priority(.required) instead.")
48 | @discardableResult
49 | public func priorityRequired() -> ConstraintMakerFinalizable {
50 | return self.priority(.required)
51 | }
52 |
53 | @available(*, deprecated, message:"Use priority(.high) instead.")
54 | @discardableResult
55 | public func priorityHigh() -> ConstraintMakerFinalizable {
56 | return self.priority(.high)
57 | }
58 |
59 | @available(*, deprecated, message:"Use priority(.medium) instead.")
60 | @discardableResult
61 | public func priorityMedium() -> ConstraintMakerFinalizable {
62 | return self.priority(.medium)
63 | }
64 |
65 | @available(*, deprecated, message:"Use priority(.low) instead.")
66 | @discardableResult
67 | public func priorityLow() -> ConstraintMakerFinalizable {
68 | return self.priority(.low)
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/ConstraintMakerRelatable+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 | extension ConstraintMakerRelatable {
32 |
33 | @discardableResult
34 | public func equalToSuperview(_ closure: (ConstraintView) -> T, _ file: String = #file, line: UInt = #line) -> ConstraintMakerEditable {
35 | guard let other = self.description.item.superview else {
36 | fatalError("Expected superview but found nil when attempting make constraint `equalToSuperview`.")
37 | }
38 | return self.relatedTo(closure(other), relation: .equal, file: file, line: line)
39 | }
40 |
41 | @discardableResult
42 | public func lessThanOrEqualToSuperview(_ closure: (ConstraintView) -> T, _ file: String = #file, line: UInt = #line) -> ConstraintMakerEditable {
43 | guard let other = self.description.item.superview else {
44 | fatalError("Expected superview but found nil when attempting make constraint `lessThanOrEqualToSuperview`.")
45 | }
46 | return self.relatedTo(closure(other), relation: .lessThanOrEqual, file: file, line: line)
47 | }
48 |
49 | @discardableResult
50 | public func greaterThanOrEqualTo(_ closure: (ConstraintView) -> T, _ file: String = #file, line: UInt = #line) -> ConstraintMakerEditable {
51 | guard let other = self.description.item.superview else {
52 | fatalError("Expected superview but found nil when attempting make constraint `greaterThanOrEqualToSuperview`.")
53 | }
54 | return self.relatedTo(closure(other), relation: .greaterThanOrEqual, file: file, line: line)
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/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 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/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 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/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 | public struct ConstraintPriority : ExpressibleByFloatLiteral, Equatable, Strideable {
31 | public typealias FloatLiteralType = Float
32 |
33 | public let value: Float
34 |
35 | public init(floatLiteral value: Float) {
36 | self.value = value
37 | }
38 |
39 | public init(_ value: Float) {
40 | self.value = value
41 | }
42 |
43 | public static var required: ConstraintPriority {
44 | return 1000.0
45 | }
46 |
47 | public static var high: ConstraintPriority {
48 | return 750.0
49 | }
50 |
51 | public static var medium: ConstraintPriority {
52 | #if os(OSX)
53 | return 501.0
54 | #else
55 | return 500.0
56 | #endif
57 |
58 | }
59 |
60 | public static var low: ConstraintPriority {
61 | return 250.0
62 | }
63 |
64 | public static func ==(lhs: ConstraintPriority, rhs: ConstraintPriority) -> Bool {
65 | return lhs.value == rhs.value
66 | }
67 |
68 | // MARK: Strideable
69 |
70 | public func advanced(by n: FloatLiteralType) -> ConstraintPriority {
71 | return ConstraintPriority(floatLiteral: value + n)
72 | }
73 |
74 | public func distance(to other: ConstraintPriority) -> FloatLiteralType {
75 | return other.value - value
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/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 |
77 | #if os(iOS) || os(tvOS)
78 | extension UILayoutPriority: ConstraintPriorityTarget {
79 |
80 | public var constraintPriorityTargetValue: Float {
81 | return self.rawValue
82 | }
83 |
84 | }
85 | #endif
86 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/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 | #if os(iOS) || os(tvOS)
59 | @available(iOS 11.0, tvOS 11.0, *)
60 | extension ConstraintDirectionalInsets: ConstraintRelatableTarget {
61 | }
62 | #endif
63 |
64 | extension ConstraintItem: ConstraintRelatableTarget {
65 | }
66 |
67 | extension ConstraintView: ConstraintRelatableTarget {
68 | }
69 |
70 | @available(iOS 9.0, OSX 10.11, *)
71 | extension ConstraintLayoutGuide: ConstraintRelatableTarget {
72 | }
73 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/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: LayoutRelation {
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 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/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 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/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).rawValue
57 | }
58 | nonmutating set {
59 | self.view.setContentHuggingPriority(LayoutPriority(rawValue: newValue), for: .horizontal)
60 | }
61 | }
62 |
63 | public var contentHuggingVerticalPriority: Float {
64 | get {
65 | return self.view.contentHuggingPriority(for: .vertical).rawValue
66 | }
67 | nonmutating set {
68 | self.view.setContentHuggingPriority(LayoutPriority(rawValue: newValue), for: .vertical)
69 | }
70 | }
71 |
72 | public var contentCompressionResistanceHorizontalPriority: Float {
73 | get {
74 | return self.view.contentCompressionResistancePriority(for: .horizontal).rawValue
75 | }
76 | nonmutating set {
77 | self.view.setContentCompressionResistancePriority(LayoutPriority(rawValue: newValue), for: .horizontal)
78 | }
79 | }
80 |
81 | public var contentCompressionResistanceVerticalPriority: Float {
82 | get {
83 | return self.view.contentCompressionResistancePriority(for: .vertical).rawValue
84 | }
85 | nonmutating set {
86 | self.view.setContentCompressionResistancePriority(LayoutPriority(rawValue: 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 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/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 | // If firstItem or secondItem on either constraint has a dangling pointer
48 | // this comparison can cause a crash. The solution for this is to ensure
49 | // your layout code hold strong references to things like Views, LayoutGuides
50 | // and LayoutAnchors as SnapKit will not keep strong references to any of these.
51 | guard lhs.firstAttribute == rhs.firstAttribute &&
52 | lhs.secondAttribute == rhs.secondAttribute &&
53 | lhs.relation == rhs.relation &&
54 | lhs.priority == rhs.priority &&
55 | lhs.multiplier == rhs.multiplier &&
56 | lhs.secondItem === rhs.secondItem &&
57 | lhs.firstItem === rhs.firstItem else {
58 | return false
59 | }
60 | return true
61 | }
62 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/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: AnyObject {
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 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/Typealiases.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 | import Foundation
25 |
26 | #if os(iOS) || os(tvOS)
27 | import UIKit
28 | #if swift(>=4.2)
29 | typealias LayoutRelation = NSLayoutConstraint.Relation
30 | typealias LayoutAttribute = NSLayoutConstraint.Attribute
31 | #else
32 | typealias LayoutRelation = NSLayoutRelation
33 | typealias LayoutAttribute = NSLayoutAttribute
34 | #endif
35 | typealias LayoutPriority = UILayoutPriority
36 | #else
37 | import AppKit
38 | typealias LayoutRelation = NSLayoutConstraint.Relation
39 | typealias LayoutAttribute = NSLayoutConstraint.Attribute
40 | typealias LayoutPriority = NSLayoutConstraint.Priority
41 | #endif
42 |
43 |
--------------------------------------------------------------------------------
/Pods/SnapKit/Sources/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 | var snp: ConstraintLayoutSupportDSL {
33 | return ConstraintLayoutSupportDSL(support: self)
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-WaterfallLayoutDemo/Pods-WaterfallLayoutDemo-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | ${PODS_DEVELOPMENT_LANGUAGE}
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 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-WaterfallLayoutDemo/Pods-WaterfallLayoutDemo-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 | ## pop
28 |
29 | BSD License
30 |
31 | For Pop software
32 |
33 | Copyright (c) 2014, Facebook, Inc. All rights reserved.
34 |
35 | Redistribution and use in source and binary forms, with or without modification,
36 | are permitted provided that the following conditions are met:
37 |
38 | * Redistributions of source code must retain the above copyright notice, this
39 | list of conditions and the following disclaimer.
40 |
41 | * Redistributions in binary form must reproduce the above copyright notice,
42 | this list of conditions and the following disclaimer in the documentation
43 | and/or other materials provided with the distribution.
44 |
45 | * Neither the name Facebook nor the names of its contributors may be used to
46 | endorse or promote products derived from this software without specific
47 | prior written permission.
48 |
49 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
50 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
51 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
52 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
53 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
54 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
55 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
56 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
57 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
58 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
59 |
60 | Generated by CocoaPods - https://cocoapods.org
61 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-WaterfallLayoutDemo/Pods-WaterfallLayoutDemo-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 | BSD License
47 |
48 | For Pop software
49 |
50 | Copyright (c) 2014, Facebook, Inc. All rights reserved.
51 |
52 | Redistribution and use in source and binary forms, with or without modification,
53 | are permitted provided that the following conditions are met:
54 |
55 | * Redistributions of source code must retain the above copyright notice, this
56 | list of conditions and the following disclaimer.
57 |
58 | * Redistributions in binary form must reproduce the above copyright notice,
59 | this list of conditions and the following disclaimer in the documentation
60 | and/or other materials provided with the distribution.
61 |
62 | * Neither the name Facebook nor the names of its contributors may be used to
63 | endorse or promote products derived from this software without specific
64 | prior written permission.
65 |
66 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
67 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
68 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
69 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
70 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
71 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
72 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
73 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
74 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
75 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
76 |
77 | License
78 | BSD
79 | Title
80 | pop
81 | Type
82 | PSGroupSpecifier
83 |
84 |
85 | FooterText
86 | Generated by CocoaPods - https://cocoapods.org
87 | Title
88 |
89 | Type
90 | PSGroupSpecifier
91 |
92 |
93 | StringsTable
94 | Acknowledgements
95 | Title
96 | Acknowledgements
97 |
98 |
99 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-WaterfallLayoutDemo/Pods-WaterfallLayoutDemo-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_WaterfallLayoutDemo : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_WaterfallLayoutDemo
5 | @end
6 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-WaterfallLayoutDemo/Pods-WaterfallLayoutDemo-frameworks-Debug-input-files.xcfilelist:
--------------------------------------------------------------------------------
1 | ${PODS_ROOT}/Target Support Files/Pods-WaterfallLayoutDemo/Pods-WaterfallLayoutDemo-frameworks.sh
2 | ${BUILT_PRODUCTS_DIR}/SnapKit/SnapKit.framework
3 | ${BUILT_PRODUCTS_DIR}/pop/pop.framework
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-WaterfallLayoutDemo/Pods-WaterfallLayoutDemo-frameworks-Debug-output-files.xcfilelist:
--------------------------------------------------------------------------------
1 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SnapKit.framework
2 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/pop.framework
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-WaterfallLayoutDemo/Pods-WaterfallLayoutDemo-frameworks-Release-input-files.xcfilelist:
--------------------------------------------------------------------------------
1 | ${PODS_ROOT}/Target Support Files/Pods-WaterfallLayoutDemo/Pods-WaterfallLayoutDemo-frameworks.sh
2 | ${BUILT_PRODUCTS_DIR}/SnapKit/SnapKit.framework
3 | ${BUILT_PRODUCTS_DIR}/pop/pop.framework
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-WaterfallLayoutDemo/Pods-WaterfallLayoutDemo-frameworks-Release-output-files.xcfilelist:
--------------------------------------------------------------------------------
1 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SnapKit.framework
2 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/pop.framework
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-WaterfallLayoutDemo/Pods-WaterfallLayoutDemo-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_WaterfallLayoutDemoVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_WaterfallLayoutDemoVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-WaterfallLayoutDemo/Pods-WaterfallLayoutDemo.debug.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit" "${PODS_CONFIGURATION_BUILD_DIR}/pop"
4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit/SnapKit.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/pop/pop.framework/Headers"
6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks'
7 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift
8 | OTHER_LDFLAGS = $(inherited) -l"c++" -framework "SnapKit" -framework "pop"
9 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
10 | PODS_BUILD_DIR = ${BUILD_DIR}
11 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
12 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
13 | PODS_ROOT = ${SRCROOT}/Pods
14 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
16 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-WaterfallLayoutDemo/Pods-WaterfallLayoutDemo.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_WaterfallLayoutDemo {
2 | umbrella header "Pods-WaterfallLayoutDemo-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-WaterfallLayoutDemo/Pods-WaterfallLayoutDemo.release.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit" "${PODS_CONFIGURATION_BUILD_DIR}/pop"
4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit/SnapKit.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/pop/pop.framework/Headers"
6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks'
7 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift
8 | OTHER_LDFLAGS = $(inherited) -l"c++" -framework "SnapKit" -framework "pop"
9 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
10 | PODS_BUILD_DIR = ${BUILD_DIR}
11 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
12 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
13 | PODS_ROOT = ${SRCROOT}/Pods
14 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
16 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/SnapKit/SnapKit-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | ${PODS_DEVELOPMENT_LANGUAGE}
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 | 5.6.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/SnapKit/SnapKit-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_SnapKit : NSObject
3 | @end
4 | @implementation PodsDummy_SnapKit
5 | @end
6 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/SnapKit/SnapKit.debug.xcconfig:
--------------------------------------------------------------------------------
1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SnapKit
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift
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_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE}
9 | PODS_ROOT = ${SRCROOT}
10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SnapKit
11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
13 | SKIP_INSTALL = YES
14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
15 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/SnapKit/SnapKit.release.xcconfig:
--------------------------------------------------------------------------------
1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SnapKit
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift
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_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE}
9 | PODS_ROOT = ${SRCROOT}
10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SnapKit
11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
13 | SKIP_INSTALL = YES
14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
15 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/pop/pop-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | ${PODS_DEVELOPMENT_LANGUAGE}
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.12
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/pop/pop-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_pop : NSObject
3 | @end
4 | @implementation PodsDummy_pop
5 | @end
6 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/pop/pop-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 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/pop/pop-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 | #import "POP.h"
14 | #import "POPAnimatableProperty.h"
15 | #import "POPAnimatablePropertyTypes.h"
16 | #import "POPAnimation.h"
17 | #import "POPAnimationEvent.h"
18 | #import "POPAnimationExtras.h"
19 | #import "POPAnimationTracer.h"
20 | #import "POPAnimator.h"
21 | #import "POPBasicAnimation.h"
22 | #import "POPCustomAnimation.h"
23 | #import "POPDecayAnimation.h"
24 | #import "POPDefines.h"
25 | #import "POPGeometry.h"
26 | #import "POPLayerExtras.h"
27 | #import "POPPropertyAnimation.h"
28 | #import "POPSpringAnimation.h"
29 | #import "POPVector.h"
30 |
31 | FOUNDATION_EXPORT double popVersionNumber;
32 | FOUNDATION_EXPORT const unsigned char popVersionString[];
33 |
34 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/pop/pop.debug.xcconfig:
--------------------------------------------------------------------------------
1 | CLANG_CXX_LANGUAGE_STANDARD = c++11
2 | CLANG_CXX_LIBRARY = libc++
3 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
4 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/pop
5 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
6 | OTHER_LDFLAGS = $(inherited) -l"c++"
7 | PODS_BUILD_DIR = ${BUILD_DIR}
8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
9 | PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE}
10 | PODS_ROOT = ${SRCROOT}
11 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/pop
12 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
13 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
14 | SKIP_INSTALL = YES
15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
16 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/pop/pop.modulemap:
--------------------------------------------------------------------------------
1 | framework module pop {
2 | umbrella header "pop-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/pop/pop.release.xcconfig:
--------------------------------------------------------------------------------
1 | CLANG_CXX_LANGUAGE_STANDARD = c++11
2 | CLANG_CXX_LIBRARY = libc++
3 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
4 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/pop
5 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
6 | OTHER_LDFLAGS = $(inherited) -l"c++"
7 | PODS_BUILD_DIR = ${BUILD_DIR}
8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
9 | PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE}
10 | PODS_ROOT = ${SRCROOT}
11 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/pop
12 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
13 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
14 | SKIP_INSTALL = YES
15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
16 |
--------------------------------------------------------------------------------
/Pods/pop/LICENSE:
--------------------------------------------------------------------------------
1 | BSD License
2 |
3 | For Pop software
4 |
5 | Copyright (c) 2014, Facebook, Inc. All rights reserved.
6 |
7 | Redistribution and use in source and binary forms, with or without modification,
8 | are permitted provided that the following conditions are met:
9 |
10 | * Redistributions of source code must retain the above copyright notice, this
11 | list of conditions and the following disclaimer.
12 |
13 | * Redistributions in binary form must reproduce the above copyright notice,
14 | this list of conditions and the following disclaimer in the documentation
15 | and/or other materials provided with the distribution.
16 |
17 | * Neither the name Facebook nor the names of its contributors may be used to
18 | endorse or promote products derived from this software without specific
19 | prior written permission.
20 |
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
25 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
28 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POP.h:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #ifndef POP_POP_H
11 | #define POP_POP_H
12 |
13 | #import
14 |
15 | #import
16 | #import
17 | #import
18 | #import
19 | #import
20 | #import
21 | #import
22 | #import
23 | #import
24 | #import
25 | #import
26 | #import
27 | #import
28 | #import
29 |
30 | #endif /* POP_POP_H */
31 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPAction.h:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #ifndef POPACTION_H
11 | #define POPACTION_H
12 |
13 | #import
14 |
15 | #import
16 |
17 | #ifdef __cplusplus
18 |
19 | namespace POP {
20 |
21 | /**
22 | @abstract Disables Core Animation actions using RAII.
23 | @discussion The disablement of actions is scoped to the current transaction.
24 | */
25 | class ActionDisabler
26 | {
27 | BOOL state;
28 |
29 | public:
30 | ActionDisabler() POP_NOTHROW
31 | {
32 | state = [CATransaction disableActions];
33 | [CATransaction setDisableActions:YES];
34 | }
35 |
36 | ~ActionDisabler()
37 | {
38 | [CATransaction setDisableActions:state];
39 | }
40 | };
41 |
42 | /**
43 | @abstract Enables Core Animation actions using RAII.
44 | @discussion The enablement of actions is scoped to the current transaction.
45 | */
46 | class ActionEnabler
47 | {
48 | BOOL state;
49 |
50 | public:
51 | ActionEnabler() POP_NOTHROW
52 | {
53 | state = [CATransaction disableActions];
54 | [CATransaction setDisableActions:NO];
55 | }
56 |
57 | ~ActionEnabler()
58 | {
59 | [CATransaction setDisableActions:state];
60 | }
61 | };
62 |
63 | }
64 |
65 | #endif /* __cplusplus */
66 |
67 | #endif /* POPACTION_H */
68 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPAnimatablePropertyTypes.h:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | typedef void (^POPAnimatablePropertyReadBlock)(id obj, CGFloat values[]);
11 | typedef void (^POPAnimatablePropertyWriteBlock)(id obj, const CGFloat values[]);
12 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPAnimationEvent.h:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | /**
13 | @abstract Enumeraton of animation event types.
14 | */
15 | typedef NS_ENUM(NSUInteger, POPAnimationEventType) {
16 | kPOPAnimationEventPropertyRead = 0,
17 | kPOPAnimationEventPropertyWrite,
18 | kPOPAnimationEventToValueUpdate,
19 | kPOPAnimationEventFromValueUpdate,
20 | kPOPAnimationEventVelocityUpdate,
21 | kPOPAnimationEventBouncinessUpdate,
22 | kPOPAnimationEventSpeedUpdate,
23 | kPOPAnimationEventFrictionUpdate,
24 | kPOPAnimationEventMassUpdate,
25 | kPOPAnimationEventTensionUpdate,
26 | kPOPAnimationEventDidStart,
27 | kPOPAnimationEventDidStop,
28 | kPOPAnimationEventDidReachToValue,
29 | kPOPAnimationEventAutoreversed
30 | };
31 |
32 | /**
33 | @abstract The base animation event class.
34 | */
35 | @interface POPAnimationEvent : NSObject
36 |
37 | /**
38 | @abstract The event type. See {@ref POPAnimationEventType} for possible values.
39 | */
40 | @property (readonly, nonatomic, assign) POPAnimationEventType type;
41 |
42 | /**
43 | @abstract The time of event.
44 | */
45 | @property (readonly, nonatomic, assign) CFTimeInterval time;
46 |
47 | /**
48 | @abstract Optional string describing the animation at time of event.
49 | */
50 | @property (readonly, nonatomic, copy) NSString *animationDescription;
51 |
52 | @end
53 |
54 | /**
55 | @abstract An animation event subclass for recording value and velocity.
56 | */
57 | @interface POPAnimationValueEvent : POPAnimationEvent
58 |
59 | /**
60 | @abstract The value recorded.
61 | */
62 | @property (readonly, nonatomic, strong) id value;
63 |
64 | /**
65 | @abstract The velocity recorded, if any.
66 | */
67 | @property (readonly, nonatomic, strong) id velocity;
68 |
69 | @end
70 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPAnimationEvent.mm:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "POPAnimationEvent.h"
11 | #import "POPAnimationEventInternal.h"
12 |
13 | static NSString *stringFromType(POPAnimationEventType aType)
14 | {
15 | switch (aType) {
16 | case kPOPAnimationEventPropertyRead:
17 | return @"read";
18 | case kPOPAnimationEventPropertyWrite:
19 | return @"write";
20 | case kPOPAnimationEventToValueUpdate:
21 | return @"toValue";
22 | case kPOPAnimationEventFromValueUpdate:
23 | return @"fromValue";
24 | case kPOPAnimationEventVelocityUpdate:
25 | return @"velocity";
26 | case kPOPAnimationEventSpeedUpdate:
27 | return @"speed";
28 | case kPOPAnimationEventBouncinessUpdate:
29 | return @"bounciness";
30 | case kPOPAnimationEventFrictionUpdate:
31 | return @"friction";
32 | case kPOPAnimationEventMassUpdate:
33 | return @"mass";
34 | case kPOPAnimationEventTensionUpdate:
35 | return @"tension";
36 | case kPOPAnimationEventDidStart:
37 | return @"didStart";
38 | case kPOPAnimationEventDidStop:
39 | return @"didStop";
40 | case kPOPAnimationEventDidReachToValue:
41 | return @"didReachToValue";
42 | case kPOPAnimationEventAutoreversed:
43 | return @"autoreversed";
44 | default:
45 | return nil;
46 | }
47 | }
48 |
49 | @implementation POPAnimationEvent
50 | @synthesize type = _type;
51 | @synthesize time = _time;
52 | @synthesize animationDescription = _animationDescription;
53 |
54 | - (instancetype)initWithType:(POPAnimationEventType)aType time:(CFTimeInterval)aTime
55 | {
56 | self = [super init];
57 | if (nil != self) {
58 | _type = aType;
59 | _time = aTime;
60 | }
61 | return self;
62 | }
63 |
64 | - (NSString *)description
65 | {
66 | NSMutableString *s = [NSMutableString stringWithFormat:@""];
69 | return s;
70 | }
71 |
72 | // subclass override
73 | - (void)_appendDescription:(NSMutableString *)s
74 | {
75 | if (0 != _animationDescription.length) {
76 | [s appendFormat:@"; animation = %@", _animationDescription];
77 | }
78 | }
79 |
80 | @end
81 |
82 | @implementation POPAnimationValueEvent
83 | @synthesize value = _value;
84 | @synthesize velocity = _velocity;
85 |
86 | - (instancetype)initWithType:(POPAnimationEventType)aType time:(CFTimeInterval)aTime value:(id)aValue
87 | {
88 | self = [self initWithType:aType time:aTime];
89 | if (nil != self) {
90 | _value = aValue;
91 | }
92 | return self;
93 | }
94 |
95 | - (void)_appendDescription:(NSMutableString *)s
96 | {
97 | [super _appendDescription:s];
98 |
99 | if (nil != _value) {
100 | [s appendFormat:@"; value = %@", _value];
101 | }
102 |
103 | if (nil != _velocity) {
104 | [s appendFormat:@"; velocity = %@", _velocity];
105 | }
106 | }
107 |
108 | @end
109 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPAnimationEventInternal.h:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import "POPAnimationEvent.h"
13 |
14 | @interface POPAnimationEvent ()
15 |
16 | /**
17 | @abstract Default initializer.
18 | */
19 | - (instancetype)initWithType:(POPAnimationEventType)type time:(CFTimeInterval)time;
20 |
21 | /**
22 | @abstract Readwrite redefinition of public property.
23 | */
24 | @property (readwrite, nonatomic, copy) NSString *animationDescription;
25 |
26 | @end
27 |
28 | @interface POPAnimationValueEvent ()
29 |
30 | /**
31 | @abstract Default initializer.
32 | */
33 | - (instancetype)initWithType:(POPAnimationEventType)type time:(CFTimeInterval)time value:(id)value;
34 |
35 | /**
36 | @abstract Readwrite redefinition of public property.
37 | */
38 | @property (readwrite, nonatomic, strong) id velocity;
39 |
40 | @end
41 |
42 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPAnimationExtras.h:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 | #import
14 |
15 | /**
16 | @abstract The current drag coefficient.
17 | @discussion A value greater than 1.0 indicates Simulator slow-motion animations are enabled. Defaults to 1.0.
18 | */
19 | extern CGFloat POPAnimationDragCoefficient(void);
20 |
21 | @interface CAAnimation (POPAnimationExtras)
22 |
23 | /**
24 | @abstract Apply the current drag coefficient to animation speed.
25 | @discussion Convenience utility to respect Simulator slow-motion animation settings.
26 | */
27 | - (void)pop_applyDragCoefficient;
28 |
29 | @end
30 |
31 | @interface POPSpringAnimation (POPAnimationExtras)
32 |
33 | /**
34 | @abstract Converts from spring bounciness and speed to tension, friction and mass dynamics values.
35 | */
36 | + (void)convertBounciness:(CGFloat)bounciness speed:(CGFloat)speed toTension:(CGFloat *)outTension friction:(CGFloat *)outFriction mass:(CGFloat *)outMass;
37 |
38 | /**
39 | @abstract Converts from dynamics tension, friction and mass to spring bounciness and speed values.
40 | */
41 | + (void)convertTension:(CGFloat)tension friction:(CGFloat)friction toBounciness:(CGFloat *)outBounciness speed:(CGFloat *)outSpeed;
42 |
43 | @end
44 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPAnimationExtras.mm:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "POPAnimationExtras.h"
11 | #import "POPAnimationPrivate.h"
12 |
13 | #if TARGET_OS_IPHONE
14 | #import
15 | #endif
16 |
17 | #if TARGET_IPHONE_SIMULATOR
18 | UIKIT_EXTERN float UIAnimationDragCoefficient(); // UIKit private drag coefficient, use judiciously
19 | #endif
20 |
21 | #import "POPMath.h"
22 |
23 | CGFloat POPAnimationDragCoefficient()
24 | {
25 | #if TARGET_IPHONE_SIMULATOR
26 | return UIAnimationDragCoefficient();
27 | #else
28 | return 1.0;
29 | #endif
30 | }
31 |
32 | @implementation CAAnimation (POPAnimationExtras)
33 |
34 | - (void)pop_applyDragCoefficient
35 | {
36 | CGFloat k = POPAnimationDragCoefficient();
37 | if (k != 0 && k != 1)
38 | self.speed = 1 / k;
39 | }
40 |
41 | @end
42 |
43 | @implementation POPSpringAnimation (POPAnimationExtras)
44 |
45 | static const CGFloat POPBouncy3NormalizationRange = 20.0;
46 | static const CGFloat POPBouncy3NormalizationScale = 1.7;
47 | static const CGFloat POPBouncy3BouncinessNormalizedMin = 0.0;
48 | static const CGFloat POPBouncy3BouncinessNormalizedMax = 0.8;
49 | static const CGFloat POPBouncy3SpeedNormalizedMin = 0.5;
50 | static const CGFloat POPBouncy3SpeedNormalizedMax = 200;
51 | static const CGFloat POPBouncy3FrictionInterpolationMax = 0.01;
52 |
53 | + (void)convertBounciness:(CGFloat)bounciness speed:(CGFloat)speed toTension:(CGFloat *)outTension friction:(CGFloat *)outFriction mass:(CGFloat *)outMass
54 | {
55 | double b = POPNormalize(bounciness / POPBouncy3NormalizationScale, 0, POPBouncy3NormalizationRange);
56 | b = POPProjectNormal(b, POPBouncy3BouncinessNormalizedMin, POPBouncy3BouncinessNormalizedMax);
57 |
58 | double s = POPNormalize(speed / POPBouncy3NormalizationScale, 0, POPBouncy3NormalizationRange);
59 |
60 | CGFloat tension = POPProjectNormal(s, POPBouncy3SpeedNormalizedMin, POPBouncy3SpeedNormalizedMax);
61 | CGFloat friction = POPQuadraticOutInterpolation(b, POPBouncy3NoBounce(tension), POPBouncy3FrictionInterpolationMax);
62 |
63 | tension = POP_ANIMATION_TENSION_FOR_QC_TENSION(tension);
64 | friction = POP_ANIMATION_FRICTION_FOR_QC_FRICTION(friction);
65 |
66 | if (outTension) {
67 | *outTension = tension;
68 | }
69 |
70 | if (outFriction) {
71 | *outFriction = friction;
72 | }
73 |
74 | if (outMass) {
75 | *outMass = 1.0;
76 | }
77 | }
78 |
79 | + (void)convertTension:(CGFloat)tension friction:(CGFloat)friction toBounciness:(CGFloat *)outBounciness speed:(CGFloat *)outSpeed
80 | {
81 | // Convert to QC values, in which our calculations are done.
82 | CGFloat qcFriction = QC_FRICTION_FOR_POP_ANIMATION_FRICTION(friction);
83 | CGFloat qcTension = QC_TENSION_FOR_POP_ANIMATION_TENSION(tension);
84 |
85 | // Friction is a function of bounciness and tension, according to the following:
86 | // friction = POPQuadraticOutInterpolation(b, POPBouncy3NoBounce(tension), POPBouncy3FrictionInterpolationMax);
87 | // Solve for bounciness, given a tension and friction.
88 |
89 | CGFloat nobounceTension = POPBouncy3NoBounce(qcTension);
90 | CGFloat bounciness1, bounciness2;
91 |
92 | POPQuadraticSolve((nobounceTension - POPBouncy3FrictionInterpolationMax), // a
93 | 2 * (POPBouncy3FrictionInterpolationMax - nobounceTension), // b
94 | (nobounceTension - qcFriction), // c
95 | bounciness1, // x1
96 | bounciness2); // x2
97 |
98 |
99 | // Choose the quadratic solution within the normalized bounciness range
100 | CGFloat projectedNormalizedBounciness = (bounciness2 < POPBouncy3BouncinessNormalizedMax) ? bounciness2 : bounciness1;
101 | CGFloat projectedNormalizedSpeed = qcTension;
102 |
103 | // Reverse projection + normalization
104 | CGFloat bounciness = ((POPBouncy3NormalizationRange * POPBouncy3NormalizationScale) / (POPBouncy3BouncinessNormalizedMax - POPBouncy3BouncinessNormalizedMin)) * (projectedNormalizedBounciness - POPBouncy3BouncinessNormalizedMin);
105 | CGFloat speed = ((POPBouncy3NormalizationRange * POPBouncy3NormalizationScale) / (POPBouncy3SpeedNormalizedMax - POPBouncy3SpeedNormalizedMin)) * (projectedNormalizedSpeed - POPBouncy3SpeedNormalizedMin);
106 |
107 | // Write back results
108 | if (outBounciness) {
109 | *outBounciness = bounciness;
110 | }
111 |
112 | if (outSpeed) {
113 | *outSpeed = speed;
114 | }
115 | }
116 |
117 | @end
118 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPAnimationPrivate.h:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #define POP_ANIMATION_FRICTION_FOR_QC_FRICTION(qcFriction) (25.0 + (((qcFriction - 8.0) / 2.0) * (25.0 - 19.0)))
13 | #define POP_ANIMATION_TENSION_FOR_QC_TENSION(qcTension) (194.0 + (((qcTension - 30.0) / 50.0) * (375.0 - 194.0)))
14 |
15 | #define QC_FRICTION_FOR_POP_ANIMATION_FRICTION(fbFriction) (8.0 + 2.0 * ((fbFriction - 25.0)/(25.0 - 19.0)))
16 | #define QC_TENSION_FOR_POP_ANIMATION_TENSION(fbTension) (30.0 + 50.0 * ((fbTension - 194.0)/(375.0 - 194.0)))
17 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPAnimationRuntime.h:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 | #import
14 |
15 | #import "POPAnimatablePropertyTypes.h"
16 | #import "POPVector.h"
17 |
18 | enum POPValueType
19 | {
20 | kPOPValueUnknown = 0,
21 | kPOPValueInteger,
22 | kPOPValueFloat,
23 | kPOPValuePoint,
24 | kPOPValueSize,
25 | kPOPValueRect,
26 | kPOPValueEdgeInsets,
27 | kPOPValueAffineTransform,
28 | kPOPValueTransform,
29 | kPOPValueRange,
30 | kPOPValueColor,
31 | kPOPValueSCNVector3,
32 | kPOPValueSCNVector4,
33 | };
34 |
35 | using namespace POP;
36 |
37 | /**
38 | Returns value type based on objc type description, given list of supported value types and length.
39 | */
40 | extern POPValueType POPSelectValueType(const char *objctype, const POPValueType *types, size_t length);
41 |
42 | /**
43 | Returns value type based on objc object, given a list of supported value types and length.
44 | */
45 | extern POPValueType POPSelectValueType(id obj, const POPValueType *types, size_t length);
46 |
47 | /**
48 | Array of all value types.
49 | */
50 | extern const POPValueType kPOPAnimatableAllTypes[12];
51 |
52 | /**
53 | Array of all value types supported for animation.
54 | */
55 | extern const POPValueType kPOPAnimatableSupportTypes[10];
56 |
57 | /**
58 | Returns a string description of a value type.
59 | */
60 | extern NSString *POPValueTypeToString(POPValueType t);
61 |
62 | /**
63 | Returns a mutable dictionary of weak pointer keys to weak pointer values.
64 | */
65 | extern CFMutableDictionaryRef POPDictionaryCreateMutableWeakPointerToWeakPointer(NSUInteger capacity) CF_RETURNS_RETAINED;
66 |
67 | /**
68 | Returns a mutable dictionary of weak pointer keys to weak pointer values.
69 | */
70 | extern CFMutableDictionaryRef POPDictionaryCreateMutableWeakPointerToStrongObject(NSUInteger capacity) CF_RETURNS_RETAINED;
71 |
72 | /**
73 | Box a vector.
74 | */
75 | extern id POPBox(VectorConstRef vec, POPValueType type, bool force = false);
76 |
77 | /**
78 | Unbox a vector.
79 | */
80 | extern VectorRef POPUnbox(id value, POPValueType &type, NSUInteger &count, bool validate);
81 |
82 | /**
83 | Read object value and return a Vector4r.
84 | */
85 | NS_INLINE Vector4r read_values(POPAnimatablePropertyReadBlock read, id obj, size_t count)
86 | {
87 | Vector4r vec = Vector4r::Zero();
88 | if (0 == count)
89 | return vec;
90 |
91 | read(obj, vec.data());
92 |
93 | return vec;
94 | }
95 |
96 | NS_INLINE NSString *POPStringFromBOOL(BOOL value)
97 | {
98 | return value ? @"YES" : @"NO";
99 | }
100 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPAnimationTracer.h:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | @class POPAnimation;
15 |
16 | /**
17 | @abstract Tracer of animation events to facilitate unit testing & debugging.
18 | */
19 | @interface POPAnimationTracer : NSObject
20 |
21 | /**
22 | @abstract Start recording events.
23 | */
24 | - (void)start;
25 |
26 | /**
27 | @abstract Stop recording events.
28 | */
29 | - (void)stop;
30 |
31 | /**
32 | @abstract Resets any recoded events. Continues recording events if already started.
33 | */
34 | - (void)reset;
35 |
36 | /**
37 | @abstract Property representing all recorded events.
38 | @discussion Events are returned in order of occurrence.
39 | */
40 | @property (nonatomic, assign, readonly) NSArray *allEvents;
41 |
42 | /**
43 | @abstract Property representing all recorded write events for convenience.
44 | @discussion Events are returned in order of occurrence.
45 | */
46 | @property (nonatomic, assign, readonly) NSArray *writeEvents;
47 |
48 | /**
49 | @abstract Queries for events of specified type.
50 | @param type The type of event to return.
51 | @returns An array of events of specified type in order of occurrence.
52 | */
53 | - (NSArray *)eventsWithType:(POPAnimationEventType)type;
54 |
55 | /**
56 | @abstract Property indicating whether tracer should automatically log events and reset collection on animation completion.
57 | */
58 | @property (nonatomic, assign) BOOL shouldLogAndResetOnCompletion;
59 |
60 | @end
61 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPAnimationTracerInternal.h:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | @interface POPAnimationTracer (Internal)
15 |
16 | /**
17 | @abstract Designated initializer. Pass the animation being traced.
18 | */
19 | - (instancetype)initWithAnimation:(POPAnimation *)anAnim;
20 |
21 | /**
22 | @abstract Records read value.
23 | */
24 | - (void)readPropertyValue:(id)aValue;
25 |
26 | /**
27 | @abstract Records write value.
28 | */
29 | - (void)writePropertyValue:(id)aValue;
30 |
31 | /**
32 | Records to value update.
33 | */
34 | - (void)updateToValue:(id)aValue;
35 |
36 | /**
37 | @abstract Records from value update.
38 | */
39 | - (void)updateFromValue:(id)aValue;
40 |
41 | /**
42 | @abstract Records from value update.
43 | */
44 | - (void)updateVelocity:(id)aValue;
45 |
46 | /**
47 | @abstract Records bounciness update.
48 | */
49 | - (void)updateBounciness:(float)aFloat;
50 |
51 | /**
52 | @abstract Records speed update.
53 | */
54 | - (void)updateSpeed:(float)aFloat;
55 |
56 | /**
57 | @abstract Records friction update.
58 | */
59 | - (void)updateFriction:(float)aFloat;
60 |
61 | /**
62 | @abstract Records mass update.
63 | */
64 | - (void)updateMass:(float)aFloat;
65 |
66 | /**
67 | @abstract Records tension update.
68 | */
69 | - (void)updateTension:(float)aFloat;
70 |
71 | /**
72 | @abstract Records did add.
73 | */
74 | - (void)didAdd;
75 |
76 | /**
77 | @abstract Records did start.
78 | */
79 | - (void)didStart;
80 |
81 | /**
82 | @abstract Records did stop.
83 | */
84 | - (void)didStop:(BOOL)finished;
85 |
86 | /**
87 | @abstract Records did reach to value.
88 | */
89 | - (void)didReachToValue:(id)aValue;
90 |
91 | /**
92 | @abstract Records when an autoreverse animation takes place.
93 | */
94 | - (void)autoreversed;
95 |
96 | @end
97 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPAnimator.h:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @protocol POPAnimatorDelegate;
13 |
14 | /**
15 | @abstract The animator class renders animations.
16 | */
17 | @interface POPAnimator : NSObject
18 |
19 | /**
20 | @abstract The shared animator instance.
21 | @discussion Consumers should generally use the shared instance in lieu of creating new instances.
22 | */
23 | + (instancetype)sharedAnimator;
24 |
25 | #if !TARGET_OS_IPHONE
26 | /**
27 | @abstract Allows to select display to bind. Returns nil if failed to create the display link.
28 | */
29 | - (instancetype)initWithDisplayID:(CGDirectDisplayID)displayID;
30 | #endif
31 |
32 | /**
33 | @abstract The optional animator delegate.
34 | */
35 | @property (weak, nonatomic) id delegate;
36 |
37 | /**
38 | @abstract Retrieves the nominal refresh period of a display link. Returns zero if unavailable.
39 | */
40 | @property (readonly, nonatomic) CFTimeInterval refreshPeriod;
41 |
42 | @end
43 |
44 | /**
45 | @abstract The animator delegate.
46 | */
47 | @protocol POPAnimatorDelegate
48 |
49 | /**
50 | @abstract Called on each frame before animation application.
51 | */
52 | - (void)animatorWillAnimate:(POPAnimator *)animator;
53 |
54 | /**
55 | @abstract Called on each frame after animation application.
56 | */
57 | - (void)animatorDidAnimate:(POPAnimator *)animator;
58 |
59 | @end
60 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPAnimatorPrivate.h:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @class POPAnimation;
13 |
14 | @protocol POPAnimatorObserving
15 | @required
16 |
17 | /**
18 | @abstract Called on each observer after animator has advanced. Core Animation actions are disabled by default.
19 | */
20 | - (void)animatorDidAnimate:(POPAnimator *)animator;
21 |
22 | @end
23 |
24 | @interface POPAnimator ()
25 |
26 | #if !TARGET_OS_IPHONE
27 | /**
28 | Determines whether or not to use a high priority background thread for animation updates. Using a background thread can result in faster, more responsive updates, but may be less compatible. Defaults to YES.
29 | */
30 | + (BOOL)disableBackgroundThread;
31 | + (void)setDisableBackgroundThread:(BOOL)flag;
32 |
33 | /**
34 | Determines the frequency (Hz) of the timer used when no display is available. Defaults to 60Hz.
35 | */
36 | + (uint64_t)displayTimerFrequency;
37 | + (void)setDisplayTimerFrequency:(uint64_t)frequency;
38 | #endif
39 |
40 | /**
41 | Used for externally driven animator instances.
42 | */
43 | @property (assign, nonatomic) BOOL disableDisplayLink;
44 |
45 | /**
46 | Time used when starting animations. Defaults to 0 meaning current media time is used. Exposed for unit testing.
47 | */
48 | @property (assign, nonatomic) CFTimeInterval beginTime;
49 |
50 | /**
51 | Exposed for unit testing.
52 | */
53 | - (void)renderTime:(CFTimeInterval)time;
54 |
55 | /**
56 | Funnel methods for category additions.
57 | */
58 | - (void)addAnimation:(POPAnimation *)anim forObject:(id)obj key:(NSString *)key;
59 | - (void)removeAllAnimationsForObject:(id)obj;
60 | - (void)removeAnimationForObject:(id)obj key:(NSString *)key;
61 | - (NSArray *)animationKeysForObject:(id)obj;
62 | - (POPAnimation *)animationForObject:(id)obj key:(NSString *)key;
63 |
64 | /**
65 | @abstract Add an animator observer. Observer will be notified of each subsequent animator advance until removal.
66 | */
67 | - (void)addObserver:(id)observer;
68 |
69 | /**
70 | @abstract Remove an animator observer.
71 | */
72 | - (void)removeObserver:(id)observer;
73 |
74 | @end
75 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPBasicAnimation.h:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | /**
13 | @abstract A concrete basic animation class.
14 | @discussion Animation is achieved through interpolation.
15 | */
16 | @interface POPBasicAnimation : POPPropertyAnimation
17 |
18 | /**
19 | @abstract The designated initializer.
20 | @returns An instance of a basic animation.
21 | */
22 | + (instancetype)animation;
23 |
24 | /**
25 | @abstract Convenience initializer that returns an animation with animatable property of name.
26 | @param name The name of the animatable property.
27 | @returns An instance of a basic animation configured with specified animatable property.
28 | */
29 | + (instancetype)animationWithPropertyNamed:(NSString *)name;
30 |
31 | /**
32 | @abstract Convenience constructor.
33 | @returns Returns a basic animation with kCAMediaTimingFunctionDefault timing function.
34 | */
35 | + (instancetype)defaultAnimation;
36 |
37 | /**
38 | @abstract Convenience constructor.
39 | @returns Returns a basic animation with kCAMediaTimingFunctionLinear timing function.
40 | */
41 | + (instancetype)linearAnimation;
42 |
43 | /**
44 | @abstract Convenience constructor.
45 | @returns Returns a basic animation with kCAMediaTimingFunctionEaseIn timing function.
46 | */
47 | + (instancetype)easeInAnimation;
48 |
49 | /**
50 | @abstract Convenience constructor.
51 | @returns Returns a basic animation with kCAMediaTimingFunctionEaseOut timing function.
52 | */
53 | + (instancetype)easeOutAnimation;
54 |
55 | /**
56 | @abstract Convenience constructor.
57 | @returns Returns a basic animation with kCAMediaTimingFunctionEaseInEaseOut timing function.
58 | */
59 | + (instancetype)easeInEaseOutAnimation;
60 |
61 | /**
62 | @abstract The duration in seconds. Defaults to 0.4.
63 | */
64 | @property (assign, nonatomic) CFTimeInterval duration;
65 |
66 | /**
67 | @abstract A timing function defining the pacing of the animation. Defaults to nil indicating pacing according to kCAMediaTimingFunctionDefault.
68 | */
69 | @property (strong, nonatomic) CAMediaTimingFunction *timingFunction;
70 |
71 | @end
72 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPBasicAnimation.mm:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "POPBasicAnimationInternal.h"
11 |
12 | @implementation POPBasicAnimation
13 |
14 | #undef __state
15 | #define __state ((POPBasicAnimationState *)_state)
16 |
17 | #pragma mark - Lifecycle
18 |
19 | + (instancetype)animation
20 | {
21 | return [[self alloc] init];
22 | }
23 |
24 | + (instancetype)animationWithPropertyNamed:(NSString *)aName
25 | {
26 | POPBasicAnimation *anim = [self animation];
27 | anim.property = [POPAnimatableProperty propertyWithName:aName];
28 | return anim;
29 | }
30 |
31 | - (void)_initState
32 | {
33 | _state = new POPBasicAnimationState(self);
34 | }
35 |
36 | + (instancetype)linearAnimation
37 | {
38 | POPBasicAnimation *anim = [self animation];
39 | anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
40 | return anim;
41 | }
42 |
43 | + (instancetype)easeInAnimation
44 | {
45 | POPBasicAnimation *anim = [self animation];
46 | anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
47 | return anim;
48 | }
49 |
50 | + (instancetype)easeOutAnimation
51 | {
52 | POPBasicAnimation *anim = [self animation];
53 | anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
54 | return anim;
55 | }
56 |
57 | + (instancetype)easeInEaseOutAnimation
58 | {
59 | POPBasicAnimation *anim = [self animation];
60 | anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
61 | return anim;
62 | }
63 |
64 | + (instancetype)defaultAnimation
65 | {
66 | POPBasicAnimation *anim = [self animation];
67 | anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault];
68 | return anim;
69 | }
70 |
71 | - (id)init
72 | {
73 | return [self _init];
74 | }
75 |
76 | #pragma mark - Properties
77 |
78 | DEFINE_RW_PROPERTY(POPBasicAnimationState, duration, setDuration:, CFTimeInterval);
79 | DEFINE_RW_PROPERTY_OBJ(POPBasicAnimationState, timingFunction, setTimingFunction:, CAMediaTimingFunction*, __state->updatedTimingFunction(););
80 |
81 | #pragma mark - Utility
82 |
83 | - (void)_appendDescription:(NSMutableString *)s debug:(BOOL)debug
84 | {
85 | [super _appendDescription:s debug:debug];
86 | if (__state->duration)
87 | [s appendFormat:@"; duration = %f", __state->duration];
88 | }
89 |
90 | @end
91 |
92 | @implementation POPBasicAnimation (NSCopying)
93 |
94 | - (instancetype)copyWithZone:(NSZone *)zone {
95 |
96 | POPBasicAnimation *copy = [super copyWithZone:zone];
97 |
98 | if (copy) {
99 | copy.duration = self.duration;
100 | copy.timingFunction = self.timingFunction; // not a 'copy', but timing functions are publicly immutable.
101 | }
102 |
103 | return copy;
104 | }
105 |
106 | @end
--------------------------------------------------------------------------------
/Pods/pop/pop/POPBasicAnimationInternal.h:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "POPBasicAnimation.h"
11 |
12 | #import "POPPropertyAnimationInternal.h"
13 |
14 | // default animation duration
15 | static CGFloat const kPOPAnimationDurationDefault = 0.4;
16 |
17 | // progress threshold for computing done
18 | static CGFloat const kPOPProgressThreshold = 1e-6;
19 |
20 | static void interpolate(POPValueType valueType, NSUInteger count, const CGFloat *fromVec, const CGFloat *toVec, CGFloat *outVec, CGFloat p)
21 | {
22 | switch (valueType) {
23 | case kPOPValueInteger:
24 | case kPOPValueFloat:
25 | case kPOPValuePoint:
26 | case kPOPValueSize:
27 | case kPOPValueRect:
28 | case kPOPValueEdgeInsets:
29 | case kPOPValueColor:
30 | POPInterpolateVector(count, outVec, fromVec, toVec, p);
31 | break;
32 | default:
33 | NSCAssert(false, @"unhandled type %d", valueType);
34 | break;
35 | }
36 | }
37 |
38 | struct _POPBasicAnimationState : _POPPropertyAnimationState
39 | {
40 | CAMediaTimingFunction *timingFunction;
41 | double timingControlPoints[4];
42 | CFTimeInterval duration;
43 | CFTimeInterval timeProgress;
44 |
45 | _POPBasicAnimationState(id __unsafe_unretained anim) : _POPPropertyAnimationState(anim),
46 | timingFunction(nil),
47 | timingControlPoints{0.},
48 | duration(kPOPAnimationDurationDefault),
49 | timeProgress(0.)
50 | {
51 | type = kPOPAnimationBasic;
52 | }
53 |
54 | bool isDone() {
55 | if (_POPPropertyAnimationState::isDone()) {
56 | return true;
57 | }
58 | return timeProgress + kPOPProgressThreshold >= 1.;
59 | }
60 |
61 | void updatedTimingFunction()
62 | {
63 | float vec[4] = {0.};
64 | [timingFunction getControlPointAtIndex:1 values:&vec[0]];
65 | [timingFunction getControlPointAtIndex:2 values:&vec[2]];
66 | for (NSUInteger idx = 0; idx < POP_ARRAY_COUNT(vec); idx++) {
67 | timingControlPoints[idx] = vec[idx];
68 | }
69 | }
70 |
71 | bool advance(CFTimeInterval time, CFTimeInterval dt, id obj) {
72 | // default timing function
73 | if (!timingFunction) {
74 | ((POPBasicAnimation *)self).timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault];
75 | }
76 |
77 | // solve for normalized time, aka progress [0, 1]
78 | CGFloat p = 1.0f;
79 | if (duration > 0.0f) {
80 | // cap local time to duration
81 | CFTimeInterval t = MIN(time - startTime, duration) / duration;
82 | p = POPTimingFunctionSolve(timingControlPoints, t, SOLVE_EPS(duration));
83 | timeProgress = t;
84 | } else {
85 | timeProgress = 1.;
86 | }
87 |
88 | // interpolate and advance
89 | interpolate(valueType, valueCount, fromVec->data(), toVec->data(), currentVec->data(), p);
90 | progress = p;
91 | clampCurrentValue();
92 |
93 | return true;
94 | }
95 | };
96 |
97 | typedef struct _POPBasicAnimationState POPBasicAnimationState;
98 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPCGUtils.h:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #if TARGET_OS_IPHONE
13 | #import
14 | #else
15 | #import
16 | #endif
17 |
18 | #import "POPDefines.h"
19 |
20 | #if SCENEKIT_SDK_AVAILABLE
21 | #import
22 | #endif
23 |
24 | POP_EXTERN_C_BEGIN
25 |
26 | NS_INLINE CGPoint values_to_point(const CGFloat values[])
27 | {
28 | return CGPointMake(values[0], values[1]);
29 | }
30 |
31 | NS_INLINE CGSize values_to_size(const CGFloat values[])
32 | {
33 | return CGSizeMake(values[0], values[1]);
34 | }
35 |
36 | NS_INLINE CGRect values_to_rect(const CGFloat values[])
37 | {
38 | return CGRectMake(values[0], values[1], values[2], values[3]);
39 | }
40 |
41 | #if SCENEKIT_SDK_AVAILABLE
42 | NS_INLINE SCNVector3 values_to_vec3(const CGFloat values[])
43 | {
44 | return SCNVector3Make(values[0], values[1], values[2]);
45 | }
46 |
47 | NS_INLINE SCNVector4 values_to_vec4(const CGFloat values[])
48 | {
49 | return SCNVector4Make(values[0], values[1], values[2], values[3]);
50 | }
51 | #endif
52 |
53 | #if TARGET_OS_IPHONE
54 |
55 | NS_INLINE UIEdgeInsets values_to_edge_insets(const CGFloat values[])
56 | {
57 | return UIEdgeInsetsMake(values[0], values[1], values[2], values[3]);
58 | }
59 |
60 | #endif
61 |
62 | NS_INLINE void values_from_point(CGFloat values[], CGPoint p)
63 | {
64 | values[0] = p.x;
65 | values[1] = p.y;
66 | }
67 |
68 | NS_INLINE void values_from_size(CGFloat values[], CGSize s)
69 | {
70 | values[0] = s.width;
71 | values[1] = s.height;
72 | }
73 |
74 | NS_INLINE void values_from_rect(CGFloat values[], CGRect r)
75 | {
76 | values[0] = r.origin.x;
77 | values[1] = r.origin.y;
78 | values[2] = r.size.width;
79 | values[3] = r.size.height;
80 | }
81 |
82 | #if SCENEKIT_SDK_AVAILABLE
83 | NS_INLINE void values_from_vec3(CGFloat values[], SCNVector3 v)
84 | {
85 | values[0] = v.x;
86 | values[1] = v.y;
87 | values[2] = v.z;
88 | }
89 |
90 | NS_INLINE void values_from_vec4(CGFloat values[], SCNVector4 v)
91 | {
92 | values[0] = v.x;
93 | values[1] = v.y;
94 | values[2] = v.z;
95 | values[3] = v.w;
96 | }
97 | #endif
98 |
99 | #if TARGET_OS_IPHONE
100 |
101 | NS_INLINE void values_from_edge_insets(CGFloat values[], UIEdgeInsets i)
102 | {
103 | values[0] = i.top;
104 | values[1] = i.left;
105 | values[2] = i.bottom;
106 | values[3] = i.right;
107 | }
108 |
109 | #endif
110 |
111 | /**
112 | Takes a CGColorRef and converts it into RGBA components, if necessary.
113 | */
114 | extern void POPCGColorGetRGBAComponents(CGColorRef color, CGFloat components[]);
115 |
116 | /**
117 | Takes RGBA components and returns a CGColorRef.
118 | */
119 | extern CGColorRef POPCGColorRGBACreate(const CGFloat components[]) CF_RETURNS_RETAINED;
120 |
121 | /**
122 | Takes a color reference and returns a CGColor.
123 | */
124 | extern CGColorRef POPCGColorWithColor(id color) CF_RETURNS_NOT_RETAINED;
125 |
126 | #if TARGET_OS_IPHONE
127 |
128 | /**
129 | Takes a UIColor and converts it into RGBA components, if necessary.
130 | */
131 | extern void POPUIColorGetRGBAComponents(UIColor *color, CGFloat components[]);
132 |
133 | /**
134 | Takes RGBA components and returns a UIColor.
135 | */
136 | extern UIColor *POPUIColorRGBACreate(const CGFloat components[]) NS_RETURNS_RETAINED;
137 |
138 | #else
139 |
140 | /**
141 | Takes a NSColor and converts it into RGBA components, if necessary.
142 | */
143 | extern void POPNSColorGetRGBAComponents(NSColor *color, CGFloat components[]);
144 |
145 | /**
146 | Takes RGBA components and returns a NSColor.
147 | */
148 | extern NSColor *POPNSColorRGBACreate(const CGFloat components[]) NS_RETURNS_RETAINED;
149 |
150 | #endif
151 |
152 | POP_EXTERN_C_END
153 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPCustomAnimation.h:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @class POPCustomAnimation;
13 |
14 | /**
15 | @abstract POPCustomAnimationBlock is the callback block of a custom animation.
16 | @discussion This block will be executed for each animation frame and should update the property or properties being animated based on current timing.
17 | @param target The object being animated. Reference the passed in target to help avoid retain loops.
18 | @param animation The custom animation instance. Use to determine the current and elapsed time since last callback. Reference the passed in animation to help avoid retain loops.
19 | @return Flag indicating whether the animation should continue animating. Return NO to indicate animation is done.
20 | */
21 | typedef BOOL (^POPCustomAnimationBlock)(id target, POPCustomAnimation *animation);
22 |
23 | /**
24 | @abstract POPCustomAnimation is a concrete animation subclass for custom animations.
25 | */
26 | @interface POPCustomAnimation : POPAnimation
27 |
28 | /**
29 | @abstract Creates and returns an initialized custom animation instance.
30 | @discussion This is the designated initializer.
31 | @param block The custom animation callback block. See {@ref POPCustomAnimationBlock}.
32 | @return The initialized custom animation instance.
33 | */
34 | + (instancetype)animationWithBlock:(POPCustomAnimationBlock)block;
35 |
36 | /**
37 | @abstract The current animation time at time of callback.
38 | */
39 | @property (readonly, nonatomic) CFTimeInterval currentTime;
40 |
41 | /**
42 | @abstract The elapsed animation time since last callback.
43 | */
44 | @property (readonly, nonatomic) CFTimeInterval elapsedTime;
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPCustomAnimation.mm:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "POPAnimationInternal.h"
11 |
12 | #import "POPCustomAnimation.h"
13 |
14 | @interface POPCustomAnimation ()
15 | @property (nonatomic, copy) POPCustomAnimationBlock animate;
16 | @end
17 |
18 | @implementation POPCustomAnimation
19 | @synthesize currentTime = _currentTime;
20 | @synthesize elapsedTime = _elapsedTime;
21 | @synthesize animate = _animate;
22 |
23 | + (instancetype)animationWithBlock:(BOOL(^)(id target, POPCustomAnimation *))block
24 | {
25 | POPCustomAnimation *b = [[self alloc] _init];
26 | b.animate = block;
27 | return b;
28 | }
29 |
30 | - (id)_init
31 | {
32 | self = [super _init];
33 | if (nil != self) {
34 | _state->type = kPOPAnimationCustom;
35 | }
36 | return self;
37 | }
38 |
39 | - (CFTimeInterval)beginTime
40 | {
41 | POPAnimationState *s = POPAnimationGetState(self);
42 | return s->startTime > 0 ? s->startTime : s->beginTime;
43 | }
44 |
45 | - (BOOL)_advance:(id)object currentTime:(CFTimeInterval)currentTime elapsedTime:(CFTimeInterval)elapsedTime
46 | {
47 | _currentTime = currentTime;
48 | _elapsedTime = elapsedTime;
49 | return _animate(object, self);
50 | }
51 |
52 | - (void)_appendDescription:(NSMutableString *)s debug:(BOOL)debug
53 | {
54 | [s appendFormat:@"; elapsedTime = %f; currentTime = %f;", _elapsedTime, _currentTime];
55 | }
56 |
57 | @end
58 |
59 | /**
60 | * Note that only the animate block is copied, but not the current/elapsed times
61 | */
62 | @implementation POPCustomAnimation (NSCopying)
63 |
64 | - (instancetype)copyWithZone:(NSZone *)zone {
65 |
66 | POPCustomAnimation *copy = [super copyWithZone:zone];
67 |
68 | if (copy) {
69 | copy.animate = self.animate;
70 | }
71 |
72 | return copy;
73 | }
74 |
75 | @end
--------------------------------------------------------------------------------
/Pods/pop/pop/POPDecayAnimation.h:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | /**
13 | @abstract A concrete decay animation class.
14 | @discussion Animation is achieved through gradual decay of animation value.
15 | */
16 | @interface POPDecayAnimation : POPPropertyAnimation
17 |
18 | /**
19 | @abstract The designated initializer.
20 | @returns An instance of a decay animation.
21 | */
22 | + (instancetype)animation;
23 |
24 | /**
25 | @abstract Convenience initializer that returns an animation with animatable property of name.
26 | @param name The name of the animatable property.
27 | @returns An instance of a decay animation configured with specified animatable property.
28 | */
29 | + (instancetype)animationWithPropertyNamed:(NSString *)name;
30 |
31 | /**
32 | @abstract The current velocity value.
33 | @discussion Set before animation start to account for initial velocity. Expressed in change of value units per second. The only POPValueTypes supported for velocity are: kPOPValuePoint, kPOPValueInteger, kPOPValueFloat, kPOPValueRect, and kPOPValueSize.
34 | */
35 | @property (copy, nonatomic) id velocity;
36 |
37 | /**
38 | @abstract The original velocity value.
39 | @discussion Since the velocity property is modified as the animation progresses, this property stores the original, passed in velocity to support autoreverse and repeatCount.
40 | */
41 | @property (copy, nonatomic, readonly) id originalVelocity;
42 |
43 | /**
44 | @abstract The deceleration factor.
45 | @discussion Values specifies should be in the range [0, 1]. Lower values results in faster deceleration. Defaults to 0.998.
46 | */
47 | @property (assign, nonatomic) CGFloat deceleration;
48 |
49 | /**
50 | @abstract The expected duration.
51 | @discussion Derived based on input velocity and deceleration values.
52 | */
53 | @property (readonly, assign, nonatomic) CFTimeInterval duration;
54 |
55 | /**
56 | The to value is derived based on input velocity and deceleration.
57 | */
58 | - (void)setToValue:(id)toValue NS_UNAVAILABLE;
59 |
60 | /**
61 | @abstract The reversed velocity.
62 | @discussion The reversed velocity based on the originalVelocity when the animation was set up.
63 | */
64 | - (id)reversedVelocity;
65 |
66 | @end
67 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPDecayAnimationInternal.h:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "POPDecayAnimation.h"
11 |
12 | #import
13 |
14 | #import "POPPropertyAnimationInternal.h"
15 |
16 | // minimal velocity factor before decay animation is considered complete, in units / s
17 | static CGFloat kPOPAnimationDecayMinimalVelocityFactor = 5.;
18 |
19 | // default decay animation deceleration
20 | static CGFloat kPOPAnimationDecayDecelerationDefault = 0.998;
21 |
22 | static void decay_position(CGFloat *x, CGFloat *v, NSUInteger count, CFTimeInterval dt, CGFloat deceleration)
23 | {
24 | dt *= 1000;
25 |
26 | // v0 = v / 1000
27 | // v = v0 * powf(deceleration, dt);
28 | // v = v * 1000;
29 |
30 | // x0 = x;
31 | // x = x0 + v0 * deceleration * (1 - powf(deceleration, dt)) / (1 - deceleration)
32 | float v0[count];
33 | float kv = powf(deceleration, dt);
34 | float kx = deceleration * (1 - kv) / (1 - deceleration);
35 |
36 | for (NSUInteger idx = 0; idx < count; idx++) {
37 | v0[idx] = v[idx] / 1000.;
38 | v[idx] = v0[idx] * kv * 1000.;
39 | x[idx] = x[idx] + v0[idx] * kx;
40 | }
41 | }
42 |
43 | struct _POPDecayAnimationState : _POPPropertyAnimationState
44 | {
45 | double deceleration;
46 | CFTimeInterval duration;
47 |
48 | _POPDecayAnimationState(id __unsafe_unretained anim) :
49 | _POPPropertyAnimationState(anim),
50 | deceleration(kPOPAnimationDecayDecelerationDefault),
51 | duration(0)
52 | {
53 | type = kPOPAnimationDecay;
54 | }
55 |
56 | bool isDone() {
57 | if (_POPPropertyAnimationState::isDone()) {
58 | return true;
59 | }
60 |
61 | CGFloat f = dynamicsThreshold * kPOPAnimationDecayMinimalVelocityFactor;
62 | const CGFloat *velocityValues = vec_data(velocityVec);
63 | for (NSUInteger idx = 0; idx < valueCount; idx++) {
64 | if (std::abs((velocityValues[idx])) >= f)
65 | return false;
66 | }
67 | return true;
68 |
69 | }
70 |
71 | void computeDuration() {
72 |
73 | // compute duration till threshold velocity
74 | Vector4r scaledVelocity = vector4(velocityVec) / 1000.;
75 |
76 | double k = dynamicsThreshold * kPOPAnimationDecayMinimalVelocityFactor / 1000.;
77 | double vx = k / scaledVelocity.x;
78 | double vy = k / scaledVelocity.y;
79 | double vz = k / scaledVelocity.z;
80 | double vw = k / scaledVelocity.w;
81 | double d = log(deceleration) * 1000.;
82 | duration = MAX(MAX(MAX(log(fabs(vx)) / d, log(fabs(vy)) / d), log(fabs(vz)) / d), log(fabs(vw)) / d);
83 |
84 | // ensure velocity threshold is exceeded
85 | if (std::isnan(duration) || duration < 0) {
86 | duration = 0;
87 | }
88 | }
89 |
90 | void computeToValue() {
91 | // to value assuming final velocity as a factor of dynamics threshold
92 | // derived from v' = v * d^dt used in decay_position
93 | // to compute the to value with maximal dt, p' = p + (v * d) / (1 - d)
94 | VectorRef fromValue = NULL != currentVec ? currentVec : fromVec;
95 | if (!fromValue) {
96 | return;
97 | }
98 |
99 | // ensure duration is computed
100 | if (0 == duration) {
101 | computeDuration();
102 | }
103 |
104 | // compute to value
105 | VectorRef toValue(Vector::new_vector(fromValue.get()));
106 | Vector4r velocity = velocityVec->vector4r();
107 | decay_position(toValue->data(), velocity.data(), valueCount, duration, deceleration);
108 | toVec = toValue;
109 | }
110 |
111 | bool advance(CFTimeInterval time, CFTimeInterval dt, id obj) {
112 | // advance past not yet initialized animations
113 | if (NULL == currentVec) {
114 | return false;
115 | }
116 |
117 | decay_position(currentVec->data(), velocityVec->data(), valueCount, dt, deceleration);
118 |
119 | // clamp to compute end value; avoid possibility of decaying past
120 | clampCurrentValue(kPOPAnimationClampEnd | clampMode);
121 |
122 | return true;
123 | }
124 |
125 | };
126 |
127 | typedef struct _POPDecayAnimationState POPDecayAnimationState;
128 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPDefines.h:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #ifndef POP_POPDefines_h
11 | #define POP_POPDefines_h
12 |
13 | #import
14 |
15 | #ifdef __cplusplus
16 | # define POP_EXTERN_C_BEGIN extern "C" {
17 | # define POP_EXTERN_C_END }
18 | #else
19 | # define POP_EXTERN_C_BEGIN
20 | # define POP_EXTERN_C_END
21 | #endif
22 |
23 | #define POP_ARRAY_COUNT(x) sizeof(x) / sizeof(x[0])
24 |
25 | #if defined (__cplusplus) && defined (__GNUC__)
26 | # define POP_NOTHROW __attribute__ ((nothrow))
27 | #else
28 | # define POP_NOTHROW
29 | #endif
30 |
31 | #if defined(POP_USE_SCENEKIT)
32 | # if TARGET_OS_MAC || TARGET_OS_IPHONE
33 | # define SCENEKIT_SDK_AVAILABLE 1
34 | # endif
35 | #endif
36 |
37 | #endif
38 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPGeometry.h:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #if TARGET_OS_IPHONE
13 | #import
14 | #endif
15 |
16 | #if !TARGET_OS_IPHONE
17 |
18 | /** NSValue extensions to support animatable types. */
19 | @interface NSValue (POP)
20 |
21 | /**
22 | @abstract Creates an NSValue given a CGPoint.
23 | */
24 | + (NSValue *)valueWithCGPoint:(CGPoint)point;
25 |
26 | /**
27 | @abstract Creates an NSValue given a CGSize.
28 | */
29 | + (NSValue *)valueWithCGSize:(CGSize)size;
30 |
31 | /**
32 | @abstract Creates an NSValue given a CGRect.
33 | */
34 | + (NSValue *)valueWithCGRect:(CGRect)rect;
35 |
36 | /**
37 | @abstract Creates an NSValue given a CFRange.
38 | */
39 | + (NSValue *)valueWithCFRange:(CFRange)range;
40 |
41 | /**
42 | @abstract Creates an NSValue given a CGAffineTransform.
43 | */
44 | + (NSValue *)valueWithCGAffineTransform:(CGAffineTransform)transform;
45 |
46 | /**
47 | @abstract Returns the underlying CGPoint value.
48 | */
49 | - (CGPoint)CGPointValue;
50 |
51 | /**
52 | @abstract Returns the underlying CGSize value.
53 | */
54 | - (CGSize)CGSizeValue;
55 |
56 | /**
57 | @abstract Returns the underlying CGRect value.
58 | */
59 | - (CGRect)CGRectValue;
60 |
61 | /**
62 | @abstract Returns the underlying CFRange value.
63 | */
64 | - (CFRange)CFRangeValue;
65 |
66 | /**
67 | @abstract Returns the underlying CGAffineTransform value.
68 | */
69 | - (CGAffineTransform)CGAffineTransformValue;
70 |
71 | @end
72 |
73 | #endif
74 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPGeometry.mm:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "POPGeometry.h"
11 |
12 | #if !TARGET_OS_IPHONE
13 | @implementation NSValue (POP)
14 |
15 | + (NSValue *)valueWithCGPoint:(CGPoint)point {
16 | return [NSValue valueWithBytes:&point objCType:@encode(CGPoint)];
17 | }
18 |
19 | + (NSValue *)valueWithCGSize:(CGSize)size {
20 | return [NSValue valueWithBytes:&size objCType:@encode(CGSize)];
21 | }
22 |
23 | + (NSValue *)valueWithCGRect:(CGRect)rect {
24 | return [NSValue valueWithBytes:&rect objCType:@encode(CGRect)];
25 | }
26 |
27 | + (NSValue *)valueWithCFRange:(CFRange)range {
28 | return [NSValue valueWithBytes:&range objCType:@encode(CFRange)];
29 | }
30 |
31 | + (NSValue *)valueWithCGAffineTransform:(CGAffineTransform)transform
32 | {
33 | return [NSValue valueWithBytes:&transform objCType:@encode(CGAffineTransform)];
34 | }
35 |
36 | - (CGPoint)CGPointValue {
37 | CGPoint result;
38 | [self getValue:&result];
39 | return result;
40 | }
41 |
42 | - (CGSize)CGSizeValue {
43 | CGSize result;
44 | [self getValue:&result];
45 | return result;
46 | }
47 |
48 | - (CGRect)CGRectValue {
49 | CGRect result;
50 | [self getValue:&result];
51 | return result;
52 | }
53 |
54 | - (CFRange)CFRangeValue {
55 | CFRange result;
56 | [self getValue:&result];
57 | return result;
58 | }
59 |
60 | - (CGAffineTransform)CGAffineTransformValue {
61 | CGAffineTransform result;
62 | [self getValue:&result];
63 | return result;
64 | }
65 | @end
66 |
67 | #endif
68 |
69 | #if TARGET_OS_IPHONE
70 | #import "POPDefines.h"
71 |
72 | #if SCENEKIT_SDK_AVAILABLE
73 | #import
74 |
75 | /**
76 | Dirty hacks because iOS is weird and decided to define both SCNVector3's and SCNVector4's objCType as "t". However @encode(SCNVector3) and @encode(SCNVector4) both return the proper definition ("{SCNVector3=fff}" and "{SCNVector4=ffff}" respectively)
77 |
78 | [[NSValue valueWithSCNVector3:SCNVector3Make(0.0, 0.0, 0.0)] objcType] returns "t", whereas it should return "{SCNVector3=fff}".
79 |
80 | *flips table*
81 | */
82 | @implementation NSValue (SceneKitFixes)
83 |
84 | + (NSValue *)valueWithSCNVector3:(SCNVector3)vec3 {
85 | return [NSValue valueWithBytes:&vec3 objCType:@encode(SCNVector3)];
86 | }
87 |
88 | + (NSValue *)valueWithSCNVector4:(SCNVector4)vec4 {
89 | return [NSValue valueWithBytes:&vec4 objCType:@encode(SCNVector4)];
90 | }
91 |
92 | @end
93 | #endif
94 | #endif
95 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPMath.h:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | #import "POPDefines.h"
15 |
16 | NS_INLINE CGFloat sqrtr(CGFloat f)
17 | {
18 | #if CGFLOAT_IS_DOUBLE
19 | return sqrt(f);
20 | #else
21 | return sqrtf(f);
22 | #endif
23 | }
24 |
25 | // round to nearest sub; pass 2.0 to round to every 0.5 (eg: retina pixels)
26 | NS_INLINE CGFloat POPSubRound(CGFloat f, CGFloat sub)
27 | {
28 | return round(f * sub) / sub;
29 | }
30 |
31 | #define MIX(a, b, f) ((a) + (f) * ((b) - (a)))
32 |
33 | // the longer the duration, the higher the necessary precision
34 | #define SOLVE_EPS(dur) (1. / (1000. * (dur)))
35 |
36 | #define _EQLF_(x, y, epsilon) (fabsf ((x) - (y)) < epsilon)
37 |
38 | extern void POPInterpolateVector(NSUInteger count, CGFloat *dst, const CGFloat *from, const CGFloat *to, CGFloat f);
39 |
40 | extern double POPTimingFunctionSolve(const double vec[4], double t, double eps);
41 |
42 | // quadratic mapping of t [0, 1] to [start, end]
43 | extern double POPQuadraticOutInterpolation(double t, double start, double end);
44 |
45 | // normalize value to [0, 1] based on its range [startValue, endValue]
46 | extern double POPNormalize(double value, double startValue, double endValue);
47 |
48 | // project a normalized value [0, 1] to a given range [start, end]
49 | extern double POPProjectNormal(double n, double start, double end);
50 |
51 | // solve a quadratic equation of the form a * x^2 + b * x + c = 0
52 | extern void POPQuadraticSolve(CGFloat a, CGFloat b, CGFloat c, CGFloat &x1, CGFloat &x2);
53 |
54 | // for a given tension return the bouncy 3 friction that produces no bounce
55 | extern double POPBouncy3NoBounce(double tension);
56 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPMath.mm:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "POPMath.h"
11 |
12 | #import "POPAnimationPrivate.h"
13 | #import "UnitBezier.h"
14 |
15 | void POPInterpolateVector(NSUInteger count, CGFloat *dst, const CGFloat *from, const CGFloat *to, CGFloat f)
16 | {
17 | for (NSUInteger idx = 0; idx < count; idx++) {
18 | dst[idx] = MIX(from[idx], to[idx], f);
19 | }
20 | }
21 |
22 | double POPTimingFunctionSolve(const double vec[4], double t, double eps)
23 | {
24 | WebCore::UnitBezier bezier(vec[0], vec[1], vec[2], vec[3]);
25 | return bezier.solve(t, eps);
26 | }
27 |
28 | double POPNormalize(double value, double startValue, double endValue)
29 | {
30 | return (value - startValue) / (endValue - startValue);
31 | }
32 |
33 | double POPProjectNormal(double n, double start, double end)
34 | {
35 | return start + (n * (end - start));
36 | }
37 |
38 | static double linear_interpolation(double t, double start, double end)
39 | {
40 | return t * end + (1.f - t) * start;
41 | }
42 |
43 | double POPQuadraticOutInterpolation(double t, double start, double end)
44 | {
45 | return linear_interpolation(2*t - t*t, start, end);
46 | }
47 |
48 | static double b3_friction1(double x)
49 | {
50 | return (0.0007 * pow(x, 3)) - (0.031 * pow(x, 2)) + 0.64 * x + 1.28;
51 | }
52 |
53 | static double b3_friction2(double x)
54 | {
55 | return (0.000044 * pow(x, 3)) - (0.006 * pow(x, 2)) + 0.36 * x + 2.;
56 | }
57 |
58 | static double b3_friction3(double x)
59 | {
60 | return (0.00000045 * pow(x, 3)) - (0.000332 * pow(x, 2)) + 0.1078 * x + 5.84;
61 | }
62 |
63 | double POPBouncy3NoBounce(double tension)
64 | {
65 | double friction = 0;
66 | if (tension <= 18.) {
67 | friction = b3_friction1(tension);
68 | } else if (tension > 18 && tension <= 44) {
69 | friction = b3_friction2(tension);
70 | } else if (tension > 44) {
71 | friction = b3_friction3(tension);
72 | } else {
73 | assert(false);
74 | }
75 | return friction;
76 | }
77 |
78 | void POPQuadraticSolve(CGFloat a, CGFloat b, CGFloat c, CGFloat &x1, CGFloat &x2)
79 | {
80 | CGFloat discriminant = sqrt(b * b - 4 * a * c);
81 | x1 = (-b + discriminant) / (2 * a);
82 | x2 = (-b - discriminant) / (2 * a);
83 | }
84 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPPropertyAnimation.h:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 | #import
12 |
13 | /**
14 | @abstract Flags for clamping animation values.
15 | @discussion Animation values can optionally be clamped to avoid overshoot. kPOPAnimationClampStart ensures values are more than fromValue and kPOPAnimationClampEnd ensures values are less than toValue.
16 | */
17 | typedef NS_OPTIONS(NSUInteger, POPAnimationClampFlags)
18 | {
19 | kPOPAnimationClampNone = 0,
20 | kPOPAnimationClampStart = 1UL << 0,
21 | kPOPAnimationClampEnd = 1UL << 1,
22 | kPOPAnimationClampBoth = kPOPAnimationClampStart | kPOPAnimationClampEnd,
23 | };
24 |
25 | /**
26 | @abstract The semi-concrete property animation subclass.
27 | */
28 | @interface POPPropertyAnimation : POPAnimation
29 |
30 | /**
31 | @abstract The property to animate.
32 | */
33 | @property (strong, nonatomic) POPAnimatableProperty *property;
34 |
35 | /**
36 | @abstract The value to animate from.
37 | @discussion The value type should match the property. If unspecified, the value is initialized to the object's current value on animation start.
38 | */
39 | @property (copy, nonatomic) id fromValue;
40 |
41 | /**
42 | @abstract The value to animate to.
43 | @discussion The value type should match the property. If unspecified, the value is initialized to the object's current value on animation start.
44 | */
45 | @property (copy, nonatomic) id toValue;
46 |
47 | /**
48 | @abstract The rounding factor applied to the current animated value.
49 | @discussion Specify 1.0 to animate between integral values. Defaults to 0 meaning no rounding.
50 | */
51 | @property (assign, nonatomic) CGFloat roundingFactor;
52 |
53 | /**
54 | @abstract The clamp mode applied to the current animated value.
55 | @discussion See {@ref POPAnimationClampFlags} for possible values. Defaults to kPOPAnimationClampNone.
56 | */
57 | @property (assign, nonatomic) NSUInteger clampMode;
58 |
59 | /**
60 | @abstract The flag indicating whether values should be "added" each frame, rather than set.
61 | @discussion Addition may be type dependent. Defaults to NO.
62 | */
63 | @property (assign, nonatomic, getter = isAdditive) BOOL additive;
64 |
65 | @end
66 |
67 | @interface POPPropertyAnimation (CustomProperty)
68 |
69 | + (instancetype)animationWithCustomPropertyNamed:(NSString *)name
70 | readBlock:(POPAnimatablePropertyReadBlock)readBlock
71 | writeBlock:(POPAnimatablePropertyWriteBlock)writeBlock;
72 |
73 | + (instancetype)animationWithCustomPropertyReadBlock:(POPAnimatablePropertyReadBlock)readBlock
74 | writeBlock:(POPAnimatablePropertyWriteBlock)writeBlock;
75 |
76 | @end
77 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPSpringAnimation.h:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | /**
13 | @abstract A concrete spring animation class.
14 | @discussion Animation is achieved through modeling spring dynamics.
15 | */
16 | @interface POPSpringAnimation : POPPropertyAnimation
17 |
18 | /**
19 | @abstract The designated initializer.
20 | @returns An instance of a spring animation.
21 | */
22 | + (instancetype)animation;
23 |
24 | /**
25 | @abstract Convenience initializer that returns an animation with animatable property of name.
26 | @param name The name of the animatable property.
27 | @returns An instance of a spring animation configured with specified animatable property.
28 | */
29 | + (instancetype)animationWithPropertyNamed:(NSString *)name;
30 |
31 | /**
32 | @abstract The current velocity value.
33 | @discussion Set before animation start to account for initial velocity. Expressed in change of value units per second.
34 | */
35 | @property (copy, nonatomic) id velocity;
36 |
37 | /**
38 | @abstract The effective bounciness.
39 | @discussion Use in conjunction with 'springSpeed' to change animation effect. Values are converted into corresponding dynamics constants. Higher values increase spring movement range resulting in more oscillations and springiness. Defined as a value in the range [0, 20]. Defaults to 4.
40 | */
41 | @property (assign, nonatomic) CGFloat springBounciness;
42 |
43 | /**
44 | @abstract The effective speed.
45 | @discussion Use in conjunction with 'springBounciness' to change animation effect. Values are converted into corresponding dynamics constants. Higher values increase the dampening power of the spring resulting in a faster initial velocity and more rapid bounce slowdown. Defined as a value in the range [0, 20]. Defaults to 12.
46 | */
47 | @property (assign, nonatomic) CGFloat springSpeed;
48 |
49 | /**
50 | @abstract The tension used in the dynamics simulation.
51 | @discussion Can be used over bounciness and speed for finer grain tweaking of animation effect.
52 | */
53 | @property (assign, nonatomic) CGFloat dynamicsTension;
54 |
55 | /**
56 | @abstract The friction used in the dynamics simulation.
57 | @discussion Can be used over bounciness and speed for finer grain tweaking of animation effect.
58 | */
59 | @property (assign, nonatomic) CGFloat dynamicsFriction;
60 |
61 | /**
62 | @abstract The mass used in the dynamics simulation.
63 | @discussion Can be used over bounciness and speed for finer grain tweaking of animation effect.
64 | */
65 | @property (assign, nonatomic) CGFloat dynamicsMass;
66 |
67 | @end
68 |
--------------------------------------------------------------------------------
/Pods/pop/pop/POPSpringAnimationInternal.h:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright (c) 2014-present, Facebook, Inc.
3 | All rights reserved.
4 |
5 | This source code is licensed under the BSD-style license found in the
6 | LICENSE file in the root directory of this source tree. An additional grant
7 | of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import "POPAnimationExtras.h"
13 | #import "POPPropertyAnimationInternal.h"
14 |
15 | struct _POPSpringAnimationState : _POPPropertyAnimationState
16 | {
17 | SpringSolver4d *solver;
18 | CGFloat springSpeed;
19 | CGFloat springBounciness; // normalized springiness
20 | CGFloat dynamicsTension; // tension
21 | CGFloat dynamicsFriction; // friction
22 | CGFloat dynamicsMass; // mass
23 |
24 | _POPSpringAnimationState(id __unsafe_unretained anim) : _POPPropertyAnimationState(anim),
25 | solver(nullptr),
26 | springSpeed(12.),
27 | springBounciness(4.),
28 | dynamicsTension(0),
29 | dynamicsFriction(0),
30 | dynamicsMass(0)
31 | {
32 | type = kPOPAnimationSpring;
33 | }
34 |
35 | bool hasConverged()
36 | {
37 | NSUInteger count = valueCount;
38 | if (shouldRound()) {
39 | return vec_equal(previous2Vec, previousVec) && vec_equal(previousVec, toVec);
40 | } else {
41 | if (!previousVec || !previous2Vec)
42 | return false;
43 |
44 | CGFloat t = dynamicsThreshold / 5;
45 |
46 | const CGFloat *toValues = toVec->data();
47 | const CGFloat *previousValues = previousVec->data();
48 | const CGFloat *previous2Values = previous2Vec->data();
49 |
50 | for (NSUInteger idx = 0; idx < count; idx++) {
51 | if ((std::abs(toValues[idx] - previousValues[idx]) >= t) || (std::abs(previous2Values[idx] - previousValues[idx]) >= t)) {
52 | return false;
53 | }
54 | }
55 | return true;
56 | }
57 | }
58 |
59 | bool isDone() {
60 | if (_POPPropertyAnimationState::isDone()) {
61 | return true;
62 | }
63 | return solver->started() && (hasConverged() || solver->hasConverged());
64 | }
65 |
66 | void updatedDynamics()
67 | {
68 | if (NULL != solver) {
69 | solver->setConstants(dynamicsTension, dynamicsFriction, dynamicsMass);
70 | }
71 | }
72 |
73 | void updatedDynamicsThreshold()
74 | {
75 | _POPPropertyAnimationState::updatedDynamicsThreshold();
76 | if (NULL != solver) {
77 | solver->setThreshold(dynamicsThreshold);
78 | }
79 | }
80 |
81 | void updatedBouncinessAndSpeed() {
82 | [POPSpringAnimation convertBounciness:springBounciness speed:springSpeed toTension:&dynamicsTension friction:&dynamicsFriction mass:&dynamicsMass];
83 | updatedDynamics();
84 | }
85 |
86 | bool advance(CFTimeInterval time, CFTimeInterval dt, id obj) {
87 | // advance past not yet initialized animations
88 | if (NULL == currentVec) {
89 | return false;
90 | }
91 |
92 | CFTimeInterval localTime = time - startTime;
93 |
94 | Vector4d value = vector4d(currentVec);
95 | Vector4d toValue = vector4d(toVec);
96 | Vector4d velocity = vector4d(velocityVec);
97 |
98 | SSState4d state;
99 | state.p = toValue - value;
100 |
101 | // the solver assumes a spring of size zero
102 | // flip the velocity from user perspective to solver perspective
103 | state.v = velocity * -1;
104 |
105 | solver->advance(state, localTime, dt);
106 | value = toValue - state.p;
107 |
108 | // flip velocity back to user perspective
109 | velocity = state.v * -1;
110 |
111 | *currentVec = value;
112 |
113 | if (velocityVec) {
114 | *velocityVec = velocity;
115 | }
116 |
117 | clampCurrentValue();
118 |
119 | return true;
120 | }
121 |
122 | virtual void reset(bool all) {
123 | _POPPropertyAnimationState::reset(all);
124 |
125 | if (solver) {
126 | solver->setConstants(dynamicsTension, dynamicsFriction, dynamicsMass);
127 | solver->reset();
128 | }
129 | }
130 | };
131 |
132 | typedef struct _POPSpringAnimationState POPSpringAnimationState;
133 |
--------------------------------------------------------------------------------
/Pods/pop/pop/WebCore/FloatConversion.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2007 Apple Inc. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
14 | * its contributors may be used to endorse or promote products derived
15 | * from this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | #ifndef FloatConversion_h
30 | #define FloatConversion_h
31 |
32 | #include
33 |
34 | namespace WebCore {
35 |
36 | template
37 | float narrowPrecisionToFloat(T);
38 |
39 | template<>
40 | inline float narrowPrecisionToFloat(double number)
41 | {
42 | return static_cast(number);
43 | }
44 |
45 | template
46 | CGFloat narrowPrecisionToCGFloat(T);
47 |
48 | template<>
49 | inline CGFloat narrowPrecisionToCGFloat(double number)
50 | {
51 | return static_cast(number);
52 | }
53 |
54 | } // namespace WebCore
55 |
56 | #endif // FloatConversion_h
57 |
--------------------------------------------------------------------------------
/Pods/pop/pop/WebCore/UnitBezier.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | * 1. Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * 2. Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | *
13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | */
25 |
26 | #ifndef UnitBezier_h
27 | #define UnitBezier_h
28 |
29 | #include
30 |
31 | namespace WebCore {
32 |
33 | struct UnitBezier {
34 | UnitBezier(double p1x, double p1y, double p2x, double p2y)
35 | {
36 | // Calculate the polynomial coefficients, implicit first and last control points are (0,0) and (1,1).
37 | cx = 3.0 * p1x;
38 | bx = 3.0 * (p2x - p1x) - cx;
39 | ax = 1.0 - cx -bx;
40 |
41 | cy = 3.0 * p1y;
42 | by = 3.0 * (p2y - p1y) - cy;
43 | ay = 1.0 - cy - by;
44 | }
45 |
46 | double sampleCurveX(double t)
47 | {
48 | // `ax t^3 + bx t^2 + cx t' expanded using Horner's rule.
49 | return ((ax * t + bx) * t + cx) * t;
50 | }
51 |
52 | double sampleCurveY(double t)
53 | {
54 | return ((ay * t + by) * t + cy) * t;
55 | }
56 |
57 | double sampleCurveDerivativeX(double t)
58 | {
59 | return (3.0 * ax * t + 2.0 * bx) * t + cx;
60 | }
61 |
62 | // Given an x value, find a parametric value it came from.
63 | double solveCurveX(double x, double epsilon)
64 | {
65 | double t0;
66 | double t1;
67 | double t2;
68 | double x2;
69 | double d2;
70 | int i;
71 |
72 | // First try a few iterations of Newton's method -- normally very fast.
73 | for (t2 = x, i = 0; i < 8; i++) {
74 | x2 = sampleCurveX(t2) - x;
75 | if (fabs (x2) < epsilon)
76 | return t2;
77 | d2 = sampleCurveDerivativeX(t2);
78 | if (fabs(d2) < 1e-6)
79 | break;
80 | t2 = t2 - x2 / d2;
81 | }
82 |
83 | // Fall back to the bisection method for reliability.
84 | t0 = 0.0;
85 | t1 = 1.0;
86 | t2 = x;
87 |
88 | if (t2 < t0)
89 | return t0;
90 | if (t2 > t1)
91 | return t1;
92 |
93 | while (t0 < t1) {
94 | x2 = sampleCurveX(t2);
95 | if (fabs(x2 - x) < epsilon)
96 | return t2;
97 | if (x > x2)
98 | t0 = t2;
99 | else
100 | t1 = t2;
101 | t2 = (t1 - t0) * .5 + t0;
102 | }
103 |
104 | // Failure.
105 | return t2;
106 | }
107 |
108 | double solve(double x, double epsilon)
109 | {
110 | return sampleCurveY(solveCurveX(x, epsilon));
111 | }
112 |
113 | private:
114 | double ax;
115 | double bx;
116 | double cx;
117 |
118 | double ay;
119 | double by;
120 | double cy;
121 | };
122 | }
123 | #endif
124 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # WaterfallLayout
2 |
3 | > 自带过渡效果的UICollectionView瀑布流布局。
4 |
5 | Feature:
6 | ✅ 自带过渡效果;
7 | ✅ 可自定义列数、间距等属性;
8 | ✅ 适配横竖屏;
9 | ✅ 提供异步刷新;
10 | ✅ 兼容 OC & Swift;
11 | ✅ API简单易用。
12 |
13 | ## 效果
14 |
15 | - 整体刷新效果
16 |
17 | 
18 |
19 | - 列数变化效果
20 |
21 | 
22 |
23 | - 增/删/改效果
24 |
25 | 
26 |
27 | - 适配横竖屏
28 |
29 | 
30 |
31 | ## 使用
32 |
33 | 1. 只需将`WaterfallLayout.swift`文件拖进项目
34 |
35 | 2. 初始化`waterfallLayout`及`collectionView`并成为其代理
36 | ```swift
37 | let waterfallLayout = WaterfallLayout()
38 | waterfallLayout.delegate = self
39 |
40 | let collectionView = UICollectionView(frame: UIScreen.main.bounds, collectionViewLayout: waterfallLayout)
41 | collectionView.delegate = self
42 | collectionView.dataSource = self
43 | view.addSubview(collectionView)
44 | ```
45 |
46 | 3. 实现`waterfallLayout`的代理方法,搞定
47 | ```swift
48 | extension ViewController: WaterfallLayoutDelegate {
49 | /// 提供item的下标和(根据列数和间距得出)的宽度,需代理返回对应item的高度
50 | func waterfallLayout(_ waterfallLayout: WaterfallLayout, heightForItemAtIndex index: Int, itemWidth: CGFloat) -> CGFloat {
51 | // 具体可参考Demo
52 | let girl = girls[index]
53 | return itemWidth / girl.whRatio
54 | }
55 |
56 | ///【可选】cell的总列数
57 | func colCountInWaterFlowLayout(_ waterfallLayout: WaterfallLayout) -> Int {
58 | 4
59 | }
60 |
61 | ///【可选】cell的列间距
62 | func colMarginInWaterFlowLayout(_ waterfallLayout: WaterfallLayout) -> CGFloat {
63 | 5
64 | }
65 |
66 | ///【可选】cell的行间距
67 | func rowMarginInWaterFlowLayout(_ waterfallLayout: WaterfallLayout) -> CGFloat {
68 | 5
69 | }
70 |
71 | ///【可选】collectionView的内容间距
72 | func edgeInsetsInWaterFlowLayout(_ waterfallLayout: WaterfallLayout) -> UIEdgeInsets {
73 | UIEdgeInsets(top: 5, left: 5, bottom: 5, right: 5)
74 | }
75 | }
76 | ```
77 |
78 | 4. 刷新布局
79 | ```swift
80 | // 带动画刷新:使用自定义动画包裹collectionView的刷新操作
81 | UIView.animate(withDuration: 1, delay: 0, usingSpringWithDamping: 0.88, initialSpringVelocity: 1) {
82 | self.collectionView.performBatchUpdates {
83 | self.collectionView.reloadSections(IndexSet(integer: 0))
84 | }
85 | }
86 |
87 | // 不带动画刷新
88 | collectionView.reloadData()
89 | ```
90 |
91 | ## Tips
92 |
93 | 1. 目前仅支持`UICollectionViewCell`和`单Section`的布局,也就是说不支持Section头、Section尾和多个Section的情况;
94 |
95 | 2. 当数据量庞大时,可使用异步刷新:
96 | ```swift
97 | waterfallLayout.asyncUpdateLayout(itemTotal: girls.count) { [weak self] index, itemWidth in
98 | // 提供item的下标和(根据列数和间距得出)的宽度,返回对应item的高度
99 | guard let self = self else { return 1 }
100 | let girl = self.girls[index]
101 | return itemWidth / girl.whRatio
102 | } completion: { [weak self] in
103 | // 刷新布局
104 | guard let self = self else { return }
105 | UIView.animate(withDuration: 1, delay: 0, usingSpringWithDamping: 0.88, initialSpringVelocity: 1) {
106 | self.collectionView.performBatchUpdates {
107 | self.collectionView.reloadSections(IndexSet(integer: 0))
108 | }
109 | }
110 | }
111 | ```
112 |
113 | PS:目前已做了初步优化,即便不使用异步刷新,在展示和滑动大量数据的列表(如用户相册)时也能保持页面流畅:
114 |
115 | 
116 |
117 | - 后续迭代将不断优化!
118 |
--------------------------------------------------------------------------------
/WaterfallLayoutDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/WaterfallLayoutDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/WaterfallLayoutDemo.xcodeproj/project.xcworkspace/xcuserdata/aa.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rogue24/WaterfallLayoutDemo/6b4f6f4575ec3af9b4bd7395463489e311cf74a8/WaterfallLayoutDemo.xcodeproj/project.xcworkspace/xcuserdata/aa.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/WaterfallLayoutDemo.xcodeproj/xcuserdata/aa.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | WaterfallLayout.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 0
11 |
12 | WaterfallLayoutDemo.xcscheme_^#shared#^_
13 |
14 | orderHint
15 | 2
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/WaterfallLayoutDemo.xcodeproj/xcuserdata/zhoujianping.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | WaterfallLayoutDemo.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 3
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/WaterfallLayoutDemo.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WaterfallLayoutDemo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/WaterfallLayoutDemo.xcworkspace/xcuserdata/aa.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rogue24/WaterfallLayoutDemo/6b4f6f4575ec3af9b4bd7395463489e311cf74a8/WaterfallLayoutDemo.xcworkspace/xcuserdata/aa.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/WaterfallLayoutDemo.xcworkspace/xcuserdata/aa.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
--------------------------------------------------------------------------------
/WaterfallLayoutDemo.xcworkspace/xcuserdata/zhoujianping.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rogue24/WaterfallLayoutDemo/6b4f6f4575ec3af9b4bd7395463489e311cf74a8/WaterfallLayoutDemo.xcworkspace/xcuserdata/zhoujianping.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/WaterfallLayoutDemo.xcworkspace/xcuserdata/zhoujianping.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // WaterfallLayoutDemo
4 | //
5 | // Created by aa on 2023/3/5.
6 | //
7 |
8 | import UIKit
9 |
10 | @main
11 | class AppDelegate: UIResponder, UIApplicationDelegate {
12 |
13 |
14 |
15 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
16 | ScreenRotator.shared.isLockOrientationWhenDeviceOrientationDidChange = false
17 | ScreenRotator.shared.isLockLandscapeWhenDeviceOrientationDidChange = false
18 | return true
19 | }
20 |
21 | // MARK: UISceneSession Lifecycle
22 |
23 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
24 | // Called when a new scene session is being created.
25 | // Use this method to select a configuration to create the new scene with.
26 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
27 | }
28 |
29 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) {
30 | // Called when the user discards a scene session.
31 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
32 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return.
33 | }
34 |
35 | func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
36 | ScreenRotator.shared.orientationMask
37 | }
38 | }
39 |
40 |
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/Assets.xcassets/AccentColor.colorset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "colors" : [
3 | {
4 | "idiom" : "universal"
5 | }
6 | ],
7 | "info" : {
8 | "author" : "xcode",
9 | "version" : 1
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "platform" : "ios",
6 | "size" : "1024x1024"
7 | }
8 | ],
9 | "info" : {
10 | "author" : "xcode",
11 | "version" : 1
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/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 |
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/Cell/WaterfallCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // WaterfallCell.swift
3 | // WaterfallLayoutDemo
4 | //
5 | // Created by 周健平 on 2023/6/4.
6 | //
7 |
8 | import UIKit
9 |
10 | class WaterfallCell: UICollectionViewCell {
11 | let imgView = UIImageView()
12 |
13 | var model: WaterfallModel? {
14 | didSet {
15 | guard let model = self.model else { return }
16 | imgView.image = model.image
17 | }
18 | }
19 |
20 | override init(frame: CGRect) {
21 | super.init(frame: frame)
22 |
23 | imgView.layer.cornerRadius = 4
24 | imgView.layer.masksToBounds = true
25 | imgView.backgroundColor = .lightGray
26 | contentView.addSubview(imgView)
27 | imgView.snp.makeConstraints { $0.edges.equalToSuperview() }
28 |
29 | let longGR = UILongPressGestureRecognizer(target: self, action: #selector(browse(_:)))
30 | longGR.minimumPressDuration = 0.25
31 | addGestureRecognizer(longGR)
32 | }
33 |
34 | required init?(coder: NSCoder) {
35 | fatalError("init(coder:) has not been implemented")
36 | }
37 |
38 | @objc func browse(_ longGR: UILongPressGestureRecognizer) {
39 | guard case .began = longGR.state else { return }
40 | BrowseImageView.show(from: self)
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/Data/WaterfallModel.swift:
--------------------------------------------------------------------------------
1 | //
2 | // WaterfallModel.swift
3 | // WaterfallLayoutDemo
4 | //
5 | // Created by 周健平 on 2023/6/4.
6 | //
7 |
8 | import UIKit
9 |
10 | class WaterfallModel {
11 | let image: UIImage
12 | let imageIndex: Int
13 |
14 | init(image: UIImage, imageIndex: Int) {
15 | self.image = image
16 | self.imageIndex = imageIndex
17 | }
18 |
19 | private(set) var cellSize: CGSize = .zero
20 | func resetCellSize(for cellWidth: CGFloat) {
21 | guard cellWidth != cellSize.width else { return }
22 | cellSize = CGSize(width: cellWidth, height: cellWidth * (image.size.height / image.size.width))
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/Data/WaterfallStore.swift:
--------------------------------------------------------------------------------
1 | //
2 | // WaterfallStore.swift
3 | // WaterfallLayoutDemo
4 | //
5 | // Created by 周健平 on 2023/6/4.
6 | //
7 |
8 | import UIKit
9 |
10 | enum WaterfallStore {
11 | private(set) static var models: [WaterfallModel] = []
12 | static var loadDone: (() -> Void)?
13 |
14 | private(set) static var isLoaded = false
15 | private static var isLoading = false
16 |
17 | static func loadData() {
18 | guard !isLoaded else {
19 | loadDone?()
20 | return
21 | }
22 |
23 | guard !isLoading else { return }
24 | isLoading = true
25 |
26 | let group = DispatchGroup()
27 | let locker = DispatchSemaphore(value: 1)
28 | let maxViewWidth = min(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
29 |
30 | for i in 1...16 {
31 | DispatchQueue.global().async(group: group) {
32 | let image = UIImage.girlImage(i)
33 | let maxViewSize = CGSize(width: maxViewWidth, height: (image.size.height / image.size.width) * maxViewWidth)
34 | let resize = CGSize(width: maxViewSize.width * 1.5, height: maxViewSize.height * 1.5)
35 |
36 | guard let decodeImg = decodeImage(image, resize: resize) else { return }
37 | let model = WaterfallModel(image: decodeImg, imageIndex: i)
38 |
39 | locker.wait()
40 | models.append(model)
41 | locker.signal()
42 | }
43 | }
44 |
45 | group.notify(queue: .main) {
46 | isLoading = false
47 | isLoaded = true
48 | loadDone?()
49 | }
50 | }
51 |
52 | private static func decodeImage(_ image: UIImage, resize: CGSize) -> UIImage? {
53 | guard let cgImage = image.cgImage else {
54 | return nil
55 | }
56 |
57 | var size = resize
58 | if resize.width > CGFloat(cgImage.width) {
59 | size = CGSize(width: cgImage.width, height: cgImage.height)
60 | }
61 |
62 | var bitmapRawValue = CGBitmapInfo.byteOrder32Little.rawValue
63 | bitmapRawValue |= CGImageAlphaInfo.noneSkipFirst.rawValue
64 |
65 | guard let context = CGContext(data: nil,
66 | width: Int(size.width),
67 | height: Int(size.height),
68 | bitsPerComponent: 8,
69 | bytesPerRow: 0,
70 | space: ColorSpace,
71 | bitmapInfo: bitmapRawValue) else { return nil }
72 | context.draw(cgImage, in: CGRect(origin: .zero, size: size))
73 |
74 | let decodeImg = context.makeImage()
75 | return decodeImg.map { UIImage(cgImage: $0) } ?? nil
76 | }
77 | }
78 |
79 | let ColorSpace = CGColorSpaceCreateDeviceRGB()
80 |
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/Extensions.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Extensions.swift
3 | // WaterfallLayoutDemo
4 | //
5 | // Created by 周健平 on 2023/6/4.
6 | //
7 |
8 | import UIKit
9 |
10 | extension UIImage {
11 | static func girlImage(_ index: Int) -> UIImage {
12 | UIImage(contentsOfFile: Bundle.main.path(forResource: "girl_\(index)", ofType: "jpg")!)!
13 | }
14 |
15 | static var randomGirlImage: UIImage {
16 | girlImage(Int.random(in: 1...16))
17 | }
18 | }
19 |
20 | extension CATransaction {
21 | static func execute(_ action: () -> ()) {
22 | begin()
23 | setDisableActions(true)
24 | action()
25 | commit()
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIApplicationSceneManifest
6 |
7 | UIApplicationSupportsMultipleScenes
8 |
9 | UISceneConfigurations
10 |
11 | UIWindowSceneSessionRoleApplication
12 |
13 |
14 | UISceneConfigurationName
15 | Default Configuration
16 | UISceneDelegateClassName
17 | $(PRODUCT_MODULE_NAME).SceneDelegate
18 | UISceneStoryboardFile
19 | Main
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/JPBlurView/JPBlurAnimationView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JPBlurAnimationView.swift
3 | // JPBlurView
4 | //
5 | // Created by 周健平 on 2023/6/4.
6 | //
7 |
8 | import UIKit
9 | import pop
10 |
11 | public class JPBlurAnimationView: JPBlurView {
12 | private lazy var executor = AnimationExecutor()
13 |
14 | public override init(effectStyle: UIBlurEffect.Style, intensity: CGFloat = 1, frame: CGRect = .zero) {
15 | super.init(effectStyle: effectStyle, intensity: intensity, frame: frame)
16 | NotificationCenter.default
17 | .addObserver(self,
18 | selector: #selector(didEnterBackgroundHandle),
19 | name: UIApplication.didEnterBackgroundNotification,
20 | object: nil)
21 | }
22 |
23 | required init?(coder: NSCoder) {
24 | fatalError("init(coder:) has not been implemented")
25 | }
26 |
27 | deinit {
28 | NotificationCenter.default.removeObserver(self)
29 | // print("BlurAnimationView deinit")
30 | }
31 | }
32 |
33 | // MARK: - API
34 | public extension JPBlurAnimationView {
35 | /// 便捷设置模糊度
36 | /// - Parameters:
37 | /// - intensity: 模糊度
38 | /// - animated: 是否带有动画效果
39 | func setIntensity(_ intensity: CGFloat, animated: Bool) {
40 | setIntensity(to: intensity, duration: animated ? 0.3 : 0)
41 | }
42 |
43 | /// 设置模糊度
44 | /// - Parameters:
45 | /// - from: 起始模糊度(为`nil`则当前模糊度)
46 | /// - to: 目标模糊度
47 | /// - duration: 动画时长(小于等于`0`则不带动画效果)
48 | /// - timingFunctionName: 动画曲线
49 | func setIntensity(from: CGFloat? = nil,
50 | to: CGFloat,
51 | duration: TimeInterval,
52 | timingFunctionName: CAMediaTimingFunctionName? = nil) {
53 | executor.start(fromValue: from ?? intensity,
54 | toValue: to,
55 | duration: duration,
56 | timingFunctionName: timingFunctionName) { [weak self] value in
57 | self?.intensity = value
58 | }
59 | }
60 |
61 | /// 停止动画(停止后模糊度为动画停止那一刻的数值)
62 | func stopAnimation() {
63 | _ = executor.stop()
64 | }
65 | }
66 |
67 | // MARK: - 监听通知
68 | private extension JPBlurAnimationView {
69 | @objc func didEnterBackgroundHandle() {
70 | guard let intensity = executor.stop() else { return }
71 | self.intensity = intensity
72 | }
73 | }
74 |
75 | // MARK: - 私有类
76 | private extension JPBlurAnimationView {
77 | class AnimationExecutor: NSObject {
78 | static let animKey = "JPAnimation"
79 | static let propKey = "JPProperty"
80 |
81 | func start(fromValue: CGFloat,
82 | toValue: CGFloat,
83 | duration: TimeInterval,
84 | timingFunctionName: CAMediaTimingFunctionName?,
85 | valueDidChangedHandler: @escaping (_ value: CGFloat) -> Void) {
86 | pop_removeAnimation(forKey: Self.animKey)
87 |
88 | guard duration > 0, fromValue != toValue else {
89 | valueDidChangedHandler(toValue)
90 | return
91 | }
92 |
93 | let animation = POPBasicAnimation()
94 | animation.fromValue = fromValue
95 | animation.toValue = toValue
96 | animation.duration = duration
97 | if let timingFunctionName = timingFunctionName {
98 | animation.timingFunction = CAMediaTimingFunction(name: timingFunctionName)
99 | }
100 |
101 | animation.property = POPAnimatableProperty.property(withName: Self.propKey) { prop in
102 | prop?.writeBlock = { (_, values) in
103 | guard let values = values else { return }
104 | let value = values[0]
105 | valueDidChangedHandler(value)
106 | }
107 | } as? POPAnimatableProperty
108 |
109 | pop_add(animation, forKey: Self.animKey)
110 | }
111 |
112 | func stop() -> CGFloat? {
113 | let animation = pop_animation(forKey: Self.animKey) as? POPBasicAnimation
114 | pop_removeAnimation(forKey: Self.animKey)
115 | return animation?.toValue as? CGFloat
116 | }
117 |
118 | // deinit {
119 | // print("AnimationExecutor deinit")
120 | // }
121 | }
122 | }
123 |
124 |
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/JPBlurView/JPBlurView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // JPBlurView.swift
3 | // JPBlurView
4 | //
5 | // Created by 周健平 on 2023/6/4.
6 | //
7 |
8 | import UIKit
9 |
10 | public class JPBlurView: UIView {
11 | private let effect: UIBlurEffect
12 | private let effectView = UIVisualEffectView(effect: nil)
13 | private var animator: UIViewPropertyAnimator!
14 | private var _intensity: CGFloat = 0
15 |
16 | /// 模糊度
17 | public var intensity: CGFloat {
18 | set {
19 | _intensity = (newValue > 1) ? 1 : (newValue < 0 ? 0 : newValue)
20 | animator.fractionComplete = _intensity
21 | }
22 | get { _intensity }
23 | }
24 |
25 | public init(effectStyle: UIBlurEffect.Style, intensity: CGFloat = 1, frame: CGRect = .zero) {
26 | self.effect = UIBlurEffect(style: effectStyle)
27 | super.init(frame: frame)
28 | _intensity = (intensity > 1) ? 1 : (intensity < 0 ? 0 : intensity)
29 | setupEffectView()
30 | resetAnimator()
31 | NotificationCenter.default
32 | .addObserver(self,
33 | selector: #selector(willEnterForegroundHandle),
34 | name: UIApplication.willEnterForegroundNotification,
35 | object: nil)
36 | }
37 |
38 | required init?(coder: NSCoder) {
39 | fatalError("init(coder:) has not been implemented")
40 | }
41 |
42 | deinit {
43 | NotificationCenter.default.removeObserver(self)
44 | // 如果有【没有开启】或【还没结束】的动画,必须在退出页面时让动画结束,否则会崩溃!
45 | animator.stopAnimation(true)
46 | // print("BlurView deinit")
47 | }
48 | }
49 |
50 | // MARK: - 监听通知
51 | private extension JPBlurView {
52 | @objc func willEnterForegroundHandle() {
53 | // App一旦进入后台模式animator就会失效(挂起时不会),返回前台时重新设置一下
54 | guard animator.state != .active else { return }
55 | animator.stopAnimation(true)
56 | resetAnimator()
57 | }
58 | }
59 |
60 | // MARK: - 私有实现
61 | private extension JPBlurView {
62 | func setupEffectView() {
63 | effectView.isUserInteractionEnabled = false
64 | effectView.translatesAutoresizingMaskIntoConstraints = false
65 | addSubview(effectView)
66 | NSLayoutConstraint.activate([
67 | effectView.topAnchor.constraint(equalTo: topAnchor),
68 | effectView.bottomAnchor.constraint(equalTo: bottomAnchor),
69 | effectView.leadingAnchor.constraint(equalTo: leadingAnchor),
70 | effectView.trailingAnchor.constraint(equalTo: trailingAnchor)
71 | ])
72 | }
73 |
74 | func resetAnimator() {
75 | effectView.effect = nil
76 | animator = UIViewPropertyAnimator(duration: 0, curve: .linear, animations: { [weak self] in
77 | self?.effectView.effect = self?.effect
78 | })
79 | animator.fractionComplete = intensity
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/Pictures/girl_1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rogue24/WaterfallLayoutDemo/6b4f6f4575ec3af9b4bd7395463489e311cf74a8/WaterfallLayoutDemo/Pictures/girl_1.jpg
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/Pictures/girl_10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rogue24/WaterfallLayoutDemo/6b4f6f4575ec3af9b4bd7395463489e311cf74a8/WaterfallLayoutDemo/Pictures/girl_10.jpg
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/Pictures/girl_11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rogue24/WaterfallLayoutDemo/6b4f6f4575ec3af9b4bd7395463489e311cf74a8/WaterfallLayoutDemo/Pictures/girl_11.jpg
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/Pictures/girl_12.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rogue24/WaterfallLayoutDemo/6b4f6f4575ec3af9b4bd7395463489e311cf74a8/WaterfallLayoutDemo/Pictures/girl_12.jpg
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/Pictures/girl_13.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rogue24/WaterfallLayoutDemo/6b4f6f4575ec3af9b4bd7395463489e311cf74a8/WaterfallLayoutDemo/Pictures/girl_13.jpg
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/Pictures/girl_14.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rogue24/WaterfallLayoutDemo/6b4f6f4575ec3af9b4bd7395463489e311cf74a8/WaterfallLayoutDemo/Pictures/girl_14.jpg
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/Pictures/girl_15.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rogue24/WaterfallLayoutDemo/6b4f6f4575ec3af9b4bd7395463489e311cf74a8/WaterfallLayoutDemo/Pictures/girl_15.jpg
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/Pictures/girl_16.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rogue24/WaterfallLayoutDemo/6b4f6f4575ec3af9b4bd7395463489e311cf74a8/WaterfallLayoutDemo/Pictures/girl_16.jpg
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/Pictures/girl_2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rogue24/WaterfallLayoutDemo/6b4f6f4575ec3af9b4bd7395463489e311cf74a8/WaterfallLayoutDemo/Pictures/girl_2.jpg
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/Pictures/girl_3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rogue24/WaterfallLayoutDemo/6b4f6f4575ec3af9b4bd7395463489e311cf74a8/WaterfallLayoutDemo/Pictures/girl_3.jpg
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/Pictures/girl_4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rogue24/WaterfallLayoutDemo/6b4f6f4575ec3af9b4bd7395463489e311cf74a8/WaterfallLayoutDemo/Pictures/girl_4.jpg
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/Pictures/girl_5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rogue24/WaterfallLayoutDemo/6b4f6f4575ec3af9b4bd7395463489e311cf74a8/WaterfallLayoutDemo/Pictures/girl_5.jpg
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/Pictures/girl_6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rogue24/WaterfallLayoutDemo/6b4f6f4575ec3af9b4bd7395463489e311cf74a8/WaterfallLayoutDemo/Pictures/girl_6.jpg
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/Pictures/girl_7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rogue24/WaterfallLayoutDemo/6b4f6f4575ec3af9b4bd7395463489e311cf74a8/WaterfallLayoutDemo/Pictures/girl_7.jpg
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/Pictures/girl_8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rogue24/WaterfallLayoutDemo/6b4f6f4575ec3af9b4bd7395463489e311cf74a8/WaterfallLayoutDemo/Pictures/girl_8.jpg
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/Pictures/girl_9.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rogue24/WaterfallLayoutDemo/6b4f6f4575ec3af9b4bd7395463489e311cf74a8/WaterfallLayoutDemo/Pictures/girl_9.jpg
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/SceneDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SceneDelegate.swift
3 | // WaterfallLayoutDemo
4 | //
5 | // Created by aa on 2023/3/5.
6 | //
7 |
8 | import UIKit
9 |
10 | class SceneDelegate: UIResponder, UIWindowSceneDelegate {
11 |
12 | var window: UIWindow?
13 |
14 |
15 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
16 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
17 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
18 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
19 | guard let _ = (scene as? UIWindowScene) else { return }
20 | }
21 |
22 | func sceneDidDisconnect(_ scene: UIScene) {
23 | // Called as the scene is being released by the system.
24 | // This occurs shortly after the scene enters the background, or when its session is discarded.
25 | // Release any resources associated with this scene that can be re-created the next time the scene connects.
26 | // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
27 | }
28 |
29 | func sceneDidBecomeActive(_ scene: UIScene) {
30 | // Called when the scene has moved from an inactive state to an active state.
31 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
32 | }
33 |
34 | func sceneWillResignActive(_ scene: UIScene) {
35 | // Called when the scene will move from an active state to an inactive state.
36 | // This may occur due to temporary interruptions (ex. an incoming phone call).
37 | }
38 |
39 | func sceneWillEnterForeground(_ scene: UIScene) {
40 | // Called as the scene transitions from the background to the foreground.
41 | // Use this method to undo the changes made on entering the background.
42 | }
43 |
44 | func sceneDidEnterBackground(_ scene: UIScene) {
45 | // Called as the scene transitions from the foreground to the background.
46 | // Use this method to save data, release shared resources, and store enough scene-specific state information
47 | // to restore the scene back to its current state.
48 | }
49 |
50 |
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/WaterfallLayoutDemo/WaterfallLayout-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | //
2 | // Use this file to import your target's public headers that you would like to expose to Swift.
3 | //
4 |
5 |
--------------------------------------------------------------------------------