mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-26 13:35:32 +08:00
On iOS by default modals show up in full-screen mode. This behavior can be customized and instead of mouting new screens in top level window they can be mounted under a given UINavController. We used to be relying on that behavior (see "CurrentContext" presentation mode). This, apparently wasn't matching the default functionality of the OS. This change is adding it as a default and keeping the old way under newly exposed presentation modes: containedModal and containedTransparentModal Thanks to this change, iOS 13 modals can work properly.
48 lines
1.3 KiB
Objective-C
48 lines
1.3 KiB
Objective-C
#import <React/RCTViewManager.h>
|
|
#import <React/RCTView.h>
|
|
#import <React/RCTComponent.h>
|
|
#import "RNSScreenContainer.h"
|
|
|
|
@class RNSScreenContainerView;
|
|
|
|
typedef NS_ENUM(NSInteger, RNSScreenStackPresentation) {
|
|
RNSScreenStackPresentationPush,
|
|
RNSScreenStackPresentationModal,
|
|
RNSScreenStackPresentationTransparentModal,
|
|
RNSScreenStackPresentationContainedModal,
|
|
RNSScreenStackPresentationContainedTransparentModal
|
|
};
|
|
|
|
typedef NS_ENUM(NSInteger, RNSScreenStackAnimation) {
|
|
RNSScreenStackAnimationDefault,
|
|
RNSScreenStackAnimationNone,
|
|
RNSScreenStackAnimationFade,
|
|
};
|
|
|
|
@interface RCTConvert (RNSScreen)
|
|
|
|
+ (RNSScreenStackPresentation)RNSScreenStackPresentation:(id)json;
|
|
+ (RNSScreenStackAnimation)RNSScreenStackAnimation:(id)json;
|
|
|
|
@end
|
|
|
|
@interface RNSScreenManager : RCTViewManager
|
|
@end
|
|
|
|
@interface RNSScreenView : RCTView
|
|
|
|
@property (nonatomic, copy) RCTDirectEventBlock onDismissed;
|
|
@property (weak, nonatomic) UIView<RNSScreenContainerDelegate> *reactSuperview;
|
|
@property (nonatomic, retain) UIViewController *controller;
|
|
@property (nonatomic) BOOL active;
|
|
@property (nonatomic) RNSScreenStackAnimation stackAnimation;
|
|
@property (nonatomic) RNSScreenStackPresentation stackPresentation;
|
|
|
|
- (void)notifyFinishTransitioning;
|
|
|
|
@end
|
|
|
|
@interface UIView (RNSScreen)
|
|
- (UIViewController *)parentViewController;
|
|
@end
|