UIApplication.sharedApplication().canOpenURL(_ aUrl: NSURL)
[[UIApplication sharedApplication] canOpenURL:(NSURL *)aUrl];
UIApplication.sharedApplication().openURL(_ aUrl: NSURL)
[[UIApplication sharedApplication] openURL:(NSURL *)aUrl];
Parameter | Meaning |
—— | —— | aUrl | a NSURL instance which stores a built-in or custom scheme string|
In iOS9 and above your app must list any URL schemes it will want to query. This is done by adding LSApplicationQueriesSchemes
to Info.plist
iOS has built-in support for the tel
, http
/https
,sms
, mailto
, facetime
schemes. It also supports http–based URLs for Youtube
, Maps
and iTunes
apps.
Examples of built-in URL schemes:
tel: tel://123456890
or tel:123456890