objective c - openURL: deprecated in iOS 10 -
apple ios 10 has deprecated openurl: openurl:option:completionhandler if have:
[[uiapplication sharedapplication] openurl:[nsurl urlwithstring:@"https://www.google.com"]];
how become? options:<#(nonnull nsdictionary *)#> in detail
[[uiapplication sharedapplication] openurl:[nsurl urlwithstring:@"https://www.google.com"] options:<#(nonnull nsdictionary<nsstring *,id> *)#> completionhandler:nil];
thanks
update options:@{} empty dictionary no key , value http://useyourloaf.com/blog/querying-url-schemes-with-canopenurl/
write this.
handle completionhandler
uiapplication *application = [uiapplication sharedapplication]; nsurl *url = [nsurl urlwithstring:@"http://www.google.com"]; [application openurl:url options:@{} completionhandler:^(bool success) { if (success) { nslog(@"opened url"); } }];
without handling completionhandler
[application openurl:url options:@{} completionhandler:nil];
Comments
Post a Comment