Casting UIImageOrientation to ALAssetOrientation

1var orientation:ALAssetOrientation = ALAssetOrientation.fromRaw(UIImage().imageOrientation.toRaw())!

Example of using this casting, when saving image data to camera roll.

1ALAssetsLibrary().writeImageToSavedPhotosAlbum(image.CGImage, orientation: orientation, completionBlock: nil)
overlaied image when clicked on thumbnail

Makzan | Ios dev scrapbook | Table of Content