From 3163479e0f9f9fc3937b9b1a57e7d1b95a1dd297 Mon Sep 17 00:00:00 2001 From: licd Date: Wed, 8 May 2019 18:18:25 -0700 Subject: [PATCH] add nonnull/nullable for swift (#24729) Summary: add nonnull/nullable for swift [iOS] [Changed] - add nonnull/nullable for swift Pull Request resolved: https://github.com/facebook/react-native/pull/24729 Differential Revision: D15273046 Pulled By: shergin fbshipit-source-id: 5603007e5aa01d54064da349666a4e4d998b5471 --- React/Base/RCTRootView.h | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/React/Base/RCTRootView.h b/React/Base/RCTRootView.h index 01c1d97931..348d08b08f 100644 --- a/React/Base/RCTRootView.h +++ b/React/Base/RCTRootView.h @@ -35,6 +35,9 @@ extern "C" #else extern #endif + +NS_ASSUME_NONNULL_BEGIN + NSString *const RCTContentDidAppearNotification; /** @@ -49,7 +52,7 @@ NSString *const RCTContentDidAppearNotification; */ - (instancetype)initWithBridge:(RCTBridge *)bridge moduleName:(NSString *)moduleName - initialProperties:(NSDictionary *)initialProperties NS_DESIGNATED_INITIALIZER; + initialProperties:(nullable NSDictionary *)initialProperties NS_DESIGNATED_INITIALIZER; /** * - Convenience initializer - @@ -60,8 +63,8 @@ NSString *const RCTContentDidAppearNotification; */ - (instancetype)initWithBundleURL:(NSURL *)bundleURL moduleName:(NSString *)moduleName - initialProperties:(NSDictionary *)initialProperties - launchOptions:(NSDictionary *)launchOptions; + initialProperties:(nullable NSDictionary *)initialProperties + launchOptions:(nullable NSDictionary *)launchOptions; /** @@ -85,7 +88,7 @@ NSString *const RCTContentDidAppearNotification; * * Set this property only on the main thread. */ -@property (nonatomic, copy, readwrite) NSDictionary *appProperties; +@property (nonatomic, copy, readwrite, nullable) NSDictionary *appProperties; /** * The size flexibility mode of the root view. @@ -95,12 +98,12 @@ NSString *const RCTContentDidAppearNotification; /** * The delegate that handles intrinsic size updates. */ -@property (nonatomic, weak) id delegate; +@property (nonatomic, weak, nullable) id delegate; /** * The backing view controller of the root view. */ -@property (nonatomic, weak) UIViewController *reactViewController; +@property (nonatomic, weak, nullable) UIViewController *reactViewController; /** * The React-managed contents view of the root view. @@ -112,7 +115,7 @@ NSString *const RCTContentDidAppearNotification; * with a blank screen. By default this is nil, but you can override it with * (for example) a UIActivityIndicatorView or a placeholder image. */ -@property (nonatomic, strong) UIView *loadingView; +@property (nonatomic, strong, nullable) UIView *loadingView; /** * Calling this will result in emitting a "touches cancelled" event to js, @@ -166,3 +169,5 @@ NSString *const RCTContentDidAppearNotification; __deprecated_msg("Use `intrinsicContentSize` instead."); @end + +NS_ASSUME_NONNULL_END