如何将swift代码转换为目标c

时间:2016-03-16 07:43:08

标签: ios objective-c iphone xcode swift

我想在目标c,

中转换下面的代码
func application(application: UIApplication, 
                 continueUserActivity userActivity: NSUserActivity, 
                 restorationHandler: (([AnyObject]!) -> Void)) 
                 -> Bool {

  let userInfo = userActivity.userInfo as NSDictionary
  println("Received a payload via handoff: \(userInfo)")
  return true
}

请有人帮帮我。

1 个答案:

答案 0 :(得分:3)

- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler
{
    NSDictionary *userInfo = userActivity.userInfo;
    NSLog(@"Received a payload via handoff: %@", userInfo);
    return YES;
}

喜欢这个吗?