Disclaimer –I’m new to iOS and to this forum too.
I have a need to get pictures taken in specific dates (let’s say January 9-January 12) . I don't want to go over all the photos in the photo library for enhance the app performance. I am looking for some public API to full fill my requirement. Does apple Photo Framework
supports fetching photo collection by date? Is PHFetchOptions
the solution and if so what is the right way to use it ?
You can create a predicate to specify the dates:
PHFetchOptions *fetchOptions = [PHFetchOptions new];
fetchOptions.predicate = [NSPredicate predicateWithFormat:@"creationDate > %@ AND creationDate < %@", startDate, endDate];
PHFetchResult *fetchResult = [PHAsset fetchAssetsWithOptions:fetchOptions];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With