mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-13 09:39:18 +08:00
Allows you to choose additional modal presentation styles for iOS. It adds the ability to force a full screen modal or choose a "form sheet" style. This only affects iOS.
60 lines
1.6 KiB
Objective-C
60 lines
1.6 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,
|
|
RNSScreenStackPresentationFullScreenModal,
|
|
RNSScreenStackPresentationFormSheet
|
|
};
|
|
|
|
typedef NS_ENUM(NSInteger, RNSScreenStackAnimation) {
|
|
RNSScreenStackAnimationDefault,
|
|
RNSScreenStackAnimationNone,
|
|
RNSScreenStackAnimationFade,
|
|
RNSScreenStackAnimationFlip,
|
|
};
|
|
|
|
@interface RCTConvert (RNSScreen)
|
|
|
|
+ (RNSScreenStackPresentation)RNSScreenStackPresentation:(id)json;
|
|
+ (RNSScreenStackAnimation)RNSScreenStackAnimation:(id)json;
|
|
|
|
@end
|
|
|
|
@interface RNSScreen : UIViewController
|
|
|
|
- (instancetype)initWithView:(UIView *)view;
|
|
- (void)notifyFinishTransitioning;
|
|
|
|
@end
|
|
|
|
@interface RNSScreenManager : RCTViewManager
|
|
@end
|
|
|
|
@interface RNSScreenView : RCTView
|
|
|
|
@property (nonatomic, copy) RCTDirectEventBlock onAppear;
|
|
@property (nonatomic, copy) RCTDirectEventBlock onDismissed;
|
|
@property (weak, nonatomic) UIView<RNSScreenContainerDelegate> *reactSuperview;
|
|
@property (nonatomic, retain) UIViewController *controller;
|
|
@property (nonatomic) BOOL active;
|
|
@property (nonatomic) BOOL gestureEnabled;
|
|
@property (nonatomic) RNSScreenStackAnimation stackAnimation;
|
|
@property (nonatomic) RNSScreenStackPresentation stackPresentation;
|
|
|
|
- (void)notifyFinishTransitioning;
|
|
|
|
@end
|
|
|
|
@interface UIView (RNSScreen)
|
|
- (UIViewController *)parentViewController;
|
|
@end
|