Skip to content

Commit 4b92fa0

Browse files
committed
Update to PMK6
Fix compilation of UIViewPropertyAnimator extension. It needs iOS 10. Delete PMKAlertController; this was an ill-advised addition. Instead we recommend not using promises or using the standard Promise initializer specializing the promise for each individual circumstance.
1 parent c1130ac commit 4b92fa0

File tree

6 files changed

+15
-104
lines changed

6 files changed

+15
-104
lines changed

Cartfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "mxcl/PromiseKit" ~> 5.0
1+
github "mxcl/PromiseKit" ~> 6.0

Cartfile.resolved

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "mxcl/PromiseKit" "5.0.3"
1+
github "mxcl/PromiseKit" "6.0.0"

PMKUIKit.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/* Begin PBXBuildFile section */
1010
6304D6FE1D5F986A00CE6C99 /* PMKUIKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 6304D6FD1D5F986A00CE6C99 /* PMKUIKit.h */; settings = {ATTRIBUTES = (Public, ); }; };
1111
630B2E161D5D0B3200DC10E9 /* TestUIImagePickerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 630B2DF71D5D0AD400DC10E9 /* TestUIImagePickerController.swift */; };
12+
632B573520324C4C00FCD5E1 /* UIViewPropertyAnimator+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 632B573420324C4C00FCD5E1 /* UIViewPropertyAnimator+Promise.swift */; };
1213
6332142B1D83CD17009F67CE /* TestUIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6332142A1D83CD17009F67CE /* TestUIView.swift */; };
1314
637E2C841D5C2E0B0043E370 /* UIView+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 637E2C771D5C2E0B0043E370 /* UIView+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; };
1415
637E2C851D5C2E0B0043E370 /* UIView+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 637E2C781D5C2E0B0043E370 /* UIView+AnyPromise.m */; };
@@ -77,6 +78,7 @@
7778
630B2DF51D5D0AD400DC10E9 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "[email protected]"; path = "UITests/[email protected]"; sourceTree = "<group>"; };
7879
630B2DF71D5D0AD400DC10E9 /* TestUIImagePickerController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestUIImagePickerController.swift; path = UITests/TestUIImagePickerController.swift; sourceTree = "<group>"; };
7980
630B2E131D5D0AF500DC10E9 /* PMKUIUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKUIUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
81+
632B573420324C4C00FCD5E1 /* UIViewPropertyAnimator+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewPropertyAnimator+Promise.swift"; sourceTree = "<group>"; };
8082
6332142A1D83CD17009F67CE /* TestUIView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestUIView.swift; path = Tests/TestUIView.swift; sourceTree = SOURCE_ROOT; };
8183
637E2C771D5C2E0B0043E370 /* UIView+AnyPromise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIView+AnyPromise.h"; path = "Sources/UIView+AnyPromise.h"; sourceTree = SOURCE_ROOT; };
8284
637E2C781D5C2E0B0043E370 /* UIView+AnyPromise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIView+AnyPromise.m"; path = "Sources/UIView+AnyPromise.m"; sourceTree = SOURCE_ROOT; };
@@ -173,6 +175,7 @@
173175
637E2C7A1D5C2E0B0043E370 /* UIViewController+AnyPromise.h */,
174176
637E2C7B1D5C2E0B0043E370 /* UIViewController+AnyPromise.m */,
175177
63A6867E1D88E93300D1C66B /* UIImagePickerController+Promise.swift */,
178+
632B573420324C4C00FCD5E1 /* UIViewPropertyAnimator+Promise.swift */,
176179
);
177180
path = Sources;
178181
sourceTree = SOURCE_ROOT;
@@ -390,6 +393,7 @@
390393
63A686811D88E93300D1C66B /* UIImagePickerController+Promise.swift in Sources */,
391394
637E2C861D5C2E0B0043E370 /* UIView+Promise.swift in Sources */,
392395
637E2C851D5C2E0B0043E370 /* UIView+AnyPromise.m in Sources */,
396+
632B573520324C4C00FCD5E1 /* UIViewPropertyAnimator+Promise.swift in Sources */,
393397
637E2C881D5C2E0B0043E370 /* UIViewController+AnyPromise.m in Sources */,
394398
);
395399
runOnlyForDeploymentPostprocessing = 0;

Sources/PMKAlertController.swift

Lines changed: 0 additions & 96 deletions
This file was deleted.

Sources/UIView+Promise.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,22 @@ public extension UIView {
4141
whether or not the animations actually finished.
4242
*/
4343
static func animate(_: PMKNamespacer, duration: TimeInterval, delay: TimeInterval = 0, options: UIViewAnimationOptions = [], animations: @escaping () -> Void) -> Guarantee<Bool> {
44-
return Guarantee(.pending) { animate(withDuration: duration, delay: delay, options: options, animations: animations, completion: $0) }
44+
return Guarantee { animate(withDuration: duration, delay: delay, options: options, animations: animations, completion: $0) }
4545
}
4646

4747
static func animate(_: PMKNamespacer, duration: TimeInterval, delay: TimeInterval, usingSpringWithDamping damping: CGFloat, initialSpringVelocity: CGFloat, options: UIViewAnimationOptions = [], animations: @escaping () -> Void) -> Guarantee<Bool> {
48-
return Guarantee(.pending) { animate(withDuration: duration, delay: delay, usingSpringWithDamping: damping, initialSpringVelocity: initialSpringVelocity, options: options, animations: animations, completion: $0) }
48+
return Guarantee { animate(withDuration: duration, delay: delay, usingSpringWithDamping: damping, initialSpringVelocity: initialSpringVelocity, options: options, animations: animations, completion: $0) }
4949
}
5050

5151
static func transition(_: PMKNamespacer, with view: UIView, duration: TimeInterval, options: UIViewAnimationOptions = [], animations: (() -> Void)?) -> Guarantee<Bool> {
52-
return Guarantee(.pending) { transition(with: view, duration: duration, options: options, animations: animations, completion: $0) }
52+
return Guarantee { transition(with: view, duration: duration, options: options, animations: animations, completion: $0) }
5353
}
5454

5555
static func transition(_: PMKNamespacer, from: UIView, to: UIView, duration: TimeInterval, options: UIViewAnimationOptions = []) -> Guarantee<Bool> {
56-
return Guarantee(.pending) { transition(from: from, to: to, duration: duration, options: options, completion: $0) }
56+
return Guarantee { transition(from: from, to: to, duration: duration, options: options, completion: $0) }
5757
}
5858

5959
static func perform(_: PMKNamespacer, animation: UISystemAnimation, on views: [UIView], options: UIViewAnimationOptions = [], animations: (() -> Void)?) -> Guarantee<Bool> {
60-
return Guarantee(.pending) { perform(animation, on: views, options: options, animations: animations, completion: $0) }
60+
return Guarantee { perform(animation, on: views, options: options, animations: animations, completion: $0) }
6161
}
6262
}

Sources/UIViewPropertyAnimator+Promise.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
#if !PMKCocoaPods
12
import PromiseKit
3+
#endif
24
import UIKit
35

6+
@available(iOS 10, tvOS 10, *)
47
public extension UIViewPropertyAnimator {
58
func startAnimation(_: PMKNamespacer) -> Guarantee<UIViewAnimatingPosition> {
6-
return Guarantee(.pending) {
9+
return Guarantee {
710
addCompletion($0)
811
startAnimation()
912
}

0 commit comments

Comments
 (0)