mirror of
https://github.com/status-im/react-native.git
synced 2025-02-25 23:55:23 +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];
|
launchOptions:launchOptions];
|
||||||
|
|
||||||
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
||||||
UIViewController *rootViewController = [[UIViewController alloc] init];
|
UIViewController *rootViewController = [UIViewController new];
|
||||||
rootViewController.view = rootView;
|
rootViewController.view = rootView;
|
||||||
self.window.rootViewController = rootViewController;
|
self.window.rootViewController = rootViewController;
|
||||||
[self.window makeKeyAndVisible];
|
[self.window makeKeyAndVisible];
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
launchOptions:launchOptions];
|
launchOptions:launchOptions];
|
||||||
|
|
||||||
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
||||||
UIViewController *rootViewController = [[UIViewController alloc] init];
|
UIViewController *rootViewController = [UIViewController new];
|
||||||
rootViewController.view = rootView;
|
rootViewController.view = rootView;
|
||||||
self.window.rootViewController = rootViewController;
|
self.window.rootViewController = rootViewController;
|
||||||
[self.window makeKeyAndVisible];
|
[self.window makeKeyAndVisible];
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
launchOptions:launchOptions];
|
launchOptions:launchOptions];
|
||||||
|
|
||||||
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
||||||
UIViewController *rootViewController = [[UIViewController alloc] init];
|
UIViewController *rootViewController = [UIViewController new];
|
||||||
rootViewController.view = rootView;
|
rootViewController.view = rootView;
|
||||||
self.window.rootViewController = rootViewController;
|
self.window.rootViewController = rootViewController;
|
||||||
[self.window makeKeyAndVisible];
|
[self.window makeKeyAndVisible];
|
||||||
|
@ -20,10 +20,10 @@
|
|||||||
- (void)testLayoutSubviewsOrdering
|
- (void)testLayoutSubviewsOrdering
|
||||||
{
|
{
|
||||||
// create some Views and ViewControllers
|
// create some Views and ViewControllers
|
||||||
UIViewController *parentVC = [[UIViewController alloc] init];
|
UIViewController *parentVC = [UIViewController new];
|
||||||
UIView *parentView = [[UIView alloc] init];
|
UIView *parentView = [UIView new];
|
||||||
UIViewController *childVC = [[UIViewController alloc] init];
|
UIViewController *childVC = [UIViewController new];
|
||||||
UIView *childView = [[UIView alloc] init];
|
UIView *childView = [UIView new];
|
||||||
|
|
||||||
// The ordering we expect is:
|
// The ordering we expect is:
|
||||||
// parentView::layoutSubviews
|
// parentView::layoutSubviews
|
||||||
|
@ -17,7 +17,7 @@ RCT_EXPORT_MODULE()
|
|||||||
|
|
||||||
- (ARTNode *)node
|
- (ARTNode *)node
|
||||||
{
|
{
|
||||||
return [[ARTGroup alloc] init];
|
return [ARTGroup new];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -17,7 +17,7 @@ RCT_EXPORT_MODULE()
|
|||||||
|
|
||||||
- (ARTNode *)node
|
- (ARTNode *)node
|
||||||
{
|
{
|
||||||
return [[ARTNode alloc] init];
|
return [ARTNode new];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (UIView *)view
|
- (UIView *)view
|
||||||
|
@ -17,7 +17,7 @@ RCT_EXPORT_MODULE()
|
|||||||
|
|
||||||
- (ARTRenderable *)node
|
- (ARTRenderable *)node
|
||||||
{
|
{
|
||||||
return [[ARTRenderable alloc] init];
|
return [ARTRenderable new];
|
||||||
}
|
}
|
||||||
|
|
||||||
RCT_EXPORT_VIEW_PROPERTY(strokeWidth, CGFloat)
|
RCT_EXPORT_VIEW_PROPERTY(strokeWidth, CGFloat)
|
||||||
|
@ -18,7 +18,7 @@ RCT_EXPORT_MODULE()
|
|||||||
|
|
||||||
- (ARTRenderable *)node
|
- (ARTRenderable *)node
|
||||||
{
|
{
|
||||||
return [[ARTShape alloc] init];
|
return [ARTShape new];
|
||||||
}
|
}
|
||||||
|
|
||||||
RCT_EXPORT_VIEW_PROPERTY(d, CGPath)
|
RCT_EXPORT_VIEW_PROPERTY(d, CGPath)
|
||||||
|
@ -17,7 +17,7 @@ RCT_EXPORT_MODULE()
|
|||||||
|
|
||||||
- (UIView *)view
|
- (UIView *)view
|
||||||
{
|
{
|
||||||
return [[ARTSurfaceView alloc] init];
|
return [ARTSurfaceView new];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -18,7 +18,7 @@ RCT_EXPORT_MODULE()
|
|||||||
|
|
||||||
- (ARTRenderable *)node
|
- (ARTRenderable *)node
|
||||||
{
|
{
|
||||||
return [[ARTText alloc] init];
|
return [ARTText new];
|
||||||
}
|
}
|
||||||
|
|
||||||
RCT_EXPORT_VIEW_PROPERTY(alignment, CTTextAlignment)
|
RCT_EXPORT_VIEW_PROPERTY(alignment, CTTextAlignment)
|
||||||
|
@ -358,7 +358,7 @@ id RCTAlertView(NSString *title, NSString *message, id delegate, NSString *cance
|
|||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
UIAlertView *alertView = [[UIAlertView alloc] init];
|
UIAlertView *alertView = [UIAlertView new];
|
||||||
alertView.title = title;
|
alertView.title = title;
|
||||||
alertView.message = message;
|
alertView.message = message;
|
||||||
alertView.delegate = delegate;
|
alertView.delegate = delegate;
|
||||||
|
@ -338,7 +338,7 @@ static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!strongSelf->_context) {
|
if (!strongSelf->_context) {
|
||||||
JSContext *context = [[JSContext alloc] init];
|
JSContext *context = [JSContext new];
|
||||||
strongSelf->_context = [[RCTJavaScriptContext alloc] initWithJSContext:context];
|
strongSelf->_context = [[RCTJavaScriptContext alloc] initWithJSContext:context];
|
||||||
}
|
}
|
||||||
[strongSelf _addNativeHook:RCTNativeLoggingHook withName:"nativeLoggingHook"];
|
[strongSelf _addNativeHook:RCTNativeLoggingHook withName:"nativeLoggingHook"];
|
||||||
|
@ -337,7 +337,7 @@ static NSMutableArray *RCTProfileGetThreadEvents(void)
|
|||||||
static NSString *const RCTProfileThreadEventsKey = @"RCTProfileThreadEventsKey";
|
static NSString *const RCTProfileThreadEventsKey = @"RCTProfileThreadEventsKey";
|
||||||
NSMutableArray *threadEvents = [NSThread currentThread].threadDictionary[RCTProfileThreadEventsKey];
|
NSMutableArray *threadEvents = [NSThread currentThread].threadDictionary[RCTProfileThreadEventsKey];
|
||||||
if (!threadEvents) {
|
if (!threadEvents) {
|
||||||
threadEvents = [[NSMutableArray alloc] init];
|
threadEvents = [NSMutableArray new];
|
||||||
[NSThread currentThread].threadDictionary[RCTProfileThreadEventsKey] = threadEvents;
|
[NSThread currentThread].threadDictionary[RCTProfileThreadEventsKey] = threadEvents;
|
||||||
}
|
}
|
||||||
return threadEvents;
|
return threadEvents;
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
launchOptions:launchOptions];
|
launchOptions:launchOptions];
|
||||||
|
|
||||||
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
||||||
UIViewController *rootViewController = [[UIViewController alloc] init];
|
UIViewController *rootViewController = [UIViewController new];
|
||||||
rootViewController.view = rootView;
|
rootViewController.view = rootView;
|
||||||
self.window.rootViewController = rootViewController;
|
self.window.rootViewController = rootViewController;
|
||||||
[self.window makeKeyAndVisible];
|
[self.window makeKeyAndVisible];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user