Tutorial by Examples

Swift: if let url = URL(string: "mailto://[email protected]") { if UIApplication.shared.canOpenURL(url) { UIApplication.shared.openURL(url) } else { print("Cannot open URL") } } Objective-C: NSURL *url = [NSURL URLWithString:@"mailto://az...
These are URL schemes supported by native apps on iOS, OS X, and watchOS 2 and later. Opening link in Safari: Objective-C NSString *stringURL = @"http://stackoverflow.com/"; NSURL *url = [NSURL URLWithString:stringURL]; [[UIApplication sharedApplication] openURL:url]; Swift: let s...

Page 1 of 1