@@ -18,7 +18,7 @@ import PromiseKit
18
18
19
19
import PromiseKit
20
20
*/
21
- extension UIView {
21
+ public extension UIView {
22
22
/**
23
23
Animate changes to one or more views using the specified duration, delay,
24
24
options, and completion handler.
@@ -40,11 +40,23 @@ extension UIView {
40
40
- Returns: A promise that fulfills with a boolean NSNumber indicating
41
41
whether or not the animations actually finished.
42
42
*/
43
- public class func animate( _: PMKNamespacer , duration: TimeInterval , delay: TimeInterval = 0 , options: UIViewAnimationOptions = [ ] , animations: @escaping ( ) -> Void ) -> Guarantee < Bool > {
43
+ static func animate( _: PMKNamespacer , duration: TimeInterval , delay: TimeInterval = 0 , options: UIViewAnimationOptions = [ ] , animations: @escaping ( ) -> Void ) -> Guarantee < Bool > {
44
44
return Guarantee ( . pending) { animate ( withDuration: duration, delay: delay, options: options, animations: animations, completion: $0) }
45
45
}
46
46
47
- public class func animate( _: PMKNamespacer , duration: TimeInterval , delay: TimeInterval , usingSpringWithDamping damping: CGFloat , initialSpringVelocity: CGFloat , options: UIViewAnimationOptions = [ ] , animations: @escaping ( ) -> Void ) -> Guarantee < Bool > {
47
+ static func animate( _: PMKNamespacer , duration: TimeInterval , delay: TimeInterval , usingSpringWithDamping damping: CGFloat , initialSpringVelocity: CGFloat , options: UIViewAnimationOptions = [ ] , animations: @escaping ( ) -> Void ) -> Guarantee < Bool > {
48
48
return Guarantee ( . pending) { animate ( withDuration: duration, delay: delay, usingSpringWithDamping: damping, initialSpringVelocity: initialSpringVelocity, options: options, animations: animations, completion: $0) }
49
49
}
50
+
51
+ 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) }
53
+ }
54
+
55
+ 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) }
57
+ }
58
+
59
+ 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) }
61
+ }
50
62
}
0 commit comments