Gizmodo
Gizmodo

Reputation: 3202

Import User Photo Library Albums

I am trying to import, not just multiple photos at a time, but also multiple albums (or single if impossible) at a time.

Basically I want to implement something similar to stock Picture Frame App on iPad. The way it lets you select albums (iPad Settings>Picture Frame).

So far I am under the impression that UIImagePickerController is not simply powerful enough for this. I did find ALAssetsLibrary promising, but nothing is successful yet.

All I need is a given NSArray of photos from a given photo album.

Upvotes: 0

Views: 1379

Answers (1)

Shamsudheen TK
Shamsudheen TK

Reputation: 31311

Use ALAssetsGroupType. Its a bitfield to identify types of asset.

typedef NSUInteger ALAssetsGroupType;

Availability: Available in iOS 4.0 and later.

Declared In: ALAssetsLibrary.h

Types of Asset

ALAssetsGroupLibrary

ALAssetsGroupAlbum

ALAssetsGroupEvent

ALAssetsGroupFaces

ALAssetsGroupSavedPhotos

ALAssetsGroupPhotoStream

ALAssetsGroupAll

Example code:

[assetsLibraryObj enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:listGroupBlock failureBlock:failureBlock];

ALAssetsGroupLibrary

The Library group that includes all assets that are synced from iTunes.

Available in iOS 4.0 and later.

Declared in ALAssetsLibrary.h.

ALAssetsGroupAlbum

All the albums created on the device or synced from iTunes, not including Photo Stream or Shared Streams

Available in iOS 4.0 and later.

Declared in ALAssetsLibrary.h.

ALAssetsGroupEvent

All events, including those created during Camera Connection Kit import.

Available in iOS 4.0 and later.

Declared in ALAssetsLibrary.h.

ALAssetsGroupFaces

All the faces albums synced from iTunes.

Available in iOS 4.0 and later.

Declared in ALAssetsLibrary.h.

ALAssetsGroupSavedPhotos

All the photos in the Camera Roll.

Available in iOS 4.0 and later.

Declared in ALAssetsLibrary.h.

ALAssetsGroupPhotoStream

The PhotoStream album.

In iOS 6.0 and later, this also includes Shared Streams.

Available in iOS 5.0 and later.

Declared in ALAssetsLibrary.h.

ALAssetsGroupAll

The same as ORing together all the group types except for ALAssetsGroupLibrary.

Available in iOS 4.0 and later.

Declared in ALAssetsLibrary.h.

Upvotes: 2

Related Questions