Updates from Wed Mar 11

- [ReactNative] Remove duplicate example entries | Spencer Ahrens
- Unforked RKNavigator, RKScrollView and RKView | Nick Lockwood
This commit is contained in:
Alex Kotliarskyi
2015-03-11 12:29:36 -07:00
parent fab5ec617d
commit 62947e5b71
36 changed files with 418 additions and 185 deletions

View File

@@ -1058,25 +1058,6 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView
}];
}
- (void)getScrollViewContentSize:(NSNumber *)reactTag callback:(RCTResponseSenderBlock)callback failCallback:(RCTResponseSenderBlock)failCallback
{
RCT_EXPORT();
[self addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry) {
UIView *view = viewRegistry[reactTag];
if (!view) {
NSString *error = [[NSString alloc] initWithFormat:@"cannot find view with tag %@", reactTag];
RCTLogError(@"%@", error);
failCallback(@[@{@"error": error}]);
return;
}
CGSize size = ((id<RCTScrollableProtocol>)view).contentSize;
NSDictionary *dict = @{@"width" : @(size.width), @"height" : @(size.height)};
callback(@[dict]);
}];
}
/**
* JS sets what *it* considers to be the responder. Later, scroll views can use
* this in order to determine if scrolling is appropriate.