Created
October 27, 2016 18:02
-
-
Save omgbbqhaxx/ca0751ca0df91c42eb0243ce339b70ea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func getAssetThumbnail(asset: PHAsset) -> UIImage { | |
| let manager = PHImageManager.default() | |
| let option = PHImageRequestOptions() | |
| var thumbnail = UIImage() | |
| option.isSynchronous = true | |
| manager.requestImage(for: asset, targetSize: CGSize(width: 100, height: 100), contentMode: .aspectFit, options: option, resultHandler: {(result, info)->Void in | |
| thumbnail = result! | |
| }) | |
| return thumbnail | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment