File tree 3 files changed +11
-11
lines changed
3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ extension UIViewController {
30
30
if let img = info [ UIImagePickerControllerOriginalImage] as? UIImage {
31
31
return img
32
32
}
33
- throw Error . noImageFound
33
+ throw PMKError . noImageFound
34
34
} . always {
35
35
vc. presentingViewController? . dismiss ( animated: animated, completion: nil )
36
36
}
@@ -63,14 +63,14 @@ extension UIViewController {
63
63
}
64
64
65
65
func imagePickerControllerDidCancel( _ picker: UIImagePickerController ) {
66
- reject ( UIImagePickerController . Error . cancelled)
66
+ reject ( UIImagePickerController . PMKError . cancelled)
67
67
retainCycle = nil
68
68
}
69
69
}
70
70
71
71
extension UIImagePickerController {
72
72
/// Errors representing PromiseKit UIImagePickerController failures
73
- public enum Error : CancellableError {
73
+ public enum PMKError : CancellableError {
74
74
/// The user cancelled the UIImagePickerController.
75
75
case cancelled
76
76
/// - Returns: true
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ import PromiseKit
21
21
*/
22
22
extension UIViewController {
23
23
24
- public enum Error : Swift . Error {
24
+ public enum PMKError : Error {
25
25
case navigationControllerEmpty
26
26
case noImageFound
27
27
case notPromisable
@@ -43,7 +43,7 @@ extension UIViewController {
43
43
44
44
switch vc {
45
45
case let nc as UINavigationController :
46
- guard let vc = nc. viewControllers. first else { return Promise ( error: Error . navigationControllerEmpty) }
46
+ guard let vc = nc. viewControllers. first else { return Promise ( error: PMKError . navigationControllerEmpty) }
47
47
pvc = vc
48
48
default :
49
49
pvc = vc
@@ -52,13 +52,13 @@ extension UIViewController {
52
52
let promise : Promise < T >
53
53
54
54
if !( pvc is Promisable ) {
55
- promise = Promise ( error: Error . notPromisable)
55
+ promise = Promise ( error: PMKError . notPromisable)
56
56
} else if let p = pvc. value ( forKeyPath: " promise " ) as? Promise < T > {
57
57
promise = p
58
58
} else if let _ = pvc. value ( forKeyPath: " promise " ) {
59
- promise = Promise ( error: Error . notGenericallyPromisable)
59
+ promise = Promise ( error: PMKError . notGenericallyPromisable)
60
60
} else {
61
- promise = Promise ( error: Error . nilPromisable)
61
+ promise = Promise ( error: PMKError . nilPromisable)
62
62
}
63
63
64
64
if !promise. isPending {
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ class UIViewControllerTests: XCTestCase {
12
12
let ex = expectation ( description: " " )
13
13
let p : Promise < Int > = rootvc. promise ( UIViewController ( ) , animate: [ ] )
14
14
p. catch { error in
15
- if case UIViewController . Error . notPromisable = error {
15
+ if case UIViewController . PMKError . notPromisable = error {
16
16
ex. fulfill ( )
17
17
}
18
18
}
@@ -23,7 +23,7 @@ class UIViewControllerTests: XCTestCase {
23
23
let ex = expectation ( description: " " )
24
24
let p : Promise < Int > = rootvc. promise ( MockViewController ( ) , animate: [ ] )
25
25
p. catch { error in
26
- if case UIViewController . Error . nilPromisable = error {
26
+ if case UIViewController . PMKError . nilPromisable = error {
27
27
ex. fulfill ( )
28
28
}
29
29
}
@@ -36,7 +36,7 @@ class UIViewControllerTests: XCTestCase {
36
36
my. promise = Promise ( value: true )
37
37
let p : Promise < Int > = rootvc. promise ( my, animate: [ ] )
38
38
p. catch { err in
39
- if case UIViewController . Error . notGenericallyPromisable = err {
39
+ if case UIViewController . PMKError . notGenericallyPromisable = err {
40
40
ex. fulfill ( )
41
41
}
42
42
}
You can’t perform that action at this time.
0 commit comments