Swift – how to get last taken 3 photos from photo library?

Here’s a solution using the Photos framework available for devices iOS 8+ : import Photos class ViewController: UIViewController { var images:[UIImage] = [] func fetchPhotos () { // Sort the images by descending creation date and fetch the first 3 let fetchOptions = PHFetchOptions() fetchOptions.sortDescriptors = [NSSortDescriptor(key:”creationDate”, ascending: false)] fetchOptions.fetchLimit = 3 // Fetch the … Read more

iPhone: How do I get the file path of an image saved with UIImageWriteToSavedPhotosAlbum()?

I finally found out the answer. Apparently the UIImage methods strip out metadata and so using UIImageWriteToSavedPhotosAlbum is no good. However in ios4 Apple put in a new framework to handle the photo library called the ALAssetsLibrary. First you need to right click on the Targets and in the build part, add the AlAsset Framework … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)