I need url filepath be a URL (NSURL in old versions of Swift). I have this:
let paths = NSSearchPathForDirectoriesInDomains( .documentDirectory, .userDom
you need to do:
let fileUrl = URL(string: filePath)
or
let fileUrl = URL(fileURLWithPath: filePath)
depending on your needs. See URL docs
Before Swift 3, URL was called NSURL.