9
9
10
10
@implementation NativeTransitions
11
11
12
- - (void ) right : (CDVInvokedUrlCommand*)command ;
12
+ - (void ) flip : (CDVInvokedUrlCommand*)command ;
13
13
{
14
14
NSMutableDictionary *args = [command.arguments objectAtIndex: 0 ];
15
15
double duration = [[args objectForKey: @" duration" ] doubleValue ];
16
+ NSString *direction = [[args objectForKey: @" direction" ] stringValue ];
17
+
18
+ NSUInteger animation = UIViewAnimationOptionTransitionFlipFromLeft;
19
+
20
+ if ([direction isEqualToString: @" right" ])
21
+ {
22
+ animation = UIViewAnimationOptionTransitionFlipFromRight;
23
+ }
16
24
17
25
[UIView transitionWithView: self .viewController.view
18
26
duration: duration
19
27
options: UIViewAnimationOptionAllowAnimatedContent
20
- |UIViewAnimationOptionTransitionFlipFromLeft
28
+ |animation
21
29
animations: ^{}
22
- completion: ^(BOOL finished) {}];
30
+ completion: ^(BOOL finished) {
31
+ CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK];
32
+ [self .commandDelegate sendPluginResult: pluginResult callbackId: command.callbackId];
33
+ }];
23
34
}
24
35
25
- - (void ) left : (CDVInvokedUrlCommand*)command ;
36
+ - (void ) curl : (CDVInvokedUrlCommand*)command ;
26
37
{
27
38
NSMutableDictionary *args = [command.arguments objectAtIndex: 0 ];
28
39
double duration = [[args objectForKey: @" duration" ] doubleValue ];
40
+ NSString *direction = [[args objectForKey: @" direction" ] stringValue ];
41
+
42
+ NSUInteger animation = UIViewAnimationOptionTransitionCurlUp;
43
+
44
+ if ([direction isEqualToString: @" down" ])
45
+ {
46
+ animation = UIViewAnimationOptionTransitionCurlDown;
47
+ }
29
48
30
49
[UIView transitionWithView: self .viewController.view
31
50
duration: duration
32
51
options: UIViewAnimationOptionAllowAnimatedContent
33
- |UIViewAnimationOptionTransitionFlipFromRight
52
+ |animation
34
53
animations: ^{}
35
- completion: ^(BOOL finished) {}];
54
+ completion: ^(BOOL finished) {
55
+ CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK];
56
+ [self .commandDelegate sendPluginResult: pluginResult callbackId: command.callbackId];
57
+ }];
36
58
}
37
59
38
60
- (void ) fade : (CDVInvokedUrlCommand*)command ;
@@ -45,7 +67,10 @@ - (void) fade:(CDVInvokedUrlCommand*)command;
45
67
options: UIViewAnimationOptionAllowAnimatedContent
46
68
|UIViewAnimationOptionTransitionCrossDissolve
47
69
animations: ^{}
48
- completion: ^(BOOL finished) {}];
70
+ completion: ^(BOOL finished) {
71
+ CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK];
72
+ [self .commandDelegate sendPluginResult: pluginResult callbackId: command.callbackId];
73
+ }];
49
74
}
50
75
51
76
@end
0 commit comments