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