Swift 3.0

let url = URL(string: "http://google.com/lastPath")
let lastPath = url?.lastPathComponent