From 453e70d19c28b56dfcecfe205ccd4ccad2b33009 Mon Sep 17 00:00:00 2001 From: rh389 Date: Mon, 9 Jan 2017 19:27:48 -0800 Subject: [PATCH] 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 --- React/Profiler/RCTProfile.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/React/Profiler/RCTProfile.m b/React/Profiler/RCTProfile.m index 8ee0a410d..b51a9bcc2 100644 --- a/React/Profiler/RCTProfile.m +++ b/React/Profiler/RCTProfile.m @@ -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;