Skip to content

Commit

Permalink
Fix some warnings in React.xcodeproj
Browse files Browse the repository at this point in the history
Reviewed By: majak

Differential Revision: D4081860

fbshipit-source-id: 4b503df3c4e8b6e06b04613919a4a3405bf01171
  • Loading branch information
javache authored and Facebook Github Bot committed Oct 27, 2016
1 parent 384ea33 commit 8bc30af
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
16 changes: 11 additions & 5 deletions React/Base/RCTMultipartDataTask.m
Expand Up @@ -57,7 +57,10 @@ - (void)startTask
[dataTask resume]; [dataTask resume];
} }


- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveResponse:(NSURLResponse *)response completionHandler:(void (^)(NSURLSessionResponseDisposition disposition))completionHandler - (void)URLSession:(__unused NSURLSession *)session
dataTask:(__unused NSURLSessionDataTask *)dataTask
didReceiveResponse:(NSURLResponse *)response
completionHandler:(void (^)(NSURLSessionResponseDisposition disposition))completionHandler
{ {
if ([response isKindOfClass:[NSHTTPURLResponse class]]) { if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response; NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response;
Expand Down Expand Up @@ -86,22 +89,25 @@ - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)data
completionHandler(NSURLSessionResponseAllow); completionHandler(NSURLSessionResponseAllow);
} }


- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error - (void)URLSession:(__unused NSURLSession *)session task:(__unused NSURLSessionTask *)task didCompleteWithError:(NSError *)error
{ {
_partHandler(_statusCode, _headers, _data, error, YES); _partHandler(_statusCode, _headers, _data, error, YES);
} }


- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data - (void)URLSession:(__unused NSURLSession *)session dataTask:(__unused NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data
{ {
[_data appendData:data]; [_data appendData:data];
} }


- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didBecomeStreamTask:(NSURLSessionStreamTask *)streamTask - (void)URLSession:(__unused NSURLSession *)session dataTask:(__unused NSURLSessionDataTask *)dataTask didBecomeStreamTask:(NSURLSessionStreamTask *)streamTask
{ {
[streamTask captureStreams]; [streamTask captureStreams];
} }


- (void)URLSession:(NSURLSession *)session streamTask:(NSURLSessionStreamTask *)streamTask didBecomeInputStream:(NSInputStream *)inputStream outputStream:(NSOutputStream *)outputStream - (void)URLSession:(__unused NSURLSession *)session
streamTask:(__unused NSURLSessionStreamTask *)streamTask
didBecomeInputStream:(NSInputStream *)inputStream
outputStream:(__unused NSOutputStream *)outputStream
{ {
RCTMultipartStreamReader *reader = [[RCTMultipartStreamReader alloc] initWithInputStream:inputStream boundary:_boundary]; RCTMultipartStreamReader *reader = [[RCTMultipartStreamReader alloc] initWithInputStream:inputStream boundary:_boundary];
RCTMultipartDataTaskCallback partHandler = _partHandler; RCTMultipartDataTaskCallback partHandler = _partHandler;
Expand Down
11 changes: 4 additions & 7 deletions React/Modules/RCTDevMenu.m
Expand Up @@ -525,8 +525,7 @@ - (void)addItem:(RCTDevMenuItem *)item
case RCTDevMenuTypeButton: { case RCTDevMenuTypeButton: {
[_actionSheet addAction:[UIAlertAction actionWithTitle:item.title [_actionSheet addAction:[UIAlertAction actionWithTitle:item.title
style:UIAlertActionStyleDefault style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) { handler:^(__unused UIAlertAction *action) {
// Cancel button tappped.
[item callHandler]; [item callHandler];
}]]; }]];
break; break;
Expand All @@ -535,23 +534,21 @@ - (void)addItem:(RCTDevMenuItem *)item
BOOL selected = [item.value boolValue]; BOOL selected = [item.value boolValue];
[_actionSheet addAction:[UIAlertAction actionWithTitle:(selected? item.selectedTitle : item.title) [_actionSheet addAction:[UIAlertAction actionWithTitle:(selected? item.selectedTitle : item.title)
style:UIAlertActionStyleDefault style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) { handler:^(__unused UIAlertAction *action) {
BOOL value = [self->_settings[item.key] boolValue]; BOOL value = [self->_settings[item.key] boolValue];
[self updateSetting:item.key value:@(!value)]; // will call handler [self updateSetting:item.key value:@(!value)]; // will call handler
}]]; }]];

break; break;
} }
} }
} }


