Save images with phimagemanager to custom album?

This is how I do: At the top: import Photos var image: UIImage! var assetCollection: PHAssetCollection! var albumFound : Bool = false var photosAsset: PHFetchResult! var assetThumbnailSize:CGSize! var collection: PHAssetCollection! var assetCollectionPlaceholder: PHObjectPlaceholder! Creating the album: func createAlbum() { //Get PHFetch Options let fetchOptions = PHFetchOptions() fetchOptions.predicate = NSPredicate(format: “title = %@”, “camcam”) let collection … Read more

PHAsset to UIImage

This did what I needed it to do, in case anyone also needs this. func getAssetThumbnail(asset: PHAsset) -> UIImage { let manager = PHImageManager.defaultManager() let option = PHImageRequestOptions() var thumbnail = UIImage() option.synchronous = true manager.requestImageForAsset(asset, targetSize: CGSize(width: 100.0, height: 100.0), contentMode: .AspectFit, options: option, resultHandler: {(result, info)->Void in thumbnail = result! }) return thumbnail … Read more

tech