Browse Source

refactored transition animations (#2604)

* refactored transition animations

* unit test fix
yogevbd 6 years ago
parent
commit
ae4f1caa0c
No account linked to committer's email address

+ 2
- 2
lib/ios/RNNAnimator.h View File

@@ -1,10 +1,10 @@
1 1
 #import <Foundation/Foundation.h>
2 2
 #import <UIKit/UIKit.h>
3 3
 #import "RNNElementView.h"
4
+#import "RNNTransitionOptions.h"
4 5
 
5 6
 @interface RNNAnimator : NSObject <UIViewControllerAnimatedTransitioning>
6 7
 
7
--(instancetype)initWithAnimationsDictionary:(NSDictionary *)animationsDic;
8
--(void)setupTransition:(NSDictionary*)data;
8
+-(instancetype)initWithTransitionOptions:(RNNTransitionOptions *)transitionOptions;
9 9
 
10 10
 @end

+ 16
- 39
lib/ios/RNNAnimator.m View File

@@ -9,10 +9,7 @@
9 9
 #import "RNNAnimatedView.h"
10 10
 
11 11
 @interface  RNNAnimator()
12
-@property (nonatomic, strong)NSArray* animations;
13
-@property (nonatomic)double duration;
14
-@property (nonatomic)double springDamping;
15
-@property (nonatomic)double springVelocity;
12
+@property (nonatomic, strong) RNNTransitionOptions* transitionOptions;
16 13
 @property (nonatomic, strong) RNNInteractivePopAnimator* interactivePopAnimator;
17 14
 @property (nonatomic) BOOL backButton;
18 15
 @property (nonatomic, strong) UIViewController* fromVC;
@@ -21,10 +18,10 @@
21 18
 
22 19
 @implementation RNNAnimator
23 20
 
24
-- (instancetype)initWithAnimationsDictionary:(NSDictionary *)animationsDic {
21
+-(instancetype)initWithTransitionOptions:(RNNTransitionOptions *)transitionOptions {
25 22
 	self = [super init];
26
-	if (animationsDic) {
27
-		[self setupTransition:animationsDic];
23
+	if (transitionOptions) {
24
+		[self setupTransition:transitionOptions];
28 25
 	} else {
29 26
 		return nil;
30 27
 	}
@@ -32,37 +29,20 @@
32 29
 	return self;
33 30
 }
34 31
 
35
--(void)setupTransition:(NSDictionary*)data{
36
-	if ([data objectForKey:@"animations"]) {
37
-		self.animations= [data objectForKey:@"animations"];
38
-	} else {
32
+-(void)setupTransition:(RNNTransitionOptions *)transitionOptions {
33
+	self.transitionOptions = transitionOptions;
34
+	if (!transitionOptions.animations) {
39 35
 		[[NSException exceptionWithName:NSInvalidArgumentException reason:@"No animations" userInfo:nil] raise];
40 36
 	}
41
-	if ([data objectForKey:@"duration"]) {
42
-		self.duration = [[data objectForKey:@"duration"] doubleValue];
43
-	} else {
44
-		self.duration = 0.7;
45
-	}
46
-	if ([data objectForKey:@"springDamping"]) {
47
-		self.springDamping = [[data objectForKey:@"springDamping"] doubleValue];
48
-	} else {
49
-		self.springDamping = 0.85;
50
-	}
51
-	if ([data objectForKey:@"springVelocity"]) {
52
-		self.springVelocity= [[data objectForKey:@"springVelocity"] doubleValue];
53
-	} else {
54
-		self.springVelocity = 0.8;
55
-	}
56 37
 	
57 38
 	self.backButton = false;
58 39
 }
59 40
 
60 41
 -(NSArray*)prepareSharedElementTransition:(NSArray*)RNNSharedElementsToVC
61 42
 						andfromVCElements:(NSArray*)RNNSharedElementsFromVC
62
-						withComponentView:(UIView*)componentView
63
-{
43
+						withComponentView:(UIView*)componentView {
64 44
 	NSMutableArray* transitions = [NSMutableArray new];
65
-	for (NSDictionary* transition in self.animations) {
45
+	for (NSDictionary* transition in self.transitionOptions.animations) {
66 46
 		RNNTransitionStateHolder* transitionStateHolder = [[RNNTransitionStateHolder alloc] initWithTransition:transition];
67 47
 		RNNElementFinder* elementFinder = [[RNNElementFinder alloc] initWithToVC:self.toVC andfromVC:self.fromVC];
68 48
 		[elementFinder findElementsInTransition:transitionStateHolder];
@@ -73,7 +53,7 @@
73 53
 		[componentView bringSubviewToFront:animatedView];
74 54
 		transitionStateHolder.animatedView = animatedView;
75 55
 		[transitions addObject:transitionStateHolder];
76
-		if (transitionStateHolder.isSharedElementTransition){
56
+		if (transitionStateHolder.isSharedElementTransition) {
77 57
 			[transitionStateHolder.toElement setHidden: YES];
78 58
 		}
79 59
 		[transitionStateHolder.fromElement setHidden:YES];
@@ -112,7 +92,7 @@
112 92
 
113 93
 
114 94
 -(void)animateComplition:(NSArray*)transitions fromVCSnapshot:(UIView*)fromSnapshot andTransitioningContext:(id<UIViewControllerContextTransitioning>)transitionContext {
115
-	[UIView animateWithDuration:[self transitionDuration:transitionContext ] delay:0 usingSpringWithDamping:self.springDamping initialSpringVelocity:self.springVelocity options:UIViewAnimationOptionCurveEaseOut  animations:^{
95
+	[UIView animateWithDuration:[self transitionDuration:transitionContext] delay:0 usingSpringWithDamping:[self.transitionOptions.springDamping doubleValue] initialSpringVelocity:[self.transitionOptions.springVelocity doubleValue] options:UIViewAnimationOptionCurveEaseOut  animations:^{
116 96
 				self.toVC.view.alpha = 1;
117 97
 			} completion:^(BOOL finished) {
118 98
 				for (RNNTransitionStateHolder* transition in transitions ) {
@@ -139,12 +119,11 @@
139 119
 			}];
140 120
 }
141 121
 
142
-- (NSTimeInterval)transitionDuration:(id <UIViewControllerContextTransitioning>)transitionContext
143
-{
144
-	return self.duration;
122
+- (NSTimeInterval)transitionDuration:(id <UIViewControllerContextTransitioning>)transitionContext {
123
+	return [self.transitionOptions.duration doubleValue];
145 124
 }
146
-- (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext
147
-{
125
+
126
+- (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext {
148 127
 	UIViewController* toVC   = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
149 128
 	UIViewController* fromVC  = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
150 129
 	UIView* componentView = [transitionContext containerView];
@@ -162,7 +141,5 @@
162 141
 	[self animateComplition:transitions fromVCSnapshot:fromSnapshot andTransitioningContext:transitionContext];
163 142
 	[self animateTransitions:transitions];
164 143
 }
165
-@end
166
-
167
-
168 144
 
145
+@end

+ 7
- 4
lib/ios/RNNCommandsHandler.m View File

@@ -77,15 +77,18 @@
77 77
 		[_controllerFactory.eventEmitter sendNavigationEvent:[RNNNavigationEvent create:kPop fromComponent:nil toComponent:componentId]];
78 78
 		completion();
79 79
 	}];
80
+	
80 81
 	NSDictionary* animationData = options[@"customTransition"];
81
-	if (animationData){
82
-		if ([animationData objectForKey:@"animations"]) {
83
-			[_navigationStackManager pop:componentId withAnimationData:animationData];
82
+	RNNTransitionOptions* transitionOptions = [[RNNTransitionOptions alloc] initWithDict:animationData];
83
+	
84
+	if (transitionOptions){
85
+		if (transitionOptions.animations) {
86
+			[_navigationStackManager pop:componentId withTransitionOptions:transitionOptions];
84 87
 		} else {
85 88
 			[[NSException exceptionWithName:NSInvalidArgumentException reason:@"unsupported transitionAnimation" userInfo:nil] raise];
86 89
 		}
87 90
 	} else {
88
-		[_navigationStackManager pop:componentId withAnimationData:nil];
91
+		[_navigationStackManager pop:componentId withTransitionOptions:nil];
89 92
 	}
90 93
 	[CATransaction commit];
91 94
 }

+ 1
- 3
lib/ios/RNNControllerFactory.m View File

@@ -85,12 +85,10 @@
85 85
 
86 86
 - (UIViewController<RNNRootViewProtocol> *)createComponent:(RNNLayoutNode*)node {
87 87
 	NSString* name = node.data[@"name"];
88
-	NSDictionary* customTransition = node.data[@"customTransition"];
89
-	RNNAnimator* animator = [[RNNAnimator alloc] initWithAnimationsDictionary:customTransition];
90 88
 	RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initWithDict:node.data[@"options"]];
91 89
 	options.defaultOptions = _defaultOptions;
92 90
 	NSString* componentId = node.nodeId;
93
-	RNNRootViewController* component = [[RNNRootViewController alloc] initWithName:name withOptions:options withComponentId:componentId rootViewCreator:_creator eventEmitter:_eventEmitter animator:animator];
91
+	RNNRootViewController* component = [[RNNRootViewController alloc] initWithName:name withOptions:options withComponentId:componentId rootViewCreator:_creator eventEmitter:_eventEmitter];
94 92
 	CGSize availableSize = UIApplication.sharedApplication.delegate.window.bounds.size;
95 93
 	[_bridge.uiManager setAvailableSize:availableSize forRootView:component.view];
96 94
 	

+ 2
- 1
lib/ios/RNNNavigationOptions.h View File

@@ -6,6 +6,7 @@
6 6
 #import "RNNTopTabOptions.h"
7 7
 #import "RNNTopTabsOptions.h"
8 8
 #import "RNNOverlayOptions.h"
9
+#import "RNNTransitionOptions.h"
9 10
 
10 11
 extern const NSInteger BLUR_STATUS_TAG;
11 12
 extern const NSInteger BLUR_TOPBAR_TAG;
@@ -20,6 +21,7 @@ extern const NSInteger TOP_BAR_TRANSPARENT_TAG;
20 21
 @property (nonatomic, strong) RNNTopTabOptions* topTab;
21 22
 @property (nonatomic, strong) RNNSideMenuOptions* sideMenu;
22 23
 @property (nonatomic, strong) RNNOverlayOptions* overlay;
24
+@property (nonatomic, strong) RNNTransitionOptions* customTransition;
23 25
 
24 26
 @property (nonatomic, strong) RNNNavigationOptions* defaultOptions;
25 27
 
@@ -35,7 +37,6 @@ extern const NSInteger TOP_BAR_TRANSPARENT_TAG;
35 37
 @property (nonatomic, strong) UIImage* backgroundImage;
36 38
 @property (nonatomic, strong) UIImage* rootBackgroundImage;
37 39
 
38
-
39 40
 - (UIInterfaceOrientationMask)supportedOrientations;
40 41
 
41 42
 

+ 1
- 0
lib/ios/RNNNavigationOptions.m View File

@@ -32,6 +32,7 @@ const NSInteger TOP_BAR_TRANSPARENT_TAG = 78264803;
32 32
 	self.bottomTab = [[RNNBottomTabOptions alloc] initWithDict:[options objectForKey:@"bottomTab"]];
33 33
 	self.overlay = [[RNNOverlayOptions alloc] initWithDict:[options objectForKey:@"overlay"]];
34 34
 	self.animated = [options objectForKey:@"animated"];
35
+	self.customTransition = [[RNNTransitionOptions alloc] initWithDict:[options objectForKey:@"customTransition"]];
35 36
 	
36 37
 	return self;
37 38
 }

+ 1
- 1
lib/ios/RNNNavigationStackManager.h View File

@@ -11,7 +11,7 @@
11 11
 
12 12
 
13 13
 -(void)push:(UIViewController<RNNRootViewProtocol>*)newTop onTop:(NSString*)componentId completion:(RNNTransitionCompletionBlock)completion;
14
--(void)pop:(NSString*)componentId withAnimationData:(NSDictionary*)animationData;
14
+-(void)pop:(NSString*)componentId withTransitionOptions:(RNNTransitionOptions*)transitionOptions;
15 15
 -(void)popTo:(NSString*)componentId;
16 16
 -(void)popToRoot:(NSString*)componentId;
17 17
 

+ 3
- 3
lib/ios/RNNNavigationStackManager.m View File

@@ -60,14 +60,14 @@ dispatch_queue_t RCTGetUIManagerQueue(void);
60 60
 	self.fromVC = nil;
61 61
 }
62 62
 
63
--(void)pop:(NSString *)componentId withAnimationData:(NSDictionary *)animationData {
63
+-(void)pop:(NSString *)componentId withTransitionOptions:(RNNTransitionOptions *)transitionOptions {
64 64
 	UIViewController<RNNRootViewProtocol>* vc = (UIViewController<RNNRootViewProtocol>*)[_store findComponentForId:componentId];
65 65
 	UINavigationController* nvc = [vc navigationController];
66 66
 	if ([nvc topViewController] == vc) {
67
-		if (animationData) {
67
+		if (transitionOptions) {
68 68
 			RNNRootViewController* RNNVC = (RNNRootViewController*)vc;
69 69
 			nvc.delegate = RNNVC;
70
-			[RNNVC.animator setupTransition:animationData];
70
+			RNNVC.animator = [[RNNAnimator alloc] initWithTransitionOptions:transitionOptions];
71 71
 			[nvc popViewControllerAnimated:vc.isAnimated];
72 72
 		} else {
73 73
 			nvc.delegate = nil;

+ 2
- 3
lib/ios/RNNRootViewController.h View File

@@ -12,17 +12,16 @@
12 12
 @interface RNNRootViewController : UIViewController	<RNNRootViewProtocol>
13 13
 
14 14
 @property (nonatomic, strong) RNNNavigationOptions* options;
15
-@property (nonatomic, strong) RNNAnimator* animator;
16 15
 @property (nonatomic, strong) RNNEventEmitter *eventEmitter;
17 16
 @property (nonatomic, strong) NSString* componentId;
18 17
 @property (nonatomic, strong) RNNTopTabsViewController* topTabsViewController;
18
+@property (nonatomic, strong) RNNAnimator* animator;
19 19
 
20 20
 -(instancetype)initWithName:(NSString*)name
21 21
 				withOptions:(RNNNavigationOptions*)options
22 22
 			withComponentId:(NSString*)componentId
23 23
 			rootViewCreator:(id<RNNRootViewCreator>)creator
24
-			   eventEmitter:(RNNEventEmitter*)eventEmitter
25
-		   animator:(RNNAnimator*)animator;
24
+			   eventEmitter:(RNNEventEmitter*)eventEmitter;
26 25
 
27 26
 
28 27
 -(void)applyTabBarItem;

+ 3
- 4
lib/ios/RNNRootViewController.m View File

@@ -15,14 +15,13 @@
15 15
 				withOptions:(RNNNavigationOptions*)options
16 16
 			withComponentId:(NSString*)componentId
17 17
 			rootViewCreator:(id<RNNRootViewCreator>)creator
18
-			   eventEmitter:(RNNEventEmitter*)eventEmitter
19
-				   animator:(RNNAnimator *)animator {
18
+			   eventEmitter:(RNNEventEmitter*)eventEmitter {
20 19
 	self = [super init];
21 20
 	self.componentId = componentId;
22 21
 	self.componentName = name;
23 22
 	self.options = options;
24 23
 	self.eventEmitter = eventEmitter;
25
-	self.animator = animator;
24
+	self.animator = [[RNNAnimator alloc] initWithTransitionOptions:self.options.customTransition];
26 25
 	self.view = [creator createRootView:self.componentName rootViewId:self.componentId];
27 26
 	
28 27
 	[[NSNotificationCenter defaultCenter] addObserver:self
@@ -67,7 +66,7 @@
67 66
 }
68 67
 
69 68
 -(BOOL)isCustomTransitioned {
70
-	return self.animator != nil;
69
+	return self.options.customTransition != nil;
71 70
 }
72 71
 
73 72
 - (BOOL)isAnimated {

+ 10
- 0
lib/ios/RNNTransitionOptions.h View File

@@ -0,0 +1,10 @@
1
+#import "RNNOptions.h"
2
+
3
+@interface RNNTransitionOptions : RNNOptions
4
+
5
+@property (nonatomic, strong) NSArray* animations;
6
+@property (nonatomic, strong) NSNumber* duration;
7
+@property (nonatomic, strong) NSNumber* springDamping;
8
+@property (nonatomic, strong) NSNumber* springVelocity;
9
+
10
+@end

+ 29
- 0
lib/ios/RNNTransitionOptions.m View File

@@ -0,0 +1,29 @@
1
+#import "RNNTransitionOptions.h"
2
+
3
+#define DEFAULT_DURATION @(0.7)
4
+#define DEFAULT_SPRING_VELOCITY @(0.8)
5
+#define DEFAULT_SPRING_DAMPING @(0.85)
6
+
7
+@implementation RNNTransitionOptions
8
+
9
+- (instancetype)initWithDict:(NSDictionary *)dict {
10
+	if (!dict[@"animations"]) {
11
+		return nil;
12
+	}
13
+	
14
+	return [super initWithDict:dict];
15
+}
16
+
17
+- (NSNumber *)duration {
18
+	return _duration ? _duration : DEFAULT_DURATION;
19
+}
20
+
21
+- (NSNumber *)springVelocity {
22
+	return _springVelocity ? _springVelocity : DEFAULT_SPRING_VELOCITY;
23
+}
24
+
25
+- (NSNumber *)springDamping {
26
+	return _springDamping ? _springDamping : DEFAULT_SPRING_DAMPING;
27
+}
28
+
29
+@end

+ 8
- 0
lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj View File

@@ -71,6 +71,8 @@
71 71
 		504AFE751FFFF0540076E904 /* RNNTopTabsOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 504AFE731FFFF0540076E904 /* RNNTopTabsOptions.m */; };
72 72
 		504AFE761FFFF1E00076E904 /* RNNNavigationOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = E83BAD691F27362500A9F3DD /* RNNNavigationOptions.h */; };
73 73
 		504AFE771FFFF1E20076E904 /* RNNTopBarOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = A7626BFE1FC2FB6700492FB8 /* RNNTopBarOptions.h */; };
74
+		507E7D57201DDD3000444E6C /* RNNTransitionOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 507E7D55201DDD3000444E6C /* RNNTransitionOptions.h */; };
75
+		507E7D58201DDD3000444E6C /* RNNTransitionOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 507E7D56201DDD3000444E6C /* RNNTransitionOptions.m */; };
74 76
 		507F43C51FF4F17C00D9425B /* RNNTopTabsViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 507F43C31FF4F17C00D9425B /* RNNTopTabsViewController.h */; };
75 77
 		507F43C61FF4F17C00D9425B /* RNNTopTabsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 507F43C41FF4F17C00D9425B /* RNNTopTabsViewController.m */; };
76 78
 		507F43C91FF4F9CC00D9425B /* RNNTopTabOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 507F43C71FF4F9CC00D9425B /* RNNTopTabOptions.h */; };
@@ -244,6 +246,8 @@
244 246
 		504AFE631FFE53070076E904 /* RNNOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNOptions.m; sourceTree = "<group>"; };
245 247
 		504AFE721FFFF0540076E904 /* RNNTopTabsOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNTopTabsOptions.h; sourceTree = "<group>"; };
246 248
 		504AFE731FFFF0540076E904 /* RNNTopTabsOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNTopTabsOptions.m; sourceTree = "<group>"; };
249
+		507E7D55201DDD3000444E6C /* RNNTransitionOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNTransitionOptions.h; sourceTree = "<group>"; };
250
+		507E7D56201DDD3000444E6C /* RNNTransitionOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNTransitionOptions.m; sourceTree = "<group>"; };
247 251
 		507F43C31FF4F17C00D9425B /* RNNTopTabsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNTopTabsViewController.h; sourceTree = "<group>"; };
248 252
 		507F43C41FF4F17C00D9425B /* RNNTopTabsViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNTopTabsViewController.m; sourceTree = "<group>"; };
249 253
 		507F43C71FF4F9CC00D9425B /* RNNTopTabOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNTopTabOptions.h; sourceTree = "<group>"; };
@@ -469,6 +473,8 @@
469 473
 				50CB3B681FDE911400AA153B /* RNNSideMenuOptions.m */,
470 474
 				50A00C35200F84D6000F01A6 /* RNNOverlayOptions.h */,
471 475
 				50A00C36200F84D6000F01A6 /* RNNOverlayOptions.m */,
476
+				507E7D55201DDD3000444E6C /* RNNTransitionOptions.h */,
477
+				507E7D56201DDD3000444E6C /* RNNTransitionOptions.m */,
472 478
 			);
473 479
 			name = Options;
474 480
 			sourceTree = "<group>";
@@ -723,6 +729,7 @@
723 729
 				E8A5CD621F49114F00E89D0D /* RNNElement.h in Headers */,
724 730
 				504AFE741FFFF0540076E904 /* RNNTopTabsOptions.h in Headers */,
725 731
 				E8E5182E1F83A48B000467AC /* RNNTransitionStateHolder.h in Headers */,
732
+				507E7D57201DDD3000444E6C /* RNNTransitionOptions.h in Headers */,
726 733
 				2DCD9195200014A900EDC75D /* RNNBridgeManager.h in Headers */,
727 734
 				7B1126A91E2D2B6C00F9B03B /* RNNControllerFactory.h in Headers */,
728 735
 				263905D61E4C94970023D7D3 /* RNNSideMenuController.h in Headers */,
@@ -870,6 +877,7 @@
870 877
 				263905BA1E4C6F440023D7D3 /* RCCDrawerController.m in Sources */,
871 878
 				50F5DFC21F407A8C001A00BC /* RNNTabBarController.m in Sources */,
872 879
 				263905BC1E4C6F440023D7D3 /* RCCDrawerHelper.m in Sources */,
880
+				507E7D58201DDD3000444E6C /* RNNTransitionOptions.m in Sources */,
873 881
 				2145452A1F4DC85F006E8DA1 /* RCTHelpers.m in Sources */,
874 882
 				2DCD9196200014A900EDC75D /* RNNBridgeManager.m in Sources */,
875 883
 				263905C11E4C6F440023D7D3 /* SidebarAirbnbAnimation.m in Sources */,

+ 1
- 2
lib/ios/ReactNativeNavigationTests/RNNCommandsHandlerTest.m View File

@@ -68,8 +68,7 @@
68 68
 																withOptions:initialOptions
69 69
 															withComponentId:@"componentId"
70 70
 															rootViewCreator:[[RNNTestRootViewCreator alloc] init]
71
-															   eventEmitter:nil
72
-																   animator:nil];
71
+															   eventEmitter:nil];
73 72
 	RNNNavigationController* nav = [[RNNNavigationController alloc] initWithRootViewController:vc];
74 73
 	[vc viewWillAppear:false];
75 74
 	XCTAssertTrue([vc.navigationItem.title isEqual:@"the title"]);

+ 1
- 1
lib/ios/ReactNativeNavigationTests/RNNNavigationStackManagerTest.m View File

@@ -53,7 +53,7 @@
53 53
 
54 54
 
55 55
 - (void)testPop_removeTopVCFromStore {
56
-	[self.uut pop:@"vc3" withAnimationData:(NSDictionary*)nil];
56
+	[self.uut pop:@"vc3" withTransitionOptions:nil];
57 57
 	XCTAssertNil([self.store findComponentForId:@"vc3"]);
58 58
 	XCTAssertNotNil([self.store findComponentForId:@"vc2"]);
59 59
 	XCTAssertNotNil([self.store findComponentForId:@"vc1"]);

+ 1
- 1
lib/ios/ReactNativeNavigationTests/RNNRootViewControllerTest.m View File

@@ -42,7 +42,7 @@
42 42
 	self.componentId = @"cntId";
43 43
 	self.emitter = nil;
44 44
 	self.options = [RNNNavigationOptions new];
45
-	self.uut = [[RNNRootViewController alloc] initWithName:self.pageName withOptions:self.options withComponentId:self.componentId rootViewCreator:self.creator eventEmitter:self.emitter animator:nil];
45
+	self.uut = [[RNNRootViewController alloc] initWithName:self.pageName withOptions:self.options withComponentId:self.componentId rootViewCreator:self.creator eventEmitter:self.emitter];
46 46
 }
47 47
 
48 48
 -(void)testTopBarBackgroundColor_validColor{

+ 12
- 13
playground/src/screens/CustomTransitionOrigin.js View File

@@ -54,19 +54,18 @@ class CustomTransitionOrigin extends Component {
54 54
     Navigation.push(this.props.componentId, {
55 55
       component: {
56 56
         name: 'navigation.playground.CustomTransitionDestination',
57
-        customTransition: {
58
-          animations: [
59
-            { type: 'sharedElement', fromId: 'title1', toId: 'title2', startDelay: 0, springVelocity: 0.2, duration: 0.5 },
60
-            {
61
-              type: 'sharedElement', fromId: 'image1', toId: 'customDestinationImage', startDelay: 0, springVelocity: 0.9,
62
-              springDamping: 0.9, duration: 0.8, interactivePop: true
63
-            },
64
-            { type: 'sharedElement', fromId: 'image2', toId: 'customDestinationImage2', startDelay: 0, duration: 0.8 },
65
-            { fromId: 'image4', endY: 50, endX: 50, endAlpha: 0, startDelay: 0, duration: 0.8, springVelocity: 0.5 },
66
-            { fromId: 'customDestinationParagraph', startY: 50, startAlpha: 0, endAlpha: 1, startDelay: 0, duration: 0.8 }
67
-
68
-          ],
69
-          duration: 0.8
57
+        options: {
58
+          customTransition: {
59
+            animations: [
60
+              { type: 'sharedElement', fromId: 'title1', toId: 'title2', startDelay: 0, springVelocity: 0.2, duration: 0.5 },
61
+              { type: 'sharedElement', fromId: 'image1', toId: 'customDestinationImage', startDelay: 0, springVelocity: 0.9,
62
+              springDamping: 0.9, duration: 0.8, interactivePop: true },
63
+              { type: 'sharedElement', fromId: 'image2', toId: 'customDestinationImage2', startDelay: 0, duration: 0.8 },
64
+              { fromId: 'image4', endY: 50, endX: 50, endAlpha: 0, startDelay: 0, duration: 0.8, springVelocity: 0.5 },
65
+              { fromId: 'customDestinationParagraph', startY: 50, startAlpha: 0, endAlpha: 1, startDelay: 0, duration: 0.8 }
66
+            ],
67
+            duration: 0.8
68
+          }
70 69
         }
71 70
       }
72 71
     });