mirror of
https://github.com/status-im/react-native.git
synced 2025-02-25 15:45:32 +00:00
Convert remaining uses of alloc] init] to new]
Summary: public We moved to using `new` instead of `alloc] init` but there was still some calls left. Reviewed By: javache Differential Revision: D2604679 fb-gh-sync-id: ff7300ecbedb55dd5e93873592598810c9b87808
This commit is contained in:
parent
0a28ce480e
commit
ccd90e25c1
@ -56,7 +56,7 @@
|
||||
launchOptions:launchOptions];
|
||||
|
||||
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
||||
UIViewController *rootViewController = [[UIViewController alloc] init];
|
||||
UIViewController *rootViewController = [UIViewController new];
|
||||
rootViewController.view = rootView;
|
||||
self.window.rootViewController = rootViewController;
|
||||
[self.window makeKeyAndVisible];
|
||||
|
@ -57,7 +57,7 @@
|
||||
launchOptions:launchOptions];
|
||||
|
||||
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
||||
UIViewController *rootViewController = [[UIViewController alloc] init];
|
||||
UIViewController *rootViewController = [UIViewController new];
|
||||
rootViewController.view = rootView;
|
||||
self.window.rootViewController = rootViewController;
|
||||
[self.window makeKeyAndVisible];
|
||||
|
@ -56,7 +56,7 @@
|
||||
launchOptions:launchOptions];
|
||||
|
||||
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
||||
UIViewController *rootViewController = [[UIViewController alloc] init];
|
||||
UIViewController *rootViewController = [UIViewController new];
|
||||
rootViewController.view = rootView;
|
||||
self.window.rootViewController = rootViewController;
|
||||
[self.window makeKeyAndVisible];
|
||||
|
@ -20,10 +20,10 @@
|
||||
- (void)testLayoutSubviewsOrdering
|
||||
{
|
||||
// create some Views and ViewControllers
|
||||
UIViewController *parentVC = [[UIViewController alloc] init];
|
||||
UIView *parentView = [[UIView alloc] init];
|
||||
UIViewController *childVC = [[UIViewController alloc] init];
|
||||
UIView *childView = [[UIView alloc] init];
|
||||
UIViewController *parentVC = [UIViewController new];
|
||||
UIView *parentView = [UIView new];
|
||||
UIViewController *childVC = [UIViewController new];
|
||||
UIView *childView = [UIView new];
|
||||
|
||||
// The ordering we expect is:
|
||||
// parentView::layoutSubviews
|
||||
|
@ -17,7 +17,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (ARTNode *)node
|
||||
{
|
||||
return [[ARTGroup alloc] init];
|
||||
return [ARTGroup new];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -17,7 +17,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (ARTNode *)node
|
||||
{
|
||||
return [[ARTNode alloc] init];
|
||||
return [ARTNode new];
|
||||
}
|
||||
|
||||
- (UIView *)view
|
||||
|
@ -17,7 +17,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (ARTRenderable *)node
|
||||
{
|
||||
return [[ARTRenderable alloc] init];
|
||||
return [ARTRenderable new];
|
||||
}
|
||||
|
||||
RCT_EXPORT_VIEW_PROPERTY(strokeWidth, CGFloat)
|
||||
|
@ -18,7 +18,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (ARTRenderable *)node
|
||||
{
|
||||
return [[ARTShape alloc] init];
|
||||
return [ARTShape new];
|
||||
}
|
||||
|
||||
RCT_EXPORT_VIEW_PROPERTY(d, CGPath)
|
||||
|
@ -17,7 +17,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (UIView *)view
|
||||
{
|
||||
return [[ARTSurfaceView alloc] init];
|
||||
return [ARTSurfaceView new];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -18,7 +18,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (ARTRenderable *)node
|
||||
{
|
||||
return [[ARTText alloc] init];
|
||||
return [ARTText new];
|
||||
}
|
||||
|
||||
RCT_EXPORT_VIEW_PROPERTY(alignment, CTTextAlignment)
|
||||
|
@ -358,7 +358,7 @@ id RCTAlertView(NSString *title, NSString *message, id delegate, NSString *cance
|
||||
return nil;
|
||||
}
|
||||
|
||||
UIAlertView *alertView = [[UIAlertView alloc] init];
|
||||
UIAlertView *alertView = [UIAlertView new];
|
||||
alertView.title = title;
|
||||
alertView.message = message;
|
||||
alertView.delegate = delegate;
|
||||
|
@ -338,7 +338,7 @@ static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context)
|
||||
return;
|
||||
}
|
||||
if (!strongSelf->_context) {
|
||||
JSContext *context = [[JSContext alloc] init];
|
||||
JSContext *context = [JSContext new];
|
||||
strongSelf->_context = [[RCTJavaScriptContext alloc] initWithJSContext:context];
|
||||
}
|
||||
[strongSelf _addNativeHook:RCTNativeLoggingHook withName:"nativeLoggingHook"];
|
||||
|
@ -337,7 +337,7 @@ static NSMutableArray *RCTProfileGetThreadEvents(void)
|
||||
static NSString *const RCTProfileThreadEventsKey = @"RCTProfileThreadEventsKey";
|
||||
NSMutableArray *threadEvents = [NSThread currentThread].threadDictionary[RCTProfileThreadEventsKey];
|
||||
if (!threadEvents) {
|
||||
threadEvents = [[NSMutableArray alloc] init];
|
||||
threadEvents = [NSMutableArray new];
|
||||
[NSThread currentThread].threadDictionary[RCTProfileThreadEventsKey] = threadEvents;
|
||||
}
|
||||
return threadEvents;
|
||||
|
@ -47,7 +47,7 @@
|
||||
launchOptions:launchOptions];
|
||||
|
||||
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
||||
UIViewController *rootViewController = [[UIViewController alloc] init];
|
||||
UIViewController *rootViewController = [UIViewController new];
|
||||
rootViewController.view = rootView;
|
||||
self.window.rootViewController = rootViewController;
|
||||
[self.window makeKeyAndVisible];
|
||||
|
Loading…
x
Reference in New Issue
Block a user