ios - Link Not working ... Why? -
this question has answer here:
link not working properly:
let mooviturl: string = "moovit://nearby?lat=40.758896&lon=-73.985130&title=\(barnametemplate)&partner_id=<nightout>" let escapedstring = mooviturl.addingpercentencoding(withallowedcharacters: .urlhostallowed) uiapplication.shared.openurl(url(string: escapedstring!)!)
saying:
fatal error: unexpectedly found nil while unwrapping optional value 2017-08-14 22:49:35.983585+0300 testapp[10658:6538686] fatal error: unexpectedly found nil while unwrapping optional value
crashing on line:
uiapplication.shared.openurl(url(string: mooviturl)!)
swift doesn't think string actual url, returned nil. when tried force unwrap (!
), gave error.
Comments
Post a Comment