iOS APP应用之间的跳转
前言:苹果在iOS 2中引入了openURL:方法来进行APP间的跳转。不过在iOS 9中,相关的canOpenURL:函数已经被私有化了,苹果禁止开发者查询设备上是否安装了某款APP。在iOS 10中,苹果弃用了openURL,转而用openURL:options:completionHandler:替代
上代码:
UIApplication *application = [UIApplication sharedApplication]; NSURL *URL = [NSURL URLWithString:scheme]; if ([application respondsToSelector:@selector(openURL:options:completionHandler:)]) { [application openURL:URL options:@{} completionHandler:^(BOOL success) { }]; } else { [application openURL:URL]; }