iOS Development-Customize multi-Select albums

Source: Internet
Author: User

The main idea of customizing multi-Select albums
    1. Import Assetslibrary Framework
    2. Gets the resource group "0" from the Repository, filters the "1" photo and displays the group in the list.
    3. Click on the resource group to enter the corresponding album, get all the photo resources in the group "2"
 "0 " Get resource Group [_assetslibrary Enumerategroupswithtypes:alassetsgroupall usingblock:^ (alassetsgroup *group , BOOL *stop) {if  (group ) {[_assetsa            Rray addobject:group ];        [_tableview Reloaddata]; }} failureblock:^ (Nserror *error) {Uialertview *alert = [[Uialertview alloc]initwithtitle:@" Prompt " message:@" album Acquisition failed " delegate         : Self cancelbuttontitle:@ "Cancel"  Otherbuttontitles:nil];    [Alert show]; }];
【1setAssetsFilter:[ALAssetsFilter allPhotos]];
【2The Get Photo resource-(void) getimages{_thumbnailmeasure = (screen_width-( Self. Numberofimageeachrow+1) *photo_default_margin)/ Self. Numberofimageeachrow;CGRectframe = CGRectMake (0,0, _thumbnailmeasure, _thumbnailmeasure); [ Self. Assetsgroupenumerateassetsusingblock:^ (Alasset *result, Nsuinteger Index,BOOL*stop) {if(Result)            {Assetview *assetview = [[Assetview alloc]initwithasset:result withframe:frame]; Assetview. Delegate= Self;        [_assetsarray Addobject:assetview]; }    }];}
Related actions
    1. Get Resource Group name

      [_assetsgroup Valueforproperty:alassetsgrouppropertyname];

    2. Get poster thumbnails for a resource group

      [UIImage Imagewithcgimage:_assetsgroup.posterimage];

    3. Get a square thumbnail of a photo resource

      [UIImage Imagewithcgimage:_asset.thumbnail];

    4. Get an image of the full resolution of a photo resource (image assets are encapsulated first)

      [[Asset defaultrepresentation] fullresolutionimage];

    5. Get resource type

      [Asset Valueforproperty:alassetpropertytype];

Demo code uploaded github
Https://github.com/Lotheve/LXXMutiAlbum

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

iOS Development-Customize multi-Select albums

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.