Skip to content
This repository has been archived by the owner on Jul 15, 2019. It is now read-only.

App crash when selecting not loaded images from iCloud. #33

Open
yigitserin opened this issue Apr 17, 2017 · 0 comments
Open

App crash when selecting not loaded images from iCloud. #33

yigitserin opened this issue Apr 17, 2017 · 0 comments

Comments

@yigitserin
Copy link

Hey there,

Some images in picker appear completely white in picker. After looking into it, I noticed those images are not loaded from iCloud Photos yet. And when I select white image (not loaded) in picker. App crashes when I try to convert it to UIImage.

This is how I convert assets to UIImage normally.

static func getAssetImage(asset: PHAsset) -> UIImage? {
        var pickedImage: UIImage?
        let manager = PHImageManager.defaultManager()
        let option = PHImageRequestOptions()
        option.synchronous = true
        
        manager.requestImageForAsset(asset, targetSize: PHImageManagerMaximumSize, contentMode: .AspectFill, options: option) { (image: UIImage?, info: [NSObject : AnyObject]?) in
            
            pickedImage = image
        }
        
        return pickedImage
    }

Is there any way to work around this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant