mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-28 20:25:33 +08:00
Added lightweight generic annotations
Summary: public Added lightweight genarics annotations to make the code more readable and help the compiler catch bugs. Fixed some type bugs and improved bridge validation in a few places. Reviewed By: javache Differential Revision: D2600189 fb-gh-sync-id: f81e22f2cdc107bf8d0b15deec6d5b83aacc5b56
This commit is contained in:
committed by
facebook-github-bot-7
parent
31565781f2
commit
c5b990f65f
@@ -51,18 +51,18 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:coder)
|
||||
}
|
||||
}
|
||||
|
||||
- (NSArray *)reactSubviews
|
||||
- (NSArray<UIView<RCTComponent> *> *)reactSubviews
|
||||
{
|
||||
return [NSArray arrayWithObjects:_modalViewController.view, nil];
|
||||
return _modalViewController.view ? @[_modalViewController.view] : @[];
|
||||
}
|
||||
|
||||
- (void)insertReactSubview:(UIView *)subview atIndex:(__unused NSInteger)atIndex
|
||||
- (void)insertReactSubview:(UIView<RCTComponent> *)subview atIndex:(__unused NSInteger)atIndex
|
||||
{
|
||||
[subview addGestureRecognizer:_touchHandler];
|
||||
_modalViewController.view = subview;
|
||||
}
|
||||
|
||||
- (void)removeReactSubview:(UIView *)subview
|
||||
- (void)removeReactSubview:(UIView<RCTComponent> *)subview
|
||||
{
|
||||
RCTAssert(subview == _modalViewController.view, @"Cannot remove view other than modal view");
|
||||
_modalViewController.view = nil;
|
||||
|
||||
Reference in New Issue
Block a user