Is there any possibility to open the image referenced/described by the PHAsset directly in the Photos app?
I did already try with the following code, but this does not work (it only opens Photos but not the actual photo):
let result = PHAsset.fetchAssetsWithMediaType(.Image, options: nil)
if result.count > 0 {
let asset = result[0] as! PHAsset
PHImageManager.defaultManager().requestImageDataForAsset(asset, options: nil, resultHandler: { (data : NSData?, str : String?, or: UIImageOrientation, info : [NSObject : AnyObject]?) -> Void in
if let fileurl = info!["PHImageFileURLKey"] as? NSURL {
let strUrl = "\(fileurl)"
if let range = strUrl.rangeOfString("file:///") {
let strUrl = "\(fileurl)".substringFromIndex(range.endIndex)
if let url = NSURL(string : "photos-redirect://\(strUrl)") {
UIApplication.sharedApplication().openURL(url)
}
} else {
print("Problem: cannot read url")
}
}
})
}