قالب وردپرس درنا توس
Home / IOS Development / swift – Loading images from external storage using Core Graphics does not work iOS 13

swift – Loading images from external storage using Core Graphics does not work iOS 13



I'm trying to load external storage (SD card) images using core graphics in iOS 13 (beta). The code below works well when the files are on the device. However, when the files are on external storage, it fails to return, and I do not know why.

I think I'm using the right security scope.
I uploaded the URL files from a URL for a security-scoped directory according to Allow directories

  watchdogUrl.startAccessingSecurityScopedResource () else {
back zero
}
expose {folderUrl.stopAccessingSecurityScopedResource ()}

guard let imageSource = CGImageSourceCreateWithURL (imageURL as CFURL, options) else {
throw Error.failedToOpenImage (message: "Could not open image on  (imageURL)")
}


Source link