mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
use new instead of alloc init
Summary:
i saw this a lot in the codebase, it's not optimal bc we're using two selectors when we only need one.
fastmod --extensions m,mm '\[\[(.*) alloc] init]' '[${1} new]' --dir xplat/js/react-native-github/*
i manually updated the callsites that this codemod couldn't handle (e.g., where there were more than one of these instances in a single line)
Changelog: [Internal]
Reviewed By: RSNara
Differential Revision: D31776561
fbshipit-source-id: 1b16da240e8a79b54da67383d548921b82b05a9f
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9ac03361e6
commit
def7dd857d
@@ -300,7 +300,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
|
||||
self.backedTextInputView.inputView = nil;
|
||||
} else {
|
||||
// Hides keyboard, but keeps blinking cursor.
|
||||
self.backedTextInputView.inputView = [[UIView alloc] init];
|
||||
self.backedTextInputView.inputView = [UIView new];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -607,7 +607,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
|
||||
_hasInputAccesoryView = shouldHaveInputAccesoryView;
|
||||
|
||||
if (shouldHaveInputAccesoryView) {
|
||||
UIToolbar *toolbarView = [[UIToolbar alloc] init];
|
||||
UIToolbar *toolbarView = [UIToolbar new];
|
||||
[toolbarView sizeToFit];
|
||||
UIBarButtonItem *flexibleSpace =
|
||||
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
|
||||
|
||||
Reference in New Issue
Block a user