Post

Replies

Boosts

Views

Activity

Reply to Data (contentsOf: url, options: .alwaysMapped) doesn't 'map' in Xcode 10.2/Swift 5
I'm having the same issue too. I need to get the MP4 file path from a local file. It worked for me: change URL(string: path) to URL(fileURLWithPath: path)。 example: if let path = filePath { let URL = URL(fileURLWithPath: path) // let URL = URL(string: path) do { let data = try Data (contentsOf: URL, options: .alwaysMapped) print(" data: (data.count)") } catch let error { print(" data nil") } }
Mar ’23