mirror of
https://github.com/status-im/react-native.git
synced 2025-01-13 11:05:21 +00:00
ec68536e08
Summary: When using `<Modal` on larger iOS devices, esp. iPad and iPhone 7 Plus devices, there is no way to use the system functionality for controlling the appearance of modals (`presentationStyle`), which improves the native system's animation and display of smaller content appearing within large horizontal space. I've added a new picker for selecting a `presentationStyle` within the RNTester app. See below for the appearance of this change, as well as the relevant changes to the RN documentation. ![may-22-2017 09-49-50](https://cloud.githubusercontent.com/assets/3521186/26315020/6d4b1cb0-3ed5-11e7-8ac8-a996f1ee00f9.gif) <img width="1051" alt="screen shot 2017-05-22 at 9 50 12 am" src="https://cloud.githubusercontent.com/assets/3521186/26315021/6d4cbf7a-3ed5-11e7-9d13-a5d20c9f3533.png"> Closes https://github.com/facebook/react-native/pull/14102 Differential Revision: D5281990 Pulled By: shergin fbshipit-source-id: 882d8cb79e7adb0b4437cdf26e5e7ab1fc04f4c1
33 lines
1.2 KiB
Objective-C
33 lines
1.2 KiB
Objective-C
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
|
|
#import <React/RCTInvalidating.h>
|
|
#import <React/RCTViewManager.h>
|
|
#import <React/RCTConvert.h>
|
|
|
|
@interface RCTConvert (RCTModalHostView)
|
|
|
|
+ (UIModalPresentationStyle)UIModalPresentationStyle:(id)json;
|
|
|
|
@end
|
|
|
|
typedef void (^RCTModalViewInteractionBlock)(UIViewController *reactViewController, UIViewController *viewController, BOOL animated, dispatch_block_t completionBlock);
|
|
|
|
@interface RCTModalHostViewManager : RCTViewManager <RCTInvalidating>
|
|
|
|
/**
|
|
* `presentationBlock` and `dismissalBlock` allow you to control how a Modal interacts with your case,
|
|
* e.g. in case you have a native navigator that has its own way to display a modal.
|
|
* If these are not specified, it falls back to the UIViewController standard way of presenting.
|
|
*/
|
|
@property (nonatomic, strong) RCTModalViewInteractionBlock presentationBlock;
|
|
@property (nonatomic, strong) RCTModalViewInteractionBlock dismissalBlock;
|
|
|
|
@end
|