This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import Photos | |
// I like to typealias my blocks, makes for easier reading | |
typealias ImageCallback = (UIImage? -> Void) | |
func fetchLastPhoto(resizeTo size: CGSize?, imageCallback: ImageCallback) { | |
let fetchOptions = PHFetchOptions() | |
fetchOptions.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: false)] |
NewerOlder