iOS 解决openUrl延时问题

释放双眼,带上耳机,听听看~!
// 方法一
dispatch_async(dispatch_get_main_queue(), ^{
        
    UIApplication *application = [UIApplication sharedApplication];
    if ([application respondsToSelector:@selector(openURL:options:completionHandler:)]) {
        [application openURL:URL options:@{}
           completionHandler:nil];
    } else {
        [application openURL:URL];
    }
    });
// 方法二
[self performSelector:@selector(redirectToURL:) withObject:url afterDelay:0.1];

- (void) redirectToURL
{
UIApplication *application = [UIApplication sharedApplication];
    if ([application respondsToSelector:@selector(openURL:options:completionHandler:)]) {
        [application openURL:URL options:@{}
           completionHandler:nil];
    } else {
        [application openURL:URL];
    }
}

人已赞赏
iOS文章

iOS 仿苹果抖动动画

2020-2-8 10:55:08

iOS文章

iOS 3DES加密

2020-2-8 11:26:03

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索