Bring your PHAsset with you.
I think you can bring the information and compare it and then bring the pictures :)
import Photos
override func viewDidLoad() {
let options = PHFetchOptions()
options.predicate = NSPredicate(format: "mediaType = %d",PHAssetMediaType.Image.rawValue)
options.sortDescriptors = [ NSSortDescriptor(key: "creationDate", ascending: true) ]
let result : PHFetchResult = PHAsset.fetchAssetsWithOptions(options)
for i in 0 ..< assetsFetchResults.count {
let asset = assetsFetchResults[i] as! PHAsset
print("date = \(asset.creationDate!)")
print("location = \(asset.location)")
print("width = \(asset.pixelWidth), height=\(asset.pixelHeight))
}
}
© 2024 OneMinuteCode. All rights reserved.