@@ -5,10 +5,21 @@ import UIKit
55
66#if !os(tvOS)
77
8+ public struct AnimationOptions : OptionSet {
9+ public let rawValue : Int
10+
11+ public static let appear = AnimationOptions ( rawValue: 1 << 1 )
12+ public static let disappear = AnimationOptions ( rawValue: 1 << 2 )
13+
14+ public init ( rawValue: Int ) {
15+ self . rawValue = rawValue
16+ }
17+ }
18+
819extension UIViewController {
920#if swift(>=4.2)
1021 /// Presents the UIImagePickerController, resolving with the user action.
11- public func promise( _ vc: UIImagePickerController , animate: PMKAnimationOptions = [ . appear, . disappear] , completion: ( ( ) -> Void ) ? = nil ) -> Promise < [ UIImagePickerController . InfoKey : Any ] > {
22+ public func promise( _ vc: UIImagePickerController , animate: AnimationOptions = [ . appear, . disappear] , completion: ( ( ) -> Void ) ? = nil ) -> Promise < [ UIImagePickerController . InfoKey : Any ] > {
1223 let animated = animate. contains ( . appear)
1324 let proxy = UIImagePickerControllerProxy ( )
1425 vc. delegate = proxy
@@ -19,7 +30,7 @@ extension UIViewController {
1930 }
2031#else
2132 /// Presents the UIImagePickerController, resolving with the user action.
22- public func promise( _ vc: UIImagePickerController , animate: PMKAnimationOptions = [ . appear, . disappear] , completion: ( ( ) -> Void ) ? = nil ) -> Promise < [ String : Any ] > {
33+ public func promise( _ vc: UIImagePickerController , animate: AnimationOptions = [ . appear, . disappear] , completion: ( ( ) -> Void ) ? = nil ) -> Promise < [ String : Any ] > {
2334 let animated = animate. contains ( . appear)
2435 let proxy = UIImagePickerControllerProxy ( )
2536 vc. delegate = proxy
0 commit comments