码迷,mamicode.com
首页 > 移动开发 > 详细

app跳转openURL,兼容方法

时间:2016-10-31 09:12:37      阅读:334      评论:0      收藏:0      [点我收藏+]

标签:options   open   nbsp   cto   sha   with   else   shared   url   

- (void)openScheme:(NSString *)scheme {
  UIApplication *application = [UIApplication sharedApplication];
  NSURL *URL = [NSURL URLWithString:scheme];
 
  if ([application respondsToSelector:@selector(openURL:options:completionHandler:)]) {
    [application openURL:URL options:@{}
       completionHandler:^(BOOL success) {
      NSLog(@"Open %@: %d",scheme,success);
    }];
  } else {
    BOOL success = [application openURL:URL];
    NSLog(@"Open %@: %d",scheme,success);
  }
}

app跳转openURL,兼容方法

标签:options   open   nbsp   cto   sha   with   else   shared   url   

原文地址:http://www.cnblogs.com/weipeng168/p/6014665.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!