How To Make A Custom Album in iOS Programmatically

Today, I'm going to give you out an example: how to make a custom album in iOS Programmatically using objective-c. It's pretty easy, you can copy-paste this code below inside your button's selector or method, or even in ViewDidLoad of your viewcontroller.


    ALAssetsLibrary* libraryFolder = [[ALAssetsLibrary alloc] init];

    [libraryFolder addAssetsGroupAlbumWithName:@"My Album" resultBlock:^(ALAssetsGroup *group)

    {

        NSLog(@"Adding Folder:'My Album', success: %s", group.editable ? "Success" : "Already created: Not Success");

    } failureBlock:^(NSError *error)

    {

        NSLog(@"Error: Adding on Folder");

    }];



Pretty easy, right? If you find it helpful, please subscribe. Cheers!

Post a Comment