Support fade in animation for modals on iOS (#186)

Supporting fade in for modals can be done by using `modalTransitionStyle = UIModalTransitionStyleCrossDissolve`. For other type of animations we leave this as the default value.

Tested via `@react-navigation/native-stack` with `{ animation: 'fade', presentation: 'transparentModal' }`
This commit is contained in:
Janic Duplessis
2019-10-21 05:35:52 -04:00
committed by Michał Osadnik
parent 5cfe3f2814
commit b9473ccb04

View File

@@ -121,6 +121,21 @@
_controller.presentationController.delegate = self;
}
- (void)setStackAnimation:(RNSScreenStackAnimation)stackAnimation
{
_stackAnimation = stackAnimation;
switch (stackAnimation) {
case RNSScreenStackAnimationFade:
_controller.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
break;
case RNSScreenStackAnimationNone:
case RNSScreenStackAnimationDefault:
// Default
break;
}
}
- (UIView *)reactSuperview
{
return _reactSuperview;