Unified the method signature for addUIBlock: to further simplify porting ViewManagers

This commit is contained in:
Nick Lockwood 2015-03-09 19:52:39 -07:00
parent fa87d83af5
commit e020aaa93b
3 changed files with 5 additions and 7 deletions

View File

@ -329,7 +329,7 @@ static NSString *RCTViewNameForModuleName(NSString *moduleName)
}
};
[_pendingUIBlocksLock lock];
[_pendingUIBlokbivvgegvvenkbtgucgdvvfnhliknrfjcksLock lock];
[_pendingUIBlocks addObject:outerBlock];
[_pendingUIBlocksLock unlock];
}

View File

@ -17,7 +17,7 @@
- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher
{
if ((self = [super initWithFrame:CGRectZero])) {
_eventDispatcher = eventDispatcher;
[self addTarget:self action:@selector(_textFieldDidChange) forControlEvents:UIControlEventEditingChanged];
[self addTarget:self action:@selector(_textFieldBeginEditing) forControlEvents:UIControlEventEditingDidBegin];
@ -40,7 +40,7 @@
- (void)removeReactSubview:(UIView *)subview
{
// TODO: this is a bit broken - if the TextField inserts any of
// it's own views below or between React's, the indices won't match
// its own views below or between React's, the indices won't match
[_reactSubviews removeObject:subview];
[subview removeFromSuperview];
}
@ -48,7 +48,7 @@
- (void)insertReactSubview:(UIView *)view atIndex:(NSInteger)atIndex
{
// TODO: this is a bit broken - if the TextField inserts any of
// it's own views below or between React's, the indices won't match
// its own views below or between React's, the indices won't match
[_reactSubviews insertObject:view atIndex:atIndex];
[super insertSubview:view atIndex:atIndex];
}
@ -74,7 +74,7 @@
- (void)setAutoCorrect:(BOOL)autoCorrect
{
[super setAutocorrectionType:(autoCorrect ? UITextAutocorrectionTypeYes : UITextAutocorrectionTypeNo)];
self.autocorrectionType = (autoCorrect ? UITextAutocorrectionTypeYes : UITextAutocorrectionTypeNo);
}
- (BOOL)autoCorrect
@ -117,7 +117,6 @@ RCT_TEXT_EVENT_HANDLER(_textFieldSubmitEditing, RCTTextEventTypeSubmit)
return result;
}
// Prevent native from becoming first responder (TODO: why?)
- (BOOL)canBecomeFirstResponder
{
return _jsRequestingFirstResponder;

View File

@ -20,7 +20,6 @@ RCT_REMAP_VIEW_PROPERTY(autoCapitalize, autocapitalizationType)
RCT_EXPORT_VIEW_PROPERTY(enabled)
RCT_EXPORT_VIEW_PROPERTY(placeholder)
RCT_EXPORT_VIEW_PROPERTY(text)
RCT_EXPORT_VIEW_PROPERTY(font)
RCT_EXPORT_VIEW_PROPERTY(clearButtonMode)
RCT_EXPORT_VIEW_PROPERTY(keyboardType)
RCT_REMAP_VIEW_PROPERTY(color, textColor)