if let url = URL(string: "mailto://azimov@demo.com") { if UIApplication.shared.canOpenURL(url) { UIApplication.shared.openURL(url) } else { print("Cannot open URL") } }
NSURL *url = [NSURL URLWithString:@"mailto://azimov@demo.com"]; if ([[UIApplication sharedApplication] canOpenURL:url]) { [[UIApplication sharedApplication] openURL:url]; } else { NSLog(@"Cannot open URL"); }