[_actionSheet addAction:[UIAlertAction actionWithTitle:@"Cancel" [_actionSheet addAction:[UIAlertAction actionWithTitle:@"Cancel"
style:UIAlertActionStyleCancel style:UIAlertActionStyleCancel
handler:^(UIAlertAction *action) { handler:nil]];
}]];


_presentedItems = items; _presentedItems = items;
[RCTPresentedViewController() presentViewController:_actionSheet animated:YES completion:^(void){}]; [RCTPresentedViewController() presentViewController:_actionSheet animated:YES completion:nil];
} }




Expand Down
13 changes: 8 additions & 5 deletions React/Modules/RCTUIManager.m
Expand Up @@ -858,18 +858,21 @@ - (void)_removeChildren:(NSArray<UIView *> *)children
RCTAssert(shadowView != nil, @"shadowView (for ID %@) not found", reactTag); RCTAssert(shadowView != nil, @"shadowView (for ID %@) not found", reactTag);


RCTShadowView *superShadowView = shadowView.superview; RCTShadowView *superShadowView = shadowView.superview;
RCTAssert(superShadowView != nil, @"shadowView super (of ID %@) not found", reactTag); if (!superShadowView) {
RCTAssert(NO, @"shadowView super (of ID %@) not found", reactTag);
return;
}


NSUInteger indexOfView = [superShadowView.reactSubviews indexOfObject:shadowView]; NSUInteger indexOfView = [superShadowView.reactSubviews indexOfObject:shadowView];
RCTAssert(indexOfView != NSNotFound, @"View's superview doesn't claim it as subview (id %@)", reactTag); RCTAssert(indexOfView != NSNotFound, @"View's superview doesn't claim it as subview (id %@)", reactTag);
NSArray<NSNumber *> *removeAtIndices = @[@(indexOfView)]; NSArray<NSNumber *> *removeAtIndices = @[@(indexOfView)];
NSArray<NSNumber *> *addTags = @[newReactTag]; NSArray<NSNumber *> *addTags = @[newReactTag];
[self manageChildren:superShadowView.reactTag [self manageChildren:superShadowView.reactTag
moveFromIndices:nil moveFromIndices:nil
moveToIndices:nil moveToIndices:nil
addChildReactTags:addTags addChildReactTags:addTags
addAtIndices:removeAtIndices addAtIndices:removeAtIndices
removeAtIndices:removeAtIndices]; removeAtIndices:removeAtIndices];
} }


RCT_EXPORT_METHOD(setChildren:(nonnull NSNumber *)containerTag RCT_EXPORT_METHOD(setChildren:(nonnull NSNumber *)containerTag
Expand Down
18 changes: 6 additions & 12 deletions React/Views/RCTMapManager.m
Expand Up @@ -289,25 +289,19 @@ - (MKAnnotationView *)mapView:(RCTMap *)mapView
return annotationView; return annotationView;
} }


- (MKOverlayRenderer *)mapView:(__unused MKMapView *)mapView - (MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id<MKOverlay>)overlay
rendererForOverlay:(RCTMapOverlay *)overlay
{ {
if ([overlay isKindOfClass:[RCTMapOverlay class]]) { RCTAssert([overlay isKindOfClass:[RCTMapOverlay class]], @"Overlay must be of type RCTMapOverlay");
MKPolylineRenderer *polylineRenderer = MKPolylineRenderer *polylineRenderer = [[MKPolylineRenderer alloc] initWithPolyline:overlay];
[[MKPolylineRenderer alloc] initWithPolyline:overlay]; polylineRenderer.strokeColor = [(RCTMapOverlay *)overlay strokeColor];
polylineRenderer.strokeColor = overlay.strokeColor; polylineRenderer.lineWidth = [(RCTMapOverlay *)overlay lineWidth];
polylineRenderer.lineWidth = overlay.lineWidth; return polylineRenderer;
return polylineRenderer;
} else {
return nil;
}
} }


- (void)mapView:(RCTMap *)mapView annotationView:(MKAnnotationView *)view - (void)mapView:(RCTMap *)mapView annotationView:(MKAnnotationView *)view
calloutAccessoryControlTapped:(UIControl *)control calloutAccessoryControlTapped:(UIControl *)control
{ {
if (mapView.onPress) { if (mapView.onPress) {

// Pass to JS // Pass to JS
RCTMapAnnotation *annotation = (RCTMapAnnotation *)view.annotation; RCTMapAnnotation *annotation = (RCTMapAnnotation *)view.annotation;
mapView.onPress(@{ mapView.onPress(@{
Expand Down

0 comments on commit 8bc30af

Please sign in to comment.