I am trying to convert a String to NSURL and my code for that is Below:
String
NSURL
var url = \"https://maps.googleapis.com/maps/api/distancema
as blwinters said, in Swift 3.0 use
URL(string: urlPath.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!)