2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # TheAnimation
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | TheAnimation is Type-safe CAAnimation wrapper.
23 |
24 | 
25 |
26 | ## Introduction
27 |
28 | For example, if you want to animate `backgroundColor` with `CABasicAnimation`, you need to consider type because fromValue property and so on are `Any?`.
29 |
30 | 
31 |
32 | If you use `BasicAnimation of TheAnimation`, you can animate `backgroundColor` without considering type! (`AnimationKeyPaths.backgroundColor` is `AnimationKeyPath` type.)
33 |
34 | 
35 |
36 | ## Usage
37 |
38 | The way of making an animation is almost similar `CAAnimation`.
39 | But you need to use `animation.animate(in:)` method instead of using `layer.add(_:forKey:)`.
40 |
41 | ```swift
42 | let view = UIView()
43 |
44 | let animation = BasicAnimation(keyPath: .opacity)
45 | animation.fromValue = 0
46 | animation.toValue = 1
47 | animation.duration = 1
48 | animation.animate(in: view)
49 | ```
50 |
51 | `animation.animate(in:)` returns `AnimaitonCanceller`. You can cancel an animation with it.
52 |
53 | ```swift
54 | let canceller = animation.animate(in: view)
55 | canceller.cancelAnimation()
56 | ```
57 |
58 | ## Example
59 |
60 | To run the example project, clone the repo, and open Example directory.
61 |
62 | ## Correspondence Table
63 |
64 | | CAAnimation | TheAnimation |
65 | | :-: | :-: |
66 | | CAPropertyAnimation | PropertyAnimation |
67 | | CABasicAnimation | BasicAnimation |
68 | | CAKeyframeAnimation | KeyframeAnimation |
69 | | CASpringAnimation | SpringAnimation |
70 | | CATransition | TransitionAnimation |
71 | | CAAnimationGroup | AnimationGroup |
72 |
73 | ## Add new `AnimationKeyPath`
74 |
75 | You can add `AnimationKeyPath` like this.
76 |
77 | ```swift
78 | extension AnimationKeyPaths {
79 | static let newKeyPath = AnimationKeyPath(keyPath: "abcd")
80 | }
81 | ```
82 |
83 | ## Handle animation did `Start` / `Stop`
84 |
85 | You can handle animation did **Start** with `func setAnimationDidStart(handler:)`.
86 | In addition, you can handle animation did **Stop** with `func setAnimationDidStop(handler:)`.
87 |
88 | ```swift
89 | let view = UIView()
90 |
91 | let animation = BasicAnimation(keyPath: .opacity)
92 | animation.fromValue = 0
93 | animation.toValue = 1
94 | animation.duration = 1
95 |
96 | animation.setAnimationDidStart {
97 | // do something
98 | }
99 |
100 | animation.setAnimationDidStop { finished in
101 | // do something
102 | }
103 |
104 | animation.animate(in: view)
105 | ```
106 |
107 | ## Requirements
108 |
109 | - Xcode 9.3
110 | - iOS 9 or greater
111 | - tvOS 9 or greater
112 | - macOS 10.11 or greater
113 | - Swift 4.2 (since 0.3.0)
114 |
115 | ## Installation
116 |
117 | ### Carthage
118 |
119 | If you’re using [Carthage](https://github.com/Carthage/Carthage), simply add
120 | TheAnimation to your `Cartfile`:
121 |
122 | ```ruby
123 | github "marty-suzuki/TheAnimation"
124 | ```
125 |
126 | ### CocoaPods
127 |
128 | TheAnimation is available through [CocoaPods](https://cocoapods.org). To install
129 | it, simply add the following line to your Podfile:
130 |
131 | ```ruby
132 | pod 'TheAnimation'
133 | ```
134 |
135 | ## Author
136 |
137 | marty-suzuki, s1180183@gmail.com
138 |
139 | ## License
140 |
141 | TheAnimation is available under the MIT license. See the LICENSE file for more info.
142 |
--------------------------------------------------------------------------------
/TheAnimation.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # Be sure to run `pod lib lint TheAnimation.podspec' to ensure this is a
3 | # valid spec before submitting.
4 | #
5 | # Any lines starting with a # are optional, but their use is encouraged
6 | # To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
7 | #
8 |
9 | Pod::Spec.new do |s|
10 | s.name = 'TheAnimation'
11 | s.version = '0.4.0'
12 | s.summary = 'Type safe CAAnimation wrapper.'
13 |
14 | # This description is used to generate tags and improve search results.
15 | # * Think: What does it do? Why did you write it? What is the focus?
16 | # * Try to keep it short, snappy and to the point.
17 | # * Write the description between the DESC delimiters below.
18 | # * Finally, don't worry about the indent, CocoaPods strips it!
19 |
20 | # s.description = <<-DESC
21 | # TODO: Add long description of the pod here.
22 | # DESC
23 |
24 | s.homepage = 'https://github.com/marty-suzuki/TheAnimation'
25 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
26 | s.license = { :type => 'MIT', :file => 'LICENSE' }
27 | s.author = { 'marty-suzuki' => 's1180183@gmail.com' }
28 | s.source = { :git => 'https://github.com/marty-suzuki/TheAnimation.git', :tag => s.version.to_s }
29 | s.social_media_url = 'https://twitter.com/marty_suzuki'
30 |
31 | s.ios.deployment_target = '9.0'
32 | s.osx.deployment_target = '10.11'
33 | s.tvos.deployment_target = '9.0'
34 |
35 | s.source_files = 'TheAnimation/**/*.{swift}'
36 | end
37 |
--------------------------------------------------------------------------------
/TheAnimation.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 07239C2E20B733490016F553 /* Animation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2320B733490016F553 /* Animation.swift */; };
11 | 07239C2F20B733490016F553 /* Animation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2320B733490016F553 /* Animation.swift */; };
12 | 07239C3020B733490016F553 /* Animation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2320B733490016F553 /* Animation.swift */; };
13 | 07239C3120B733490016F553 /* TransitionAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2420B733490016F553 /* TransitionAnimation.swift */; };
14 | 07239C3220B733490016F553 /* TransitionAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2420B733490016F553 /* TransitionAnimation.swift */; };
15 | 07239C3320B733490016F553 /* TransitionAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2420B733490016F553 /* TransitionAnimation.swift */; };
16 | 07239C3420B733490016F553 /* PrimitiveAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2520B733490016F553 /* PrimitiveAnimation.swift */; };
17 | 07239C3520B733490016F553 /* PrimitiveAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2520B733490016F553 /* PrimitiveAnimation.swift */; };
18 | 07239C3620B733490016F553 /* PrimitiveAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2520B733490016F553 /* PrimitiveAnimation.swift */; };
19 | 07239C3720B733490016F553 /* AnyAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2620B733490016F553 /* AnyAnimation.swift */; };
20 | 07239C3820B733490016F553 /* AnyAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2620B733490016F553 /* AnyAnimation.swift */; };
21 | 07239C3920B733490016F553 /* AnyAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2620B733490016F553 /* AnyAnimation.swift */; };
22 | 07239C3A20B733490016F553 /* AnimationGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2720B733490016F553 /* AnimationGroup.swift */; };
23 | 07239C3B20B733490016F553 /* AnimationGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2720B733490016F553 /* AnimationGroup.swift */; };
24 | 07239C3C20B733490016F553 /* AnimationGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2720B733490016F553 /* AnimationGroup.swift */; };
25 | 07239C3D20B733490016F553 /* PropertyAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2820B733490016F553 /* PropertyAnimation.swift */; };
26 | 07239C3E20B733490016F553 /* PropertyAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2820B733490016F553 /* PropertyAnimation.swift */; };
27 | 07239C3F20B733490016F553 /* PropertyAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2820B733490016F553 /* PropertyAnimation.swift */; };
28 | 07239C4020B733490016F553 /* BasicAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2920B733490016F553 /* BasicAnimation.swift */; };
29 | 07239C4120B733490016F553 /* BasicAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2920B733490016F553 /* BasicAnimation.swift */; };
30 | 07239C4220B733490016F553 /* BasicAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2920B733490016F553 /* BasicAnimation.swift */; };
31 | 07239C4320B733490016F553 /* SpringAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2A20B733490016F553 /* SpringAnimation.swift */; };
32 | 07239C4420B733490016F553 /* SpringAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2A20B733490016F553 /* SpringAnimation.swift */; };
33 | 07239C4520B733490016F553 /* SpringAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2A20B733490016F553 /* SpringAnimation.swift */; };
34 | 07239C4620B733490016F553 /* AnimationKeyPaths.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2B20B733490016F553 /* AnimationKeyPaths.swift */; };
35 | 07239C4720B733490016F553 /* AnimationKeyPaths.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2B20B733490016F553 /* AnimationKeyPaths.swift */; };
36 | 07239C4820B733490016F553 /* AnimationKeyPaths.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2B20B733490016F553 /* AnimationKeyPaths.swift */; };
37 | 07239C4920B733490016F553 /* TimingFunction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2C20B733490016F553 /* TimingFunction.swift */; };
38 | 07239C4A20B733490016F553 /* TimingFunction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2C20B733490016F553 /* TimingFunction.swift */; };
39 | 07239C4B20B733490016F553 /* TimingFunction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2C20B733490016F553 /* TimingFunction.swift */; };
40 | 07239C4C20B733490016F553 /* KeyframeAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2D20B733490016F553 /* KeyframeAnimation.swift */; };
41 | 07239C4D20B733490016F553 /* KeyframeAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2D20B733490016F553 /* KeyframeAnimation.swift */; };
42 | 07239C4E20B733490016F553 /* KeyframeAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07239C2D20B733490016F553 /* KeyframeAnimation.swift */; };
43 | 37BD75A220A5D050009219F2 /* TheAnimation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 37BD759820A5D050009219F2 /* TheAnimation.framework */; };
44 | 37BD75A720A5D050009219F2 /* TheAnimationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37BD75A620A5D050009219F2 /* TheAnimationTests.swift */; };
45 | 9D00EA3F20E9F30D00D820FE /* TheAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D00EA3E20E9F30D00D820FE /* TheAnimation.h */; settings = {ATTRIBUTES = (Public, ); }; };
46 | 9D00EA4420E9F31E00D820FE /* TheAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D00EA3E20E9F30D00D820FE /* TheAnimation.h */; settings = {ATTRIBUTES = (Public, ); }; };
47 | 9D00EA4520E9F31F00D820FE /* TheAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D00EA3E20E9F30D00D820FE /* TheAnimation.h */; settings = {ATTRIBUTES = (Public, ); }; };
48 | EDECABFE23D5FD7900B37022 /* CAAnimationDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDECABFD23D5FD7900B37022 /* CAAnimationDelegateProxy.swift */; };
49 | EDECABFF23D5FD7900B37022 /* CAAnimationDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDECABFD23D5FD7900B37022 /* CAAnimationDelegateProxy.swift */; };
50 | EDECAC0023D5FD7900B37022 /* CAAnimationDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDECABFD23D5FD7900B37022 /* CAAnimationDelegateProxy.swift */; };
51 | /* End PBXBuildFile section */
52 |
53 | /* Begin PBXContainerItemProxy section */
54 | 37BD75A320A5D050009219F2 /* PBXContainerItemProxy */ = {
55 | isa = PBXContainerItemProxy;
56 | containerPortal = 37BD758F20A5D050009219F2 /* Project object */;
57 | proxyType = 1;
58 | remoteGlobalIDString = 37BD759720A5D050009219F2;
59 | remoteInfo = TheAnimation;
60 | };
61 | /* End PBXContainerItemProxy section */
62 |
63 | /* Begin PBXFileReference section */
64 | 07239C2320B733490016F553 /* Animation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Animation.swift; sourceTree = ""; };
65 | 07239C2420B733490016F553 /* TransitionAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransitionAnimation.swift; sourceTree = ""; };
66 | 07239C2520B733490016F553 /* PrimitiveAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PrimitiveAnimation.swift; sourceTree = ""; };
67 | 07239C2620B733490016F553 /* AnyAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnyAnimation.swift; sourceTree = ""; };
68 | 07239C2720B733490016F553 /* AnimationGroup.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnimationGroup.swift; sourceTree = ""; };
69 | 07239C2820B733490016F553 /* PropertyAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PropertyAnimation.swift; sourceTree = ""; };
70 | 07239C2920B733490016F553 /* BasicAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BasicAnimation.swift; sourceTree = ""; };
71 | 07239C2A20B733490016F553 /* SpringAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SpringAnimation.swift; sourceTree = ""; };
72 | 07239C2B20B733490016F553 /* AnimationKeyPaths.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnimationKeyPaths.swift; sourceTree = ""; };
73 | 07239C2C20B733490016F553 /* TimingFunction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TimingFunction.swift; sourceTree = ""; };
74 | 07239C2D20B733490016F553 /* KeyframeAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KeyframeAnimation.swift; sourceTree = ""; };
75 | 0746D5C520B5AE6600D21053 /* TheAnimation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TheAnimation.framework; sourceTree = BUILT_PRODUCTS_DIR; };
76 | 07EB622220B5D8C600943B5A /* TheAnimation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TheAnimation.framework; sourceTree = BUILT_PRODUCTS_DIR; };
77 | 37BD759820A5D050009219F2 /* TheAnimation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TheAnimation.framework; sourceTree = BUILT_PRODUCTS_DIR; };
78 | 37BD75A120A5D050009219F2 /* TheAnimationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TheAnimationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
79 | 37BD75A620A5D050009219F2 /* TheAnimationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TheAnimationTests.swift; sourceTree = ""; };
80 | 37BD75A820A5D050009219F2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
81 | 9D00EA3E20E9F30D00D820FE /* TheAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TheAnimation.h; path = TheAnimation/TheAnimation.h; sourceTree = ""; };
82 | 9D00EA4120E9F31900D820FE /* Info-iOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-iOS.plist"; sourceTree = ""; };
83 | 9D00EA4220E9F31900D820FE /* Info-tvOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-tvOS.plist"; sourceTree = ""; };
84 | 9D00EA4320E9F31900D820FE /* Info-macOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-macOS.plist"; sourceTree = ""; };
85 | EDECABFD23D5FD7900B37022 /* CAAnimationDelegateProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CAAnimationDelegateProxy.swift; sourceTree = ""; };
86 | /* End PBXFileReference section */
87 |
88 | /* Begin PBXFrameworksBuildPhase section */
89 | 0746D5C120B5AE6600D21053 /* Frameworks */ = {
90 | isa = PBXFrameworksBuildPhase;
91 | buildActionMask = 2147483647;
92 | files = (
93 | );
94 | runOnlyForDeploymentPostprocessing = 0;
95 | };
96 | 07EB621E20B5D8C600943B5A /* Frameworks */ = {
97 | isa = PBXFrameworksBuildPhase;
98 | buildActionMask = 2147483647;
99 | files = (
100 | );
101 | runOnlyForDeploymentPostprocessing = 0;
102 | };
103 | 37BD759420A5D050009219F2 /* Frameworks */ = {
104 | isa = PBXFrameworksBuildPhase;
105 | buildActionMask = 2147483647;
106 | files = (
107 | );
108 | runOnlyForDeploymentPostprocessing = 0;
109 | };
110 | 37BD759E20A5D050009219F2 /* Frameworks */ = {
111 | isa = PBXFrameworksBuildPhase;
112 | buildActionMask = 2147483647;
113 | files = (
114 | 37BD75A220A5D050009219F2 /* TheAnimation.framework in Frameworks */,
115 | );
116 | runOnlyForDeploymentPostprocessing = 0;
117 | };
118 | /* End PBXFrameworksBuildPhase section */
119 |
120 | /* Begin PBXGroup section */
121 | 07239C2220B733490016F553 /* Source */ = {
122 | isa = PBXGroup;
123 | children = (
124 | EDECABF823D5FA7600B37022 /* Internal */,
125 | 07239C2320B733490016F553 /* Animation.swift */,
126 | 07239C2420B733490016F553 /* TransitionAnimation.swift */,
127 | 07239C2520B733490016F553 /* PrimitiveAnimation.swift */,
128 | 07239C2620B733490016F553 /* AnyAnimation.swift */,
129 | 07239C2720B733490016F553 /* AnimationGroup.swift */,
130 | 07239C2820B733490016F553 /* PropertyAnimation.swift */,
131 | 07239C2920B733490016F553 /* BasicAnimation.swift */,
132 | 07239C2A20B733490016F553 /* SpringAnimation.swift */,
133 | 07239C2B20B733490016F553 /* AnimationKeyPaths.swift */,
134 | 07239C2C20B733490016F553 /* TimingFunction.swift */,
135 | 07239C2D20B733490016F553 /* KeyframeAnimation.swift */,
136 | );
137 | name = Source;
138 | path = TheAnimation/Source;
139 | sourceTree = "";
140 | };
141 | 37BD758E20A5D050009219F2 = {
142 | isa = PBXGroup;
143 | children = (
144 | 9D00EA3E20E9F30D00D820FE /* TheAnimation.h */,
145 | 9D00EA4020E9F31900D820FE /* Resource */,
146 | 07239C2220B733490016F553 /* Source */,
147 | 37BD75A520A5D050009219F2 /* TheAnimationTests */,
148 | 37BD759920A5D050009219F2 /* Products */,
149 | );
150 | sourceTree = "";
151 | };
152 | 37BD759920A5D050009219F2 /* Products */ = {
153 | isa = PBXGroup;
154 | children = (
155 | 37BD759820A5D050009219F2 /* TheAnimation.framework */,
156 | 37BD75A120A5D050009219F2 /* TheAnimationTests.xctest */,
157 | 0746D5C520B5AE6600D21053 /* TheAnimation.framework */,
158 | 07EB622220B5D8C600943B5A /* TheAnimation.framework */,
159 | );
160 | name = Products;
161 | sourceTree = "";
162 | };
163 | 37BD75A520A5D050009219F2 /* TheAnimationTests */ = {
164 | isa = PBXGroup;
165 | children = (
166 | 37BD75A620A5D050009219F2 /* TheAnimationTests.swift */,
167 | 37BD75A820A5D050009219F2 /* Info.plist */,
168 | );
169 | path = TheAnimationTests;
170 | sourceTree = "";
171 | };
172 | 9D00EA4020E9F31900D820FE /* Resource */ = {
173 | isa = PBXGroup;
174 | children = (
175 | 9D00EA4120E9F31900D820FE /* Info-iOS.plist */,
176 | 9D00EA4220E9F31900D820FE /* Info-tvOS.plist */,
177 | 9D00EA4320E9F31900D820FE /* Info-macOS.plist */,
178 | );
179 | name = Resource;
180 | path = TheAnimation/Resource;
181 | sourceTree = "";
182 | };
183 | EDECABF823D5FA7600B37022 /* Internal */ = {
184 | isa = PBXGroup;
185 | children = (
186 | EDECABFD23D5FD7900B37022 /* CAAnimationDelegateProxy.swift */,
187 | );
188 | path = Internal;
189 | sourceTree = "";
190 | };
191 | /* End PBXGroup section */
192 |
193 | /* Begin PBXHeadersBuildPhase section */
194 | 0746D5C220B5AE6600D21053 /* Headers */ = {
195 | isa = PBXHeadersBuildPhase;
196 | buildActionMask = 2147483647;
197 | files = (
198 | 9D00EA4420E9F31E00D820FE /* TheAnimation.h in Headers */,
199 | );
200 | runOnlyForDeploymentPostprocessing = 0;
201 | };
202 | 07EB621F20B5D8C600943B5A /* Headers */ = {
203 | isa = PBXHeadersBuildPhase;
204 | buildActionMask = 2147483647;
205 | files = (
206 | 9D00EA4520E9F31F00D820FE /* TheAnimation.h in Headers */,
207 | );
208 | runOnlyForDeploymentPostprocessing = 0;
209 | };
210 | 37BD759520A5D050009219F2 /* Headers */ = {
211 | isa = PBXHeadersBuildPhase;
212 | buildActionMask = 2147483647;
213 | files = (
214 | 9D00EA3F20E9F30D00D820FE /* TheAnimation.h in Headers */,
215 | );
216 | runOnlyForDeploymentPostprocessing = 0;
217 | };
218 | /* End PBXHeadersBuildPhase section */
219 |
220 | /* Begin PBXNativeTarget section */
221 | 0746D5C420B5AE6600D21053 /* TheAnimation-macOS */ = {
222 | isa = PBXNativeTarget;
223 | buildConfigurationList = 0746D5CA20B5AE6600D21053 /* Build configuration list for PBXNativeTarget "TheAnimation-macOS" */;
224 | buildPhases = (
225 | 0746D5C020B5AE6600D21053 /* Sources */,
226 | 0746D5C120B5AE6600D21053 /* Frameworks */,
227 | 0746D5C220B5AE6600D21053 /* Headers */,
228 | 0746D5C320B5AE6600D21053 /* Resources */,
229 | );
230 | buildRules = (
231 | );
232 | dependencies = (
233 | );
234 | name = "TheAnimation-macOS";
235 | productName = "TheAnimation-macos";
236 | productReference = 0746D5C520B5AE6600D21053 /* TheAnimation.framework */;
237 | productType = "com.apple.product-type.framework";
238 | };
239 | 07EB622120B5D8C600943B5A /* TheAnimation-tvOS */ = {
240 | isa = PBXNativeTarget;
241 | buildConfigurationList = 07EB622920B5D8C600943B5A /* Build configuration list for PBXNativeTarget "TheAnimation-tvOS" */;
242 | buildPhases = (
243 | 07EB621D20B5D8C600943B5A /* Sources */,
244 | 07EB621E20B5D8C600943B5A /* Frameworks */,
245 | 07EB621F20B5D8C600943B5A /* Headers */,
246 | 07EB622020B5D8C600943B5A /* Resources */,
247 | );
248 | buildRules = (
249 | );
250 | dependencies = (
251 | );
252 | name = "TheAnimation-tvOS";
253 | productName = "TheAnimation-tvOS";
254 | productReference = 07EB622220B5D8C600943B5A /* TheAnimation.framework */;
255 | productType = "com.apple.product-type.framework";
256 | };
257 | 37BD759720A5D050009219F2 /* TheAnimation-iOS */ = {
258 | isa = PBXNativeTarget;
259 | buildConfigurationList = 37BD75AC20A5D050009219F2 /* Build configuration list for PBXNativeTarget "TheAnimation-iOS" */;
260 | buildPhases = (
261 | 37BD759320A5D050009219F2 /* Sources */,
262 | 37BD759420A5D050009219F2 /* Frameworks */,
263 | 37BD759520A5D050009219F2 /* Headers */,
264 | 37BD759620A5D050009219F2 /* Resources */,
265 | );
266 | buildRules = (
267 | );
268 | dependencies = (
269 | );
270 | name = "TheAnimation-iOS";
271 | productName = TheAnimation;
272 | productReference = 37BD759820A5D050009219F2 /* TheAnimation.framework */;
273 | productType = "com.apple.product-type.framework";
274 | };
275 | 37BD75A020A5D050009219F2 /* TheAnimationTests */ = {
276 | isa = PBXNativeTarget;
277 | buildConfigurationList = 37BD75AF20A5D050009219F2 /* Build configuration list for PBXNativeTarget "TheAnimationTests" */;
278 | buildPhases = (
279 | 37BD759D20A5D050009219F2 /* Sources */,
280 | 37BD759E20A5D050009219F2 /* Frameworks */,
281 | 37BD759F20A5D050009219F2 /* Resources */,
282 | );
283 | buildRules = (
284 | );
285 | dependencies = (
286 | 37BD75A420A5D050009219F2 /* PBXTargetDependency */,
287 | );
288 | name = TheAnimationTests;
289 | productName = TheAnimationTests;
290 | productReference = 37BD75A120A5D050009219F2 /* TheAnimationTests.xctest */;
291 | productType = "com.apple.product-type.bundle.unit-test";
292 | };
293 | /* End PBXNativeTarget section */
294 |
295 | /* Begin PBXProject section */
296 | 37BD758F20A5D050009219F2 /* Project object */ = {
297 | isa = PBXProject;
298 | attributes = {
299 | LastSwiftUpdateCheck = 0930;
300 | LastUpgradeCheck = 1000;
301 | ORGANIZATIONNAME = "marty-suzuki";
302 | TargetAttributes = {
303 | 0746D5C420B5AE6600D21053 = {
304 | CreatedOnToolsVersion = 9.3.1;
305 | LastSwiftMigration = 0930;
306 | };
307 | 07EB622120B5D8C600943B5A = {
308 | CreatedOnToolsVersion = 9.3.1;
309 | };
310 | 37BD759720A5D050009219F2 = {
311 | CreatedOnToolsVersion = 9.3;
312 | LastSwiftMigration = 1000;
313 | };
314 | 37BD75A020A5D050009219F2 = {
315 | CreatedOnToolsVersion = 9.3;
316 | LastSwiftMigration = 1000;
317 | };
318 | };
319 | };
320 | buildConfigurationList = 37BD759220A5D050009219F2 /* Build configuration list for PBXProject "TheAnimation" */;
321 | compatibilityVersion = "Xcode 9.3";
322 | developmentRegion = en;
323 | hasScannedForEncodings = 0;
324 | knownRegions = (
325 | en,
326 | Base,
327 | );
328 | mainGroup = 37BD758E20A5D050009219F2;
329 | productRefGroup = 37BD759920A5D050009219F2 /* Products */;
330 | projectDirPath = "";
331 | projectRoot = "";
332 | targets = (
333 | 37BD759720A5D050009219F2 /* TheAnimation-iOS */,
334 | 37BD75A020A5D050009219F2 /* TheAnimationTests */,
335 | 0746D5C420B5AE6600D21053 /* TheAnimation-macOS */,
336 | 07EB622120B5D8C600943B5A /* TheAnimation-tvOS */,
337 | );
338 | };
339 | /* End PBXProject section */
340 |
341 | /* Begin PBXResourcesBuildPhase section */
342 | 0746D5C320B5AE6600D21053 /* Resources */ = {
343 | isa = PBXResourcesBuildPhase;
344 | buildActionMask = 2147483647;
345 | files = (
346 | );
347 | runOnlyForDeploymentPostprocessing = 0;
348 | };
349 | 07EB622020B5D8C600943B5A /* Resources */ = {
350 | isa = PBXResourcesBuildPhase;
351 | buildActionMask = 2147483647;
352 | files = (
353 | );
354 | runOnlyForDeploymentPostprocessing = 0;
355 | };
356 | 37BD759620A5D050009219F2 /* Resources */ = {
357 | isa = PBXResourcesBuildPhase;
358 | buildActionMask = 2147483647;
359 | files = (
360 | );
361 | runOnlyForDeploymentPostprocessing = 0;
362 | };
363 | 37BD759F20A5D050009219F2 /* Resources */ = {
364 | isa = PBXResourcesBuildPhase;
365 | buildActionMask = 2147483647;
366 | files = (
367 | );
368 | runOnlyForDeploymentPostprocessing = 0;
369 | };
370 | /* End PBXResourcesBuildPhase section */
371 |
372 | /* Begin PBXSourcesBuildPhase section */
373 | 0746D5C020B5AE6600D21053 /* Sources */ = {
374 | isa = PBXSourcesBuildPhase;
375 | buildActionMask = 2147483647;
376 | files = (
377 | 07239C3520B733490016F553 /* PrimitiveAnimation.swift in Sources */,
378 | 07239C3820B733490016F553 /* AnyAnimation.swift in Sources */,
379 | 07239C4D20B733490016F553 /* KeyframeAnimation.swift in Sources */,
380 | EDECABFF23D5FD7900B37022 /* CAAnimationDelegateProxy.swift in Sources */,
381 | 07239C2F20B733490016F553 /* Animation.swift in Sources */,
382 | 07239C4420B733490016F553 /* SpringAnimation.swift in Sources */,
383 | 07239C3E20B733490016F553 /* PropertyAnimation.swift in Sources */,
384 | 07239C4A20B733490016F553 /* TimingFunction.swift in Sources */,
385 | 07239C3220B733490016F553 /* TransitionAnimation.swift in Sources */,
386 | 07239C3B20B733490016F553 /* AnimationGroup.swift in Sources */,
387 | 07239C4120B733490016F553 /* BasicAnimation.swift in Sources */,
388 | 07239C4720B733490016F553 /* AnimationKeyPaths.swift in Sources */,
389 | );
390 | runOnlyForDeploymentPostprocessing = 0;
391 | };
392 | 07EB621D20B5D8C600943B5A /* Sources */ = {
393 | isa = PBXSourcesBuildPhase;
394 | buildActionMask = 2147483647;
395 | files = (
396 | 07239C3620B733490016F553 /* PrimitiveAnimation.swift in Sources */,
397 | 07239C3920B733490016F553 /* AnyAnimation.swift in Sources */,
398 | 07239C4E20B733490016F553 /* KeyframeAnimation.swift in Sources */,
399 | EDECAC0023D5FD7900B37022 /* CAAnimationDelegateProxy.swift in Sources */,
400 | 07239C3020B733490016F553 /* Animation.swift in Sources */,
401 | 07239C4520B733490016F553 /* SpringAnimation.swift in Sources */,
402 | 07239C3F20B733490016F553 /* PropertyAnimation.swift in Sources */,
403 | 07239C4B20B733490016F553 /* TimingFunction.swift in Sources */,
404 | 07239C3320B733490016F553 /* TransitionAnimation.swift in Sources */,
405 | 07239C3C20B733490016F553 /* AnimationGroup.swift in Sources */,
406 | 07239C4220B733490016F553 /* BasicAnimation.swift in Sources */,
407 | 07239C4820B733490016F553 /* AnimationKeyPaths.swift in Sources */,
408 | );
409 | runOnlyForDeploymentPostprocessing = 0;
410 | };
411 | 37BD759320A5D050009219F2 /* Sources */ = {
412 | isa = PBXSourcesBuildPhase;
413 | buildActionMask = 2147483647;
414 | files = (
415 | 07239C3420B733490016F553 /* PrimitiveAnimation.swift in Sources */,
416 | 07239C3720B733490016F553 /* AnyAnimation.swift in Sources */,
417 | 07239C4C20B733490016F553 /* KeyframeAnimation.swift in Sources */,
418 | EDECABFE23D5FD7900B37022 /* CAAnimationDelegateProxy.swift in Sources */,
419 | 07239C2E20B733490016F553 /* Animation.swift in Sources */,
420 | 07239C4320B733490016F553 /* SpringAnimation.swift in Sources */,
421 | 07239C3D20B733490016F553 /* PropertyAnimation.swift in Sources */,
422 | 07239C4920B733490016F553 /* TimingFunction.swift in Sources */,
423 | 07239C3120B733490016F553 /* TransitionAnimation.swift in Sources */,
424 | 07239C3A20B733490016F553 /* AnimationGroup.swift in Sources */,
425 | 07239C4020B733490016F553 /* BasicAnimation.swift in Sources */,
426 | 07239C4620B733490016F553 /* AnimationKeyPaths.swift in Sources */,
427 | );
428 | runOnlyForDeploymentPostprocessing = 0;
429 | };
430 | 37BD759D20A5D050009219F2 /* Sources */ = {
431 | isa = PBXSourcesBuildPhase;
432 | buildActionMask = 2147483647;
433 | files = (
434 | 37BD75A720A5D050009219F2 /* TheAnimationTests.swift in Sources */,
435 | );
436 | runOnlyForDeploymentPostprocessing = 0;
437 | };
438 | /* End PBXSourcesBuildPhase section */
439 |
440 | /* Begin PBXTargetDependency section */
441 | 37BD75A420A5D050009219F2 /* PBXTargetDependency */ = {
442 | isa = PBXTargetDependency;
443 | target = 37BD759720A5D050009219F2 /* TheAnimation-iOS */;
444 | targetProxy = 37BD75A320A5D050009219F2 /* PBXContainerItemProxy */;
445 | };
446 | /* End PBXTargetDependency section */
447 |
448 | /* Begin XCBuildConfiguration section */
449 | 0746D5CB20B5AE6600D21053 /* Debug */ = {
450 | isa = XCBuildConfiguration;
451 | buildSettings = {
452 | CLANG_ENABLE_MODULES = YES;
453 | CODE_SIGN_IDENTITY = "";
454 | CODE_SIGN_STYLE = Manual;
455 | COMBINE_HIDPI_IMAGES = YES;
456 | DEFINES_MODULE = YES;
457 | DEVELOPMENT_TEAM = "";
458 | DYLIB_COMPATIBILITY_VERSION = 1;
459 | DYLIB_CURRENT_VERSION = 1;
460 | DYLIB_INSTALL_NAME_BASE = "@rpath";
461 | FRAMEWORK_VERSION = A;
462 | INFOPLIST_FILE = "$(SRCROOT)/TheAnimation/Resource/Info-macOS.plist";
463 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
464 | LD_RUNPATH_SEARCH_PATHS = (
465 | "$(inherited)",
466 | "@executable_path/../Frameworks",
467 | "@loader_path/Frameworks",
468 | );
469 | MACOSX_DEPLOYMENT_TARGET = 10.11;
470 | PRODUCT_BUNDLE_IDENTIFIER = "jp.marty-suzuki.TheAnimation";
471 | PRODUCT_NAME = TheAnimation;
472 | PROVISIONING_PROFILE_SPECIFIER = "";
473 | SDKROOT = macosx;
474 | SKIP_INSTALL = YES;
475 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
476 | SWIFT_VERSION = 4.0;
477 | };
478 | name = Debug;
479 | };
480 | 0746D5CC20B5AE6600D21053 /* Release */ = {
481 | isa = XCBuildConfiguration;
482 | buildSettings = {
483 | CLANG_ENABLE_MODULES = YES;
484 | CODE_SIGN_IDENTITY = "";
485 | CODE_SIGN_STYLE = Manual;
486 | COMBINE_HIDPI_IMAGES = YES;
487 | DEFINES_MODULE = YES;
488 | DEVELOPMENT_TEAM = "";
489 | DYLIB_COMPATIBILITY_VERSION = 1;
490 | DYLIB_CURRENT_VERSION = 1;
491 | DYLIB_INSTALL_NAME_BASE = "@rpath";
492 | FRAMEWORK_VERSION = A;
493 | INFOPLIST_FILE = "$(SRCROOT)/TheAnimation/Resource/Info-macOS.plist";
494 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
495 | LD_RUNPATH_SEARCH_PATHS = (
496 | "$(inherited)",
497 | "@executable_path/../Frameworks",
498 | "@loader_path/Frameworks",
499 | );
500 | MACOSX_DEPLOYMENT_TARGET = 10.11;
501 | PRODUCT_BUNDLE_IDENTIFIER = "jp.marty-suzuki.TheAnimation";
502 | PRODUCT_NAME = TheAnimation;
503 | PROVISIONING_PROFILE_SPECIFIER = "";
504 | SDKROOT = macosx;
505 | SKIP_INSTALL = YES;
506 | SWIFT_VERSION = 4.0;
507 | };
508 | name = Release;
509 | };
510 | 07EB622720B5D8C600943B5A /* Debug */ = {
511 | isa = XCBuildConfiguration;
512 | buildSettings = {
513 | CODE_SIGN_IDENTITY = "";
514 | CODE_SIGN_STYLE = Automatic;
515 | DEFINES_MODULE = YES;
516 | DEVELOPMENT_TEAM = "";
517 | DYLIB_COMPATIBILITY_VERSION = 1;
518 | DYLIB_CURRENT_VERSION = 1;
519 | DYLIB_INSTALL_NAME_BASE = "@rpath";
520 | INFOPLIST_FILE = "$(SRCROOT)/TheAnimation/Resource/Info-tvOS.plist";
521 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
522 | LD_RUNPATH_SEARCH_PATHS = (
523 | "$(inherited)",
524 | "@executable_path/Frameworks",
525 | "@loader_path/Frameworks",
526 | );
527 | PRODUCT_BUNDLE_IDENTIFIER = "es.carlosypunto.TheAnimation-tvOS";
528 | PRODUCT_NAME = TheAnimation;
529 | SDKROOT = appletvos;
530 | SKIP_INSTALL = YES;
531 | SWIFT_VERSION = 4.0;
532 | TARGETED_DEVICE_FAMILY = 3;
533 | TVOS_DEPLOYMENT_TARGET = 9.0;
534 | };
535 | name = Debug;
536 | };
537 | 07EB622820B5D8C600943B5A /* Release */ = {
538 | isa = XCBuildConfiguration;
539 | buildSettings = {
540 | CODE_SIGN_IDENTITY = "";
541 | CODE_SIGN_STYLE = Automatic;
542 | DEFINES_MODULE = YES;
543 | DEVELOPMENT_TEAM = "";
544 | DYLIB_COMPATIBILITY_VERSION = 1;
545 | DYLIB_CURRENT_VERSION = 1;
546 | DYLIB_INSTALL_NAME_BASE = "@rpath";
547 | INFOPLIST_FILE = "$(SRCROOT)/TheAnimation/Resource/Info-tvOS.plist";
548 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
549 | LD_RUNPATH_SEARCH_PATHS = (
550 | "$(inherited)",
551 | "@executable_path/Frameworks",
552 | "@loader_path/Frameworks",
553 | );
554 | PRODUCT_BUNDLE_IDENTIFIER = "es.carlosypunto.TheAnimation-tvOS";
555 | PRODUCT_NAME = TheAnimation;
556 | SDKROOT = appletvos;
557 | SKIP_INSTALL = YES;
558 | SWIFT_VERSION = 4.0;
559 | TARGETED_DEVICE_FAMILY = 3;
560 | TVOS_DEPLOYMENT_TARGET = 9.0;
561 | };
562 | name = Release;
563 | };
564 | 37BD75AA20A5D050009219F2 /* Debug */ = {
565 | isa = XCBuildConfiguration;
566 | buildSettings = {
567 | ALWAYS_SEARCH_USER_PATHS = NO;
568 | CLANG_ANALYZER_NONNULL = YES;
569 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
570 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
571 | CLANG_CXX_LIBRARY = "libc++";
572 | CLANG_ENABLE_MODULES = YES;
573 | CLANG_ENABLE_OBJC_ARC = YES;
574 | CLANG_ENABLE_OBJC_WEAK = YES;
575 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
576 | CLANG_WARN_BOOL_CONVERSION = YES;
577 | CLANG_WARN_COMMA = YES;
578 | CLANG_WARN_CONSTANT_CONVERSION = YES;
579 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
580 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
581 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
582 | CLANG_WARN_EMPTY_BODY = YES;
583 | CLANG_WARN_ENUM_CONVERSION = YES;
584 | CLANG_WARN_INFINITE_RECURSION = YES;
585 | CLANG_WARN_INT_CONVERSION = YES;
586 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
587 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
588 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
589 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
590 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
591 | CLANG_WARN_STRICT_PROTOTYPES = YES;
592 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
593 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
594 | CLANG_WARN_UNREACHABLE_CODE = YES;
595 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
596 | CODE_SIGN_IDENTITY = "iPhone Developer";
597 | COPY_PHASE_STRIP = NO;
598 | CURRENT_PROJECT_VERSION = 1;
599 | DEBUG_INFORMATION_FORMAT = dwarf;
600 | ENABLE_STRICT_OBJC_MSGSEND = YES;
601 | ENABLE_TESTABILITY = YES;
602 | GCC_C_LANGUAGE_STANDARD = gnu11;
603 | GCC_DYNAMIC_NO_PIC = NO;
604 | GCC_NO_COMMON_BLOCKS = YES;
605 | GCC_OPTIMIZATION_LEVEL = 0;
606 | GCC_PREPROCESSOR_DEFINITIONS = (
607 | "DEBUG=1",
608 | "$(inherited)",
609 | );
610 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
611 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
612 | GCC_WARN_UNDECLARED_SELECTOR = YES;
613 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
614 | GCC_WARN_UNUSED_FUNCTION = YES;
615 | GCC_WARN_UNUSED_VARIABLE = YES;
616 | IPHONEOS_DEPLOYMENT_TARGET = 11.3;
617 | MTL_ENABLE_DEBUG_INFO = YES;
618 | ONLY_ACTIVE_ARCH = YES;
619 | SDKROOT = iphoneos;
620 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
621 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
622 | VERSIONING_SYSTEM = "apple-generic";
623 | VERSION_INFO_PREFIX = "";
624 | };
625 | name = Debug;
626 | };
627 | 37BD75AB20A5D050009219F2 /* Release */ = {
628 | isa = XCBuildConfiguration;
629 | buildSettings = {
630 | ALWAYS_SEARCH_USER_PATHS = NO;
631 | CLANG_ANALYZER_NONNULL = YES;
632 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
633 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
634 | CLANG_CXX_LIBRARY = "libc++";
635 | CLANG_ENABLE_MODULES = YES;
636 | CLANG_ENABLE_OBJC_ARC = YES;
637 | CLANG_ENABLE_OBJC_WEAK = YES;
638 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
639 | CLANG_WARN_BOOL_CONVERSION = YES;
640 | CLANG_WARN_COMMA = YES;
641 | CLANG_WARN_CONSTANT_CONVERSION = YES;
642 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
643 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
644 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
645 | CLANG_WARN_EMPTY_BODY = YES;
646 | CLANG_WARN_ENUM_CONVERSION = YES;
647 | CLANG_WARN_INFINITE_RECURSION = YES;
648 | CLANG_WARN_INT_CONVERSION = YES;
649 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
650 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
651 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
652 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
653 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
654 | CLANG_WARN_STRICT_PROTOTYPES = YES;
655 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
656 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
657 | CLANG_WARN_UNREACHABLE_CODE = YES;
658 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
659 | CODE_SIGN_IDENTITY = "iPhone Developer";
660 | COPY_PHASE_STRIP = NO;
661 | CURRENT_PROJECT_VERSION = 1;
662 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
663 | ENABLE_NS_ASSERTIONS = NO;
664 | ENABLE_STRICT_OBJC_MSGSEND = YES;
665 | GCC_C_LANGUAGE_STANDARD = gnu11;
666 | GCC_NO_COMMON_BLOCKS = YES;
667 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
668 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
669 | GCC_WARN_UNDECLARED_SELECTOR = YES;
670 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
671 | GCC_WARN_UNUSED_FUNCTION = YES;
672 | GCC_WARN_UNUSED_VARIABLE = YES;
673 | IPHONEOS_DEPLOYMENT_TARGET = 11.3;
674 | MTL_ENABLE_DEBUG_INFO = NO;
675 | SDKROOT = iphoneos;
676 | SWIFT_COMPILATION_MODE = wholemodule;
677 | SWIFT_OPTIMIZATION_LEVEL = "-O";
678 | VALIDATE_PRODUCT = YES;
679 | VERSIONING_SYSTEM = "apple-generic";
680 | VERSION_INFO_PREFIX = "";
681 | };
682 | name = Release;
683 | };
684 | 37BD75AD20A5D050009219F2 /* Debug */ = {
685 | isa = XCBuildConfiguration;
686 | buildSettings = {
687 | CLANG_ENABLE_MODULES = YES;
688 | CODE_SIGN_IDENTITY = "";
689 | CODE_SIGN_STYLE = Manual;
690 | DEFINES_MODULE = YES;
691 | DEVELOPMENT_TEAM = "";
692 | DYLIB_COMPATIBILITY_VERSION = 1;
693 | DYLIB_CURRENT_VERSION = 1;
694 | DYLIB_INSTALL_NAME_BASE = "@rpath";
695 | INFOPLIST_FILE = "$(SRCROOT)/TheAnimation/Resource/Info-iOS.plist";
696 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
697 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
698 | LD_RUNPATH_SEARCH_PATHS = (
699 | "$(inherited)",
700 | "@executable_path/Frameworks",
701 | "@loader_path/Frameworks",
702 | );
703 | PRODUCT_BUNDLE_IDENTIFIER = "jp.marty-suzuki.TheAnimation";
704 | PRODUCT_NAME = TheAnimation;
705 | PROVISIONING_PROFILE_SPECIFIER = "";
706 | SKIP_INSTALL = YES;
707 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
708 | SWIFT_VERSION = 4.2;
709 | TARGETED_DEVICE_FAMILY = "1,2";
710 | };
711 | name = Debug;
712 | };
713 | 37BD75AE20A5D050009219F2 /* Release */ = {
714 | isa = XCBuildConfiguration;
715 | buildSettings = {
716 | CLANG_ENABLE_MODULES = YES;
717 | CODE_SIGN_IDENTITY = "";
718 | CODE_SIGN_STYLE = Manual;
719 | DEFINES_MODULE = YES;
720 | DEVELOPMENT_TEAM = "";
721 | DYLIB_COMPATIBILITY_VERSION = 1;
722 | DYLIB_CURRENT_VERSION = 1;
723 | DYLIB_INSTALL_NAME_BASE = "@rpath";
724 | INFOPLIST_FILE = "$(SRCROOT)/TheAnimation/Resource/Info-iOS.plist";
725 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
726 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
727 | LD_RUNPATH_SEARCH_PATHS = (
728 | "$(inherited)",
729 | "@executable_path/Frameworks",
730 | "@loader_path/Frameworks",
731 | );
732 | PRODUCT_BUNDLE_IDENTIFIER = "jp.marty-suzuki.TheAnimation";
733 | PRODUCT_NAME = TheAnimation;
734 | PROVISIONING_PROFILE_SPECIFIER = "";
735 | SKIP_INSTALL = YES;
736 | SWIFT_VERSION = 4.2;
737 | TARGETED_DEVICE_FAMILY = "1,2";
738 | };
739 | name = Release;
740 | };
741 | 37BD75B020A5D050009219F2 /* Debug */ = {
742 | isa = XCBuildConfiguration;
743 | buildSettings = {
744 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
745 | CODE_SIGN_STYLE = Manual;
746 | DEVELOPMENT_TEAM = "";
747 | INFOPLIST_FILE = TheAnimationTests/Info.plist;
748 | LD_RUNPATH_SEARCH_PATHS = (
749 | "$(inherited)",
750 | "@executable_path/Frameworks",
751 | "@loader_path/Frameworks",
752 | );
753 | PRODUCT_BUNDLE_IDENTIFIER = "jp.marty-suzuki.TheAnimationTests";
754 | PRODUCT_NAME = "$(TARGET_NAME)";
755 | PROVISIONING_PROFILE_SPECIFIER = "";
756 | SWIFT_VERSION = 4.2;
757 | TARGETED_DEVICE_FAMILY = "1,2";
758 | };
759 | name = Debug;
760 | };
761 | 37BD75B120A5D050009219F2 /* Release */ = {
762 | isa = XCBuildConfiguration;
763 | buildSettings = {
764 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
765 | CODE_SIGN_STYLE = Manual;
766 | DEVELOPMENT_TEAM = "";
767 | INFOPLIST_FILE = TheAnimationTests/Info.plist;
768 | LD_RUNPATH_SEARCH_PATHS = (
769 | "$(inherited)",
770 | "@executable_path/Frameworks",
771 | "@loader_path/Frameworks",
772 | );
773 | PRODUCT_BUNDLE_IDENTIFIER = "jp.marty-suzuki.TheAnimationTests";
774 | PRODUCT_NAME = "$(TARGET_NAME)";
775 | PROVISIONING_PROFILE_SPECIFIER = "";
776 | SWIFT_VERSION = 4.2;
777 | TARGETED_DEVICE_FAMILY = "1,2";
778 | };
779 | name = Release;
780 | };
781 | /* End XCBuildConfiguration section */
782 |
783 | /* Begin XCConfigurationList section */
784 | 0746D5CA20B5AE6600D21053 /* Build configuration list for PBXNativeTarget "TheAnimation-macOS" */ = {
785 | isa = XCConfigurationList;
786 | buildConfigurations = (
787 | 0746D5CB20B5AE6600D21053 /* Debug */,
788 | 0746D5CC20B5AE6600D21053 /* Release */,
789 | );
790 | defaultConfigurationIsVisible = 0;
791 | defaultConfigurationName = Release;
792 | };
793 | 07EB622920B5D8C600943B5A /* Build configuration list for PBXNativeTarget "TheAnimation-tvOS" */ = {
794 | isa = XCConfigurationList;
795 | buildConfigurations = (
796 | 07EB622720B5D8C600943B5A /* Debug */,
797 | 07EB622820B5D8C600943B5A /* Release */,
798 | );
799 | defaultConfigurationIsVisible = 0;
800 | defaultConfigurationName = Release;
801 | };
802 | 37BD759220A5D050009219F2 /* Build configuration list for PBXProject "TheAnimation" */ = {
803 | isa = XCConfigurationList;
804 | buildConfigurations = (
805 | 37BD75AA20A5D050009219F2 /* Debug */,
806 | 37BD75AB20A5D050009219F2 /* Release */,
807 | );
808 | defaultConfigurationIsVisible = 0;
809 | defaultConfigurationName = Release;
810 | };
811 | 37BD75AC20A5D050009219F2 /* Build configuration list for PBXNativeTarget "TheAnimation-iOS" */ = {
812 | isa = XCConfigurationList;
813 | buildConfigurations = (
814 | 37BD75AD20A5D050009219F2 /* Debug */,
815 | 37BD75AE20A5D050009219F2 /* Release */,
816 | );
817 | defaultConfigurationIsVisible = 0;
818 | defaultConfigurationName = Release;
819 | };
820 | 37BD75AF20A5D050009219F2 /* Build configuration list for PBXNativeTarget "TheAnimationTests" */ = {
821 | isa = XCConfigurationList;
822 | buildConfigurations = (
823 | 37BD75B020A5D050009219F2 /* Debug */,
824 | 37BD75B120A5D050009219F2 /* Release */,
825 | );
826 | defaultConfigurationIsVisible = 0;
827 | defaultConfigurationName = Release;
828 | };
829 | /* End XCConfigurationList section */
830 | };
831 | rootObject = 37BD758F20A5D050009219F2 /* Project object */;
832 | }
833 |
--------------------------------------------------------------------------------
/TheAnimation.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/TheAnimation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/TheAnimation.xcodeproj/xcshareddata/xcschemes/TheAnimation-iOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
49 |
50 |
51 |
52 |
53 |
54 |
64 |
65 |
71 |
72 |
73 |
74 |
75 |
76 |
82 |
83 |
89 |
90 |
91 |
92 |
94 |
95 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/TheAnimation.xcodeproj/xcshareddata/xcschemes/TheAnimation-macOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
70 |
71 |
72 |
73 |
75 |
76 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/TheAnimation.xcodeproj/xcshareddata/xcschemes/TheAnimation-tvOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
70 |
71 |
72 |
73 |
75 |
76 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/TheAnimation/Resource/Info-iOS.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleDisplayName
8 | TheAnimation
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | FMWK
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleVersion
22 | $(CURRENT_PROJECT_VERSION)
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/TheAnimation/Resource/Info-macOS.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(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
19 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 | NSHumanReadableCopyright
22 | Copyright © 2018 marty-suzuki. All rights reserved.
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/TheAnimation/Resource/Info-tvOS.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(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
19 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 | NSPrincipalClass
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/TheAnimation/Source/Animation.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Animation.swift
3 | // TheAnimation
4 | //
5 | // Created by marty-suzuki on 2018/05/12.
6 | // Copyright © 2018年 marty-suzuki. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(watchOS) || os(tvOS)
10 | import UIKit
11 | public typealias View = UIView
12 | #elseif os(OSX)
13 | import AppKit
14 | public typealias View = NSView
15 | #endif
16 | import QuartzCore.CoreAnimation
17 |
18 | public protocol Animation: class {
19 | var animation: CAAnimation { get }
20 | var key: String { get }
21 | }
22 |
23 | extension Animation {
24 | public var timingFunction: TimingFunction? {
25 | set { animation.timingFunction = newValue?.rawValue }
26 | get { return animation.timingFunction.flatMap(TimingFunction.init) }
27 | }
28 |
29 | public var isRemovedOnCompletion: Bool {
30 | set { animation.isRemovedOnCompletion = newValue }
31 | get { return animation.isRemovedOnCompletion }
32 | }
33 |
34 | public var beginTime: TimeInterval {
35 | set { animation.beginTime = newValue }
36 | get { return animation.beginTime }
37 | }
38 |
39 | public var duration: TimeInterval {
40 | set { animation.duration = newValue }
41 | get { return animation.duration }
42 | }
43 |
44 | public var speed: TimeInterval {
45 | set { animation.speed = Float(newValue) }
46 | get { return TimeInterval(animation.speed) }
47 | }
48 |
49 | public var timeOffset: TimeInterval {
50 | set { animation.timeOffset = newValue }
51 | get { return animation.timeOffset }
52 | }
53 |
54 | public var repeatCount: Double {
55 | set { animation.repeatCount = Float(newValue) }
56 | get { return Double(animation.repeatCount) }
57 | }
58 |
59 | public var repeatDuration: TimeInterval {
60 | set { animation.repeatDuration = newValue }
61 | get { return animation.repeatDuration }
62 | }
63 |
64 | public var autoreverses: Bool {
65 | set { animation.autoreverses = newValue }
66 | get { return animation.autoreverses }
67 | }
68 |
69 | public var fillMode: FillMode {
70 | set { animation.fillMode = newValue.rawValue }
71 | get { return FillMode(rawValue: animation.fillMode) }
72 | }
73 |
74 | public static func defaultValue(for keyPath: AnimationKeyPath) -> T? {
75 | return CAAnimation.defaultValue(forKey: keyPath.rawValue) as? T
76 | }
77 |
78 | public func shouldArchiveValue(for keyPath: AnimationKeyPath) -> Bool {
79 | return animation.shouldArchiveValue(forKey: keyPath.rawValue)
80 | }
81 |
82 | public func run(forKey event: String, object anObject: Any, arguments dict: [AnyHashable : Any]?) {
83 | animation.run(forKey: event, object: anObject, arguments: dict)
84 | }
85 |
86 | @discardableResult
87 | public func animate(in layer: CALayer) -> AnimationCanceller {
88 | layer.add(animation, forKey: key)
89 | return AnimationCanceller(layer: layer, key: key)
90 | }
91 |
92 | @discardableResult
93 | public func animate(in view: View) -> AnimationCanceller {
94 | #if os(iOS) || os(watchOS) || os(tvOS)
95 | return animate(in: view.layer)
96 | #elseif os(OSX)
97 | view.wantsLayer = true
98 | if let layer = view.layer {
99 | return animate(in: layer)
100 | } else {
101 | fatalError("view.layer is nil in \(#file)_\(#function)_\(#line)")
102 | }
103 | #endif
104 | }
105 |
106 | public func setAnimationDidStart(handler: (() -> Void)?) {
107 | guard let handler = handler else {
108 | animation.delegateProxy.didStart = nil
109 | return
110 | }
111 |
112 | let t = type(of: animation)
113 | animation.delegateProxy.didStart = { anim in
114 | guard t === type(of: anim) else {
115 | return
116 | }
117 | handler()
118 | }
119 | }
120 |
121 | public func setAnimationDidStop(handler: ((Bool) -> Void)?) {
122 | guard let handler = handler else {
123 | animation.delegateProxy.didStop = nil
124 | return
125 | }
126 |
127 | let t = type(of: animation)
128 | animation.delegateProxy.didStop = { anim, finished in
129 | guard t === type(of: anim) else {
130 | return
131 | }
132 | handler(finished)
133 | }
134 | }
135 | }
136 |
137 | public struct FillMode {
138 |
139 | #if swift(>=4.2)
140 | typealias RawValue = CAMediaTimingFillMode
141 | public static let forwards = FillMode(rawValue: .forwards)
142 | public static let backwards = FillMode(rawValue: .backwards)
143 | public static let both = FillMode(rawValue: .both)
144 | public static let removed = FillMode(rawValue: .removed)
145 | #else
146 | typealias RawValue = String
147 | public static let forwards = FillMode(rawValue: kCAFillModeForwards)
148 | public static let backwards = FillMode(rawValue: kCAFillModeBackwards)
149 | public static let both = FillMode(rawValue: kCAFillModeBoth)
150 | public static let removed = FillMode(rawValue: kCAFillModeRemoved)
151 | #endif
152 |
153 | let rawValue: RawValue
154 | }
155 |
156 | public struct AnimationCanceller {
157 | let layer: CALayer
158 | let key: String
159 |
160 | public func cancelAnimation() {
161 | layer.removeAnimation(forKey: key)
162 | }
163 | }
164 |
--------------------------------------------------------------------------------
/TheAnimation/Source/AnimationGroup.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AnimationGroup.swift
3 | // TheAnimation
4 | //
5 | // Created by marty-suzuki on 2018/05/11.
6 | // Copyright © 2018年 marty-suzuki. All rights reserved.
7 | //
8 |
9 | import QuartzCore.CoreAnimation
10 |
11 | public final class AnimationGroup: Animation {
12 | public let key: String
13 |
14 | public var animation: CAAnimation {
15 | return _animation
16 | }
17 |
18 | public var animations: [Animation] {
19 | set {
20 | keys = newValue.map { $0.key }
21 | _animation.animations = newValue.map { $0.animation }
22 | }
23 | get {
24 | guard let animations = _animation.animations else {
25 | return []
26 | }
27 | return animations.enumerated().map { offset, element in
28 | AnyAnimation(animation: element, key: keys[offset])
29 | }
30 | }
31 | }
32 |
33 | private var keys: [String] = []
34 |
35 | let _animation: CAAnimationGroup
36 |
37 | public init() {
38 | self._animation = CAAnimationGroup()
39 | self.key = "group"
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/TheAnimation/Source/AnimationKeyPaths.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AnimationKeyPaths.swift
3 | // TheAnimation
4 | //
5 | // Created by marty-suzuki on 2018/05/11.
6 | // Copyright © 2018年 marty-suzuki. All rights reserved.
7 | //
8 |
9 | import QuartzCore.CoreAnimation
10 | import CoreImage
11 |
12 | open class AnimationKeyPaths {
13 | fileprivate init() {}
14 | }
15 |
16 | public protocol AnimationValueType {}
17 |
18 | public final class AnimationKeyPath: AnimationKeyPaths {
19 | let rawValue: String
20 |
21 | public init(keyPath: String) {
22 | self.rawValue = keyPath
23 | }
24 | }
25 |
26 | extension Array: AnimationValueType {}
27 | extension Bool: AnimationValueType {}
28 | extension CALayer: AnimationValueType {}
29 | extension CATransform3D: AnimationValueType {}
30 | extension CGColor: AnimationValueType {}
31 | extension CGFloat: AnimationValueType {}
32 | extension CGPath: AnimationValueType {}
33 | extension CGPoint: AnimationValueType {}
34 | extension CGRect: AnimationValueType {}
35 | extension CGSize: AnimationValueType {}
36 | extension CIFilter: AnimationValueType {}
37 |
38 | extension AnimationKeyPaths {
39 | public static let anchorPoint = AnimationKeyPath(keyPath: "anchorPoint")
40 | public static let backgroundColor = AnimationKeyPath(keyPath: "backgroundColor")
41 | public static let borderColor = AnimationKeyPath(keyPath: "borderColor")
42 | public static let borderWidth = AnimationKeyPath(keyPath: "borderWidth")
43 | public static let bounds = AnimationKeyPath(keyPath: "bounds")
44 | public static let contents = AnimationKeyPath<[Any]>(keyPath: "contents")
45 | public static let contentsRect = AnimationKeyPath(keyPath: "contentsRect")
46 | public static let cornerRadius = AnimationKeyPath(keyPath: "cornerRadius")
47 | public static let filters = AnimationKeyPath<[CIFilter]>(keyPath: "filters")
48 | public static let frame = AnimationKeyPath(keyPath: "frame")
49 | public static let hidden = AnimationKeyPath(keyPath: "hidden")
50 | public static let mask = AnimationKeyPath(keyPath: "mask")
51 | public static let masksToBounds = AnimationKeyPath(keyPath: "masksToBounds")
52 | public static let opacity = AnimationKeyPath(keyPath: "opacity")
53 | public static let path = AnimationKeyPath(keyPath: "path")
54 | public static let position = AnimationKeyPath(keyPath: "position")
55 | public static let shadowColor = AnimationKeyPath(keyPath: "shadowColor")
56 | public static let shadowOffset = AnimationKeyPath(keyPath: "shadowOffset")
57 | public static let shadowOpacity = AnimationKeyPath(keyPath: "shadowOpacity")
58 | public static let shadowPath = AnimationKeyPath(keyPath: "shadowPath")
59 | public static let shadowRadius = AnimationKeyPath(keyPath: "shadowRadius")
60 | public static let sublayers = AnimationKeyPath<[CALayer]>(keyPath: "sublayers")
61 | public static let sublayerTransform = AnimationKeyPath(keyPath: "sublayerTransform")
62 | public static let transform = AnimationKeyPath(keyPath: "transform")
63 | public static let zPosition = AnimationKeyPath(keyPath: "zPosition")
64 | }
65 |
66 | extension AnimationKeyPaths {
67 | public static let anchorPointX = AnimationKeyPath(keyPath: "anchorPoint.x")
68 | public static let anchorPointy = AnimationKeyPath(keyPath: "anchorPoint.y")
69 | }
70 |
71 | extension AnimationKeyPaths {
72 | public static let boundsOrigin = AnimationKeyPath(keyPath: "bounds.origin")
73 | public static let boundsOriginX = AnimationKeyPath(keyPath: "bounds.origin.x")
74 | public static let boundsOriginY = AnimationKeyPath(keyPath: "bounds.origin.y")
75 | public static let boundsSize = AnimationKeyPath(keyPath: "bounds.size")
76 | public static let boundsSizeWidth = AnimationKeyPath(keyPath: "bounds.size.width")
77 | public static let boundsSizeHeight = AnimationKeyPath(keyPath: "bounds.size.height")
78 |
79 | }
80 |
81 | extension AnimationKeyPaths {
82 | public static let contentsRectOrigin = AnimationKeyPath(keyPath: "contentsRect.origin")
83 | public static let contentsRectOriginX = AnimationKeyPath(keyPath: "contentsRect.origin.x")
84 | public static let contentsRectOriginY = AnimationKeyPath(keyPath: "contentsRect.origin.y")
85 | public static let contentsRectSize = AnimationKeyPath(keyPath: "contentsRect.size")
86 | public static let contentsRectSizeWidth = AnimationKeyPath(keyPath: "contentsRect.size.width")
87 | public static let contentsRectSizeHeight = AnimationKeyPath(keyPath: "contentsRect.size.height")
88 | }
89 |
90 | extension AnimationKeyPaths {
91 | public static let frameOrigin = AnimationKeyPath(keyPath: "frame.origin")
92 | public static let frameOriginX = AnimationKeyPath(keyPath: "frame.origin.x")
93 | public static let frameOriginY = AnimationKeyPath(keyPath: "frame.origin.y")
94 | public static let frameSize = AnimationKeyPath(keyPath: "frame.size")
95 | public static let frameSizeWidth = AnimationKeyPath(keyPath: "frame.size.width")
96 | public static let frameSizeHeight = AnimationKeyPath(keyPath: "frame.size.height")
97 | }
98 |
99 | extension AnimationKeyPaths {
100 | public static let positionX = AnimationKeyPath(keyPath: "position.x")
101 | public static let positionY = AnimationKeyPath(keyPath: "position.y")
102 | }
103 |
104 | extension AnimationKeyPaths {
105 | public static let shadowOffsetWidth = AnimationKeyPath(keyPath: "shadowOffset.width")
106 | public static let shadowOffsetHeight = AnimationKeyPath(keyPath: "shadowOffset.height")
107 | }
108 |
109 | extension AnimationKeyPaths {
110 | public static let sublayerTransformRotationX = AnimationKeyPath(keyPath: "sublayerTransform.rotation.x")
111 | public static let sublayerTransformRotationY = AnimationKeyPath(keyPath: "sublayerTransform.rotation.y")
112 | public static let sublayerTransformRotationZ = AnimationKeyPath(keyPath: "sublayerTransform.rotation.z")
113 | public static let sublayerTransformScaleX = AnimationKeyPath(keyPath: "sublayerTransform.scale.x")
114 | public static let sublayerTransformScaleY = AnimationKeyPath(keyPath: "sublayerTransform.scale.y")
115 | public static let sublayerTransformScaleZ = AnimationKeyPath(keyPath: "sublayerTransform.scale.z")
116 | public static let sublayerTransformTranslationX = AnimationKeyPath(keyPath: "sublayerTransform.translation.x")
117 | public static let sublayerTransformTranslationY = AnimationKeyPath(keyPath: "sublayerTransform.translation.y")
118 | public static let sublayerTransformTranslationZ = AnimationKeyPath(keyPath: "sublayerTransform.translation.z")
119 | }
120 |
121 | extension AnimationKeyPaths {
122 | public static let transformRotationX = AnimationKeyPath(keyPath: "transform.rotation.x")
123 | public static let transformRotationY = AnimationKeyPath(keyPath: "transform.rotation.y")
124 | public static let transformRotationZ = AnimationKeyPath(keyPath: "transform.rotation.z")
125 | public static let transformScaleX = AnimationKeyPath(keyPath: "transform.scale.x")
126 | public static let transformScaleY = AnimationKeyPath(keyPath: "transform.scale.y")
127 | public static let transformScaleZ = AnimationKeyPath(keyPath: "transform.scale.z")
128 | public static let transformTranslationX = AnimationKeyPath(keyPath: "transform.translation.x")
129 | public static let transformTranslationY = AnimationKeyPath(keyPath: "transform.translation.y")
130 | public static let transformTranslationZ = AnimationKeyPath(keyPath: "transform.translation.z")
131 | }
132 |
--------------------------------------------------------------------------------
/TheAnimation/Source/AnyAnimation.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AnyAnimation.swift
3 | // TheAnimation
4 | //
5 | // Created by marty-suzuki on 2018/05/11.
6 | // Copyright © 2018年 marty-suzuki. All rights reserved.
7 | //
8 |
9 | import QuartzCore.CoreAnimation
10 |
11 | public final class AnyAnimation: Animation {
12 | public let animation: CAAnimation
13 | public let key: String
14 |
15 | init(animation: CAAnimation, key: String) {
16 | self.animation = animation
17 | self.key = key
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/TheAnimation/Source/BasicAnimation.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BasicAnimation.swift
3 | // TheAnimation
4 | //
5 | // Created by marty-suzuki on 2018/05/11.
6 | // Copyright © 2018年 marty-suzuki. All rights reserved.
7 | //
8 |
9 | import QuartzCore.CoreAnimation
10 |
11 | public typealias BasicAnimation = PrimitiveAnimation
12 |
13 | extension PrimitiveAnimation where RawAnimation == CABasicAnimation {
14 | public var fromValue: ValueType? {
15 | set { _animation.fromValue = newValue }
16 | get { return _animation.fromValue as? ValueType }
17 | }
18 |
19 | public var toValue: ValueType? {
20 | set { _animation.toValue = newValue }
21 | get { return _animation.toValue as? ValueType }
22 | }
23 |
24 | public var byValue: ValueType? {
25 | set { _animation.byValue = newValue }
26 | get { return _animation.byValue as? ValueType }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/TheAnimation/Source/Internal/CAAnimationDelegateProxy.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CAAnimationDelegateProxy.swift
3 | // TheAnimation
4 | //
5 | // Created by 鈴木大貴 on 2020/01/21.
6 | // Copyright © 2020 marty-suzuki. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | final class CAAnimationDelegateProxy: NSObject, CAAnimationDelegate {
12 |
13 | var didStart: ((CAAnimation) -> Void)?
14 | var didStop: ((CAAnimation, Bool) -> Void)?
15 |
16 | func animationDidStart(_ anim: CAAnimation) {
17 | didStart?(anim)
18 | }
19 |
20 | func animationDidStop(_ anim: CAAnimation, finished flag: Bool) {
21 | didStop?(anim, flag)
22 | }
23 | }
24 |
25 | private var delegateProxyAssociatedKey: UInt8 = 0
26 |
27 | extension CAAnimation {
28 |
29 | var delegateProxy: CAAnimationDelegateProxy {
30 | if let delegate = objc_getAssociatedObject(self, &delegateProxyAssociatedKey) as? CAAnimationDelegateProxy {
31 | return delegate
32 | } else {
33 | let delegate = CAAnimationDelegateProxy()
34 | objc_setAssociatedObject(self, &delegateProxyAssociatedKey, delegate, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
35 | self.delegate = delegate
36 | return delegate
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/TheAnimation/Source/KeyframeAnimation.swift:
--------------------------------------------------------------------------------
1 | //
2 | // KeyframeAnimation.swift
3 | // TheAnimation
4 | //
5 | // Created by marty-suzuki on 2018/05/11.
6 | // Copyright © 2018年 marty-suzuki. All rights reserved.
7 | //
8 |
9 | import QuartzCore.CoreAnimation
10 |
11 | public typealias KeyframeAnimation = PrimitiveAnimation
12 |
13 | extension PrimitiveAnimation where RawAnimation == CAKeyframeAnimation {
14 | public var values: [ValueType] {
15 | return _animation.values?.compactMap { $0 as? ValueType } ?? []
16 | }
17 |
18 | public var path: CGPath? {
19 | set { _animation.path = newValue }
20 | get { return _animation.path }
21 | }
22 |
23 | public var keyTimes: [TimeInterval] {
24 | return _animation.keyTimes?.map { $0.doubleValue } ?? []
25 | }
26 |
27 | public var timingFunctions: [TimingFunction] {
28 | return _animation.timingFunctions?.compactMap(TimingFunction.init) ?? []
29 | }
30 |
31 | public var calculationMode: CalculationMode {
32 | set { _animation.calculationMode = newValue.rawValue }
33 | get { return CalculationMode(rawValue: _animation.calculationMode) }
34 | }
35 |
36 | public var tensionValues: [CGFloat] {
37 | return _animation.tensionValues?.map { CGFloat($0.doubleValue) } ?? []
38 | }
39 |
40 | public var continuityValues: [CGFloat] {
41 | return _animation.continuityValues?.map { CGFloat($0.doubleValue) } ?? []
42 | }
43 |
44 | public var biasValues: [CGFloat] {
45 | return _animation.biasValues?.map { CGFloat($0.doubleValue) } ?? []
46 | }
47 |
48 | public var rotationMode: RotationMode? {
49 | set { _animation.rotationMode = newValue?.rawValue }
50 | get { return _animation.rotationMode.map(RotationMode.init) }
51 | }
52 |
53 | public func add(value: ValueType,
54 | keyTime: TimeInterval,
55 | timingFunction: TimingFunction = .default,
56 | tensionValue: Double = 0,
57 | continuityValue: Double = 0,
58 | biasValue: Double = 0) {
59 | if let values = _animation.values {
60 | _animation.values = values + [value]
61 | } else {
62 | _animation.values = [value]
63 | }
64 |
65 | if let keyTimes = _animation.keyTimes {
66 | _animation.keyTimes = keyTimes + [NSNumber(value: keyTime)]
67 | } else {
68 | _animation.keyTimes = [NSNumber(value: keyTime)]
69 | }
70 |
71 | if let timingFunctions = _animation.timingFunctions {
72 | _animation.timingFunctions = timingFunctions + [timingFunction.rawValue]
73 | } else {
74 | _animation.timingFunctions = [timingFunction.rawValue]
75 | }
76 |
77 | if let tensionValues = _animation.tensionValues {
78 | _animation.tensionValues = tensionValues + [NSNumber(value: tensionValue)]
79 | } else {
80 | _animation.tensionValues = [NSNumber(value: tensionValue)]
81 | }
82 |
83 | if let continuityValues = _animation.continuityValues {
84 | _animation.continuityValues = continuityValues + [NSNumber(value: continuityValue)]
85 | } else {
86 | _animation.continuityValues = [NSNumber(value: continuityValue)]
87 | }
88 |
89 | if let biasValues = _animation.biasValues {
90 | _animation.biasValues = biasValues + [NSNumber(value: biasValue)]
91 | } else {
92 | _animation.biasValues = [NSNumber(value: biasValue)]
93 | }
94 | }
95 | }
96 |
97 |
98 | public struct CalculationMode {
99 |
100 | #if swift(>=4.2)
101 | typealias RawValue = CAAnimationCalculationMode
102 | public static let linear = CalculationMode(rawValue: .linear)
103 | public static let discrete = CalculationMode(rawValue: .discrete)
104 | public static let paced = CalculationMode(rawValue: .paced)
105 | public static let cubic = CalculationMode(rawValue: .cubic)
106 | public static let cubicPaced = CalculationMode(rawValue: .cubicPaced)
107 | #else
108 | typealias RawValue = String
109 | public static let linear = CalculationMode(rawValue: kCAAnimationLinear)
110 | public static let discrete = CalculationMode(rawValue: kCAAnimationDiscrete)
111 | public static let paced = CalculationMode(rawValue: kCAAnimationPaced)
112 | public static let cubic = CalculationMode(rawValue: kCAAnimationCubic)
113 | public static let cubicPaced = CalculationMode(rawValue: kCAAnimationCubicPaced)
114 | #endif
115 |
116 | let rawValue: RawValue
117 | }
118 |
119 | public struct RotationMode {
120 |
121 | #if swift(>=4.2)
122 | typealias RawValue = CAAnimationRotationMode
123 | public static let auto = RotationMode(rawValue: .rotateAuto)
124 | public static let autoaReverse = RotationMode(rawValue: .rotateAutoReverse)
125 | #else
126 | typealias RawValue = String
127 | public static let auto = RotationMode(rawValue: kCAAnimationRotateAuto)
128 | public static let autoaReverse = RotationMode(rawValue: kCAAnimationRotateAutoReverse)
129 | #endif
130 |
131 | let rawValue: RawValue
132 | }
133 |
--------------------------------------------------------------------------------
/TheAnimation/Source/PrimitiveAnimation.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PrimitiveAnimation.swift
3 | // TheAnimation
4 | //
5 | // Created by marty-suzuki on 2018/05/11.
6 | // Copyright © 2018年 marty-suzuki. All rights reserved.
7 | //
8 |
9 | import QuartzCore.CoreAnimation
10 |
11 | public final class PrimitiveAnimation: Animation {
12 | public var animation: CAAnimation {
13 | return _animation
14 | }
15 |
16 | public let key: String
17 |
18 | let _animation: RawAnimation
19 |
20 | public var keyPath: AnimationKeyPath? {
21 | set { _animation.keyPath = newValue?.rawValue }
22 | get { return _animation.keyPath.map(AnimationKeyPath.init) }
23 | }
24 |
25 | public init(keyPath: AnimationKeyPath) {
26 | self._animation = RawAnimation(keyPath: keyPath.rawValue)
27 | self.key = keyPath.rawValue
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/TheAnimation/Source/PropertyAnimation.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PropertyAnimation.swift
3 | // TheAnimation
4 | //
5 | // Created by marty-suzuki on 2018/05/11.
6 | // Copyright © 2018年 marty-suzuki. All rights reserved.
7 | //
8 |
9 | import QuartzCore.CoreAnimation
10 |
11 | public typealias PropertyAnimation = PrimitiveAnimation
12 |
13 | extension PrimitiveAnimation where RawAnimation: CAPropertyAnimation {
14 | public var isAdditive: Bool {
15 | set { _animation.isAdditive = newValue }
16 | get { return _animation.isAdditive }
17 | }
18 |
19 | public var isCumulative: Bool {
20 | set { _animation.isCumulative = newValue }
21 | get { return _animation.isCumulative }
22 | }
23 |
24 | public var valueFunction: ValueFunction? {
25 | set { _animation.valueFunction = newValue.flatMap { $0.rawValue } }
26 | get { return _animation.valueFunction.flatMap(ValueFunction.init) }
27 | }
28 | }
29 |
30 | public struct ValueFunction {
31 |
32 | #if swift(>=4.2)
33 | typealias RawValue = CAValueFunctionName
34 | public static let rotateX = ValueFunction(name: .rotateX)
35 | public static let rotateY = ValueFunction(name: .rotateY)
36 | public static let rotateZ = ValueFunction(name: .rotateZ)
37 | public static let scale = ValueFunction(name: .scale)
38 | public static let scaleX = ValueFunction(name: .scaleX)
39 | public static let scaleY = ValueFunction(name: .scaleY)
40 | public static let scaleZ = ValueFunction(name: .scaleZ)
41 | public static let translate = ValueFunction(name: .translate)
42 | public static let translateX = ValueFunction(name: .translateX)
43 | public static let translateY = ValueFunction(name: .translateY)
44 | public static let translateZ = ValueFunction(name: .translateZ)
45 | #else
46 | typealias RawValue = String
47 | public static let rotateX = ValueFunction(name: kCAValueFunctionRotateX)
48 | public static let rotateY = ValueFunction(name: kCAValueFunctionRotateY)
49 | public static let rotateZ = ValueFunction(name: kCAValueFunctionRotateZ)
50 | public static let scale = ValueFunction(name: kCAValueFunctionScale)
51 | public static let scaleX = ValueFunction(name: kCAValueFunctionScaleX)
52 | public static let scaleY = ValueFunction(name: kCAValueFunctionScaleY)
53 | public static let scaleZ = ValueFunction(name: kCAValueFunctionScaleZ)
54 | public static let translate = ValueFunction(name: kCAValueFunctionTranslate)
55 | public static let translateX = ValueFunction(name: kCAValueFunctionTranslateX)
56 | public static let translateY = ValueFunction(name: kCAValueFunctionTranslateY)
57 | public static let translateZ = ValueFunction(name: kCAValueFunctionTranslateZ)
58 | #endif
59 |
60 | let rawValue: CAValueFunction?
61 |
62 | init(name: RawValue) {
63 | self.rawValue = CAValueFunction(name: name)
64 | }
65 |
66 | init(_ rawValue: CAValueFunction) {
67 | self.rawValue = rawValue
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/TheAnimation/Source/SpringAnimation.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SpringAnimation.swift
3 | // TheAnimation
4 | //
5 | // Created by marty-suzuki on 2018/05/11.
6 | // Copyright © 2018年 marty-suzuki. All rights reserved.
7 | //
8 |
9 | import QuartzCore.CoreAnimation
10 |
11 | public typealias SpringAnimation = PrimitiveAnimation
12 |
13 | extension PrimitiveAnimation where RawAnimation == CASpringAnimation {
14 | public var mass: CGFloat {
15 | set { _animation.mass = newValue }
16 | get { return _animation.mass }
17 | }
18 |
19 | public var stiffness: CGFloat {
20 | set { _animation.stiffness = newValue }
21 | get { return _animation.stiffness }
22 | }
23 |
24 | public var damping: CGFloat {
25 | set { _animation.damping = newValue }
26 | get { return _animation.damping }
27 | }
28 |
29 | public var initialVelocity: CGFloat {
30 | set { _animation.initialVelocity = newValue }
31 | get { return _animation.initialVelocity }
32 | }
33 |
34 | public var settlingDuration: TimeInterval {
35 | return _animation.settlingDuration
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/TheAnimation/Source/TimingFunction.swift:
--------------------------------------------------------------------------------
1 | //
2 | // TimingFunction.swift
3 | // TheAnimation
4 | //
5 | // Created by marty-suzuki on 2018/05/12.
6 | // Copyright © 2018年 marty-suzuki. All rights reserved.
7 | //
8 |
9 | import QuartzCore.CoreAnimation
10 |
11 | public struct TimingFunction {
12 |
13 | #if swift(>=4.2)
14 | typealias RawValue = CAMediaTimingFunctionName
15 | public static let `default` = TimingFunction(name: .default)
16 | public static let linear = TimingFunction(name: .linear)
17 | public static let easeIn = TimingFunction(name: .easeIn)
18 | public static let easeOut = TimingFunction(name: .easeOut)
19 | public static let easeInEaseOut = TimingFunction(name: .easeInEaseOut)
20 | #else
21 | typealias RawValue = String
22 | public static let `default` = TimingFunction(name: kCAMediaTimingFunctionDefault)
23 | public static let linear = TimingFunction(name: kCAMediaTimingFunctionLinear)
24 | public static let easeIn = TimingFunction(name: kCAMediaTimingFunctionEaseIn)
25 | public static let easeOut = TimingFunction(name: kCAMediaTimingFunctionEaseOut)
26 | public static let easeInEaseOut = TimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
27 | #endif
28 |
29 | let rawValue: CAMediaTimingFunction
30 |
31 | init(name: RawValue) {
32 | self.rawValue = CAMediaTimingFunction(name: name)
33 | }
34 |
35 | init(_ rawValue: CAMediaTimingFunction) {
36 | self.rawValue = rawValue
37 | }
38 |
39 | public init(controlPoints c1x: Float, _ c1y: Float, _ c2x: Float, _ c2y: Float) {
40 | self.rawValue = CAMediaTimingFunction(controlPoints: c1x, c1y, c2x, c2y)
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/TheAnimation/Source/TransitionAnimation.swift:
--------------------------------------------------------------------------------
1 | //
2 | // TransitionAnimation.swift
3 | // TheAnimation
4 | //
5 | // Created by marty-suzuki on 2018/05/11.
6 | // Copyright © 2018年 marty-suzuki. All rights reserved.
7 | //
8 |
9 | import QuartzCore.CoreAnimation
10 |
11 | public final class TransitionAnimation: Animation {
12 | public var animation: CAAnimation {
13 | return _animation
14 | }
15 |
16 | public let key: String
17 |
18 | let _animation: CATransition
19 |
20 | public var type: TransitionType {
21 | set { _animation.type = newValue.rawValue }
22 | get { return TransitionType(rawValue: _animation.type) }
23 | }
24 |
25 | public var subtype: TransitionSubtype? {
26 | set { _animation.subtype = newValue?.rawValue }
27 | get { return _animation.subtype.map(TransitionSubtype.init) }
28 | }
29 |
30 | public var startProgress: TimeInterval {
31 | set { return _animation.startProgress = Float(newValue) }
32 | get { return TimeInterval(_animation.startProgress) }
33 | }
34 |
35 | public var endProgress: TimeInterval {
36 | set { return _animation.endProgress = Float(newValue) }
37 | get { return TimeInterval(_animation.endProgress) }
38 | }
39 |
40 | init() {
41 | self._animation = CATransition()
42 | self.key = "transition"
43 | }
44 | }
45 |
46 | public struct TransitionType {
47 |
48 | #if swift(>=4.2)
49 | typealias RawValue = CATransitionType
50 | public static let fade = TransitionType(rawValue: .fade)
51 | public static let moveIn = TransitionType(rawValue: .moveIn)
52 | public static let push = TransitionType(rawValue: .push)
53 | public static let reveal = TransitionType(rawValue: .reveal)
54 | #else
55 | typealias RawValue = String
56 | public static let fade = TransitionType(rawValue: kCATransitionFade)
57 | public static let moveIn = TransitionType(rawValue: kCATransitionMoveIn)
58 | public static let push = TransitionType(rawValue: kCATransitionPush)
59 | public static let reveal = TransitionType(rawValue: kCATransitionReveal)
60 | #endif
61 |
62 | let rawValue: RawValue
63 | }
64 |
65 | public struct TransitionSubtype {
66 |
67 | #if swift(>=4.2)
68 | typealias RawValue = CATransitionSubtype
69 | public static let right = TransitionSubtype(rawValue: .fromRight)
70 | public static let left = TransitionSubtype(rawValue: .fromLeft)
71 | public static let top = TransitionSubtype(rawValue: .fromTop)
72 | public static let bottom = TransitionSubtype(rawValue: .fromBottom)
73 | #else
74 | typealias RawValue = String
75 | public static let right = TransitionSubtype(rawValue: kCATransitionFromRight)
76 | public static let left = TransitionSubtype(rawValue: kCATransitionFromLeft)
77 | public static let top = TransitionSubtype(rawValue: kCATransitionFromTop)
78 | public static let bottom = TransitionSubtype(rawValue: kCATransitionFromBottom)
79 | #endif
80 |
81 | let rawValue: RawValue
82 | }
83 |
--------------------------------------------------------------------------------
/TheAnimation/TheAnimation.h:
--------------------------------------------------------------------------------
1 | //
2 | // TheAnimation.h
3 | // TheAnimation
4 | //
5 | // Created by marty-suzuki on 2018/05/11.
6 | // Copyright © 2018年 marty-suzuki. All rights reserved.
7 | //
8 |
9 | #import "TargetConditionals.h"
10 |
11 | #if TARGET_OS_OSX
12 | #import
13 | #else
14 | #import
15 | #endif
16 |
17 | //! Project version number for TheAnimation.
18 | FOUNDATION_EXPORT double TheAnimationVersionNumber;
19 |
20 | //! Project version string for TheAnimation.
21 | FOUNDATION_EXPORT const unsigned char TheAnimationVersionString[];
22 |
23 | // In this header, you should import all the public headers of your framework using statements like #import
24 |
25 |
26 |
--------------------------------------------------------------------------------
/TheAnimationTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(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 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/TheAnimationTests/TheAnimationTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // TheAnimationTests.swift
3 | // TheAnimationTests
4 | //
5 | // Created by marty-suzuki on 2018/05/11.
6 | // Copyright © 2018年 marty-suzuki. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | @testable import TheAnimation
11 |
12 | class TheAnimationTests: XCTestCase {
13 |
14 | override func setUp() {
15 | super.setUp()
16 | // Put setup code here. This method is called before the invocation of each test method in the class.
17 | }
18 |
19 | override func tearDown() {
20 | // Put teardown code here. This method is called after the invocation of each test method in the class.
21 | super.tearDown()
22 | }
23 |
24 | func testExample() {
25 | // This is an example of a functional test case.
26 | // Use XCTAssert and related functions to verify your tests produce the correct results.
27 | }
28 |
29 | func testPerformanceExample() {
30 | // This is an example of a performance test case.
31 | self.measure {
32 | // Put the code you want to measure the time of here.
33 | }
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------