Sorting Shared Albums with the Apple IOS Photokit -
before lot of fruitless experimenting, know if can sort shared albums using apple photokit. know native photos app not able to.
as far understand question, want sort based on timestamp @ asset added. try this:
_assets = [[nsarray alloc] init]; phfetchoptions *options = [[phfetchoptions alloc] init]; //sort according date options.sortdescriptors = @[[nssortdescriptor sortdescriptorwithkey:@"creationdate" ascending:no]]; //if want images options.predicate = [nspredicate predicatewithformat:@"mediatype == %d", phassetmediatypeimage]; //each album assetcollection phfetchresult *fetchresult = [phasset fetchassetsinassetcollection:self.assetscollection options:options]; _assets = fetchresult;
Comments
Post a Comment