Replace deprecated completion block

Summary:
`UIActivityViewConroller.completionHandler` has been [deprecated](https://developer.apple.com/reference/uikit/uiactivityviewcontroller/1622010-completionhandler) since iOS 8, when it was replaced by `completionWithItemsHandler`.

Tested the build using `UIExplorer` and XCode 8.2 but I've never seen and can't work out how to activate the `UIActivityViewController` this method relates to, so I haven't tested a real run.
Closes https://github.com/facebook/react-native/pull/11798

Differential Revision: D4396618

fbshipit-source-id: 92a993c434637ede2d5779f4154feb00d2c78d06
This commit is contained in:
rh389 2017-01-09 19:27:48 -08:00 committed by Facebook Github Bot
parent 2d8a287f9c
commit 453e70d19c
1 changed files with 4 additions and 1 deletions

View File

@ -383,7 +383,10 @@ void RCTProfileUnhookModules(RCTBridge *bridge)
#if !TARGET_OS_TV
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[[NSURL fileURLWithPath:outFile]]
applicationActivities:nil];
activityViewController.completionHandler = ^(__unused NSString *activityType, __unused BOOL completed) {
activityViewController.completionWithItemsHandler = ^(__unused UIActivityType activityType,
__unused BOOL completed,
__unused NSArray *items,
__unused NSError *error) {
RCTProfileControlsWindow.hidden = NO;
};
RCTProfileControlsWindow.hidden = YES;