(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];

    }

});

// 方法二

[selfperformSelector:@selector(redirectToURL:) withObject:url afterDelay:0.1];

- (void) redirectToURL

{

    UIApplication *application = [UIApplication sharedApplication];

    if([applicationrespondsToSelector:@selector(openURL:options:completionHandler:)]) {

        [application openURL:URL options:@{}

           completionHandler:nil];

    }else{

        [application openURL:URL];

    }

}

你可能感兴趣的:((IOS)解决openUrl延时问题)