废弃
- leturlString="iosamap://navi?sourceApplication=app名&backScheme=iosamap://&lat=\(self.centerLat)&lon=\(self.centerLng)&dev=0&style=2"
- leturl=NSURL(string:urlString.stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding)!)
let unsafeP=urlString.addingPercentEncoding(withAllowedCharacters: NSCharacterSet(charactersIn:"`#%^{}\"[]|\\<> ").inverted)
UIApplication.shared.open(URL(string:unsafeP!)!,options: [:],
completionHandler: {
(success) in
print("Open \(success)")
})
原文链接:https://www.f2er.com/swift/322218.html