Delete Duplicate Photo Albums in XCode Objective-C

I accidentally created too many photo albums with the same name, I needed a solution to delete it all without manually deleting it. There’s probably an easier way to do this if you know it let me know. NSString *albumName = @"SOME ALBUM"; __block PHAssetCollection *albumCollection = [[PHAssetCollection alloc] init]; PHFetchOptions *albumOptions = [[PHFetchOptions alloc] init]; [albumOptions setPredicate:[NSPredicate predicateWithFormat:@"estimatedAssetCount >= 0"]]; PHFetchResult *userAlbums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAny options:albumOptions]; dispatch_async(dispatch_get_main_queue(), ^{ [userAlbums enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop)

Continue Reading

Site Footer

Sliding Sidebar

RYAN OUN

Nice to meet you, my name is Ryan and I build stuff for the web. Welcome to my website where you can learn about me and my interests.

USEFUL LINKS