I am getting the error, The file “21787.jpg” couldn’t be opened because you don’t have permission to view it.
how do I enable permissions to the app?
how do I enable permissions to the app?
I figured it out. The url is scoped and so I had to direct it to start using the scoped url. like so,
Code Block func loadCover(result: Result<URL,Error>) { guard let selectedURL = try? result.get() else {return} if selectedURL.startAccessingSecurityScopedResource() { do { if let selectedData = try? Data(contentsOf: selectedURL) { self.coverData = selectedData if let uiImage = UIImage(data: selectedData) { self.coverImage = Image(uiImage: uiImage) } } } catch { print(error.localizedDescription) } } selectedURL.stopAccessingSecurityScopedResource() }