I am trying to make my application open the apple maps application and have the address be pulled up. I tried this :
- (IBAction)openInMaps:(id)sender {
NSS
Swift 3 version:
let baseUrl: String = "http://maps.apple.com/?q="
let encodedName = "yourAddress".addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!
let finalUrl = baseUrl + encodedName
if let url = URL(string: finalUrl)
{
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}