<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -"
  ],
  "documentType" : "symbol",
  "framework" : "AssetsLibrary",
  "identifier" : "/documentation/AssetsLibrary/ALAssetsLibrary",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Assets Library"
    ],
    "preciseIdentifier" : "c:objc(cs)ALAssetsLibrary"
  },
  "title" : "ALAssetsLibrary"
}
-->

# ALAssetsLibrary

An instance of `ALAssetsLibrary` provides access to the videos and photos that are under the control of the Photos application.

```
@interface ALAssetsLibrary : NSObject
```

## Overview> Important:
> The Assets Library framework is deprecated as of iOS 9.0. Instead, use the Photos framework instead, which in iOS 8.0 and later provides more features and better performance for working with a user’s photo library. For more information, see `Photos`.
> 
> In the Photos framework, the <doc://com.apple.documentation/documentation/Photos/PHPhotoLibrary> class manages access to and changes in the photo library, and class methods on the <doc://com.apple.documentation/documentation/Photos/PHAsset> and <doc://com.apple.documentation/documentation/Photos/PHCollection> classes and related classes provide functionality for finding photo and video assets.

The library includes those that are in the Saved Photos album, those coming from iTunes, and those that were directly imported into the device. You use it to retrieve the list of all asset groups and to save images and videos into the Saved Photos album.

You create an instance of `ALAssetsLibrary` using `alloc` and `init`:

```objc
ALAssetsLibrary* library = [[ALAssetsLibrary alloc] init];
```

The lifetimes of objects you get back from a library instance are tied to the lifetime of the library instance.

Many of the methods declared by `ALAssetsLibrary` take blocks for failure and success as arguments. These methods are all asynchronous because the user may need to be asked to grant access to the data.

## Topics

### Accessing Assets

### Managing Notifications

### Finding Assets

### Enumerating Assets

### Saving Assets

### Managing Asset Groups

### Constants

[`ALAssetsGroupType`](/documentation/AssetsLibrary/ALAssetsGroupType)

A bitfield to identify types of asset.

[Types of Asset](/documentation/AssetsLibrary/types-of-asset)

Constants to identify types of asset.

[`ALAssetOrientation`](/documentation/AssetsLibrary/ALAssetOrientation)

Constants to indicate the orientation of an asset.

[`ALAssetsLibraryGroupsEnumerationResultsBlock`](/documentation/AssetsLibrary/ALAssetsLibraryGroupsEnumerationResultsBlock)

Signature for the block executed when a match is found during enumeration using `ALAssetsLibrary/enumerateGroups(withTypes:using:failureBlock:)`.

[`ALAssetsLibraryAssetForURLResultBlock`](/documentation/AssetsLibrary/ALAssetsLibraryAssetForURLResultBlock)

Signature for the block executed if the user has granted access to the caller to access the data managed by the framework in `ALAssetsLibrary/asset(for:resultBlock:failureBlock:)`.

[`ALAssetsLibraryWriteImageCompletionBlock`](/documentation/AssetsLibrary/ALAssetsLibraryWriteImageCompletionBlock)

Signature for the block executed when `ALAssetsLibrary/writeImage(toSavedPhotosAlbum:orientation:completionBlock:)` completes.

[`ALAssetsLibraryWriteVideoCompletionBlock`](/documentation/AssetsLibrary/ALAssetsLibraryWriteVideoCompletionBlock)

Signature for the block executed when `ALAssetsLibrary/writeVideoAtPath(toSavedPhotosAlbum:completionBlock:)` completes.

[`ALAssetsLibraryAccessFailureBlock`](/documentation/AssetsLibrary/ALAssetsLibraryAccessFailureBlock)

Signature for the block executed if the user does not grant access to the caller to access the data managed by the framework.

[`ALAssetsLibraryGroupResultBlock`](/documentation/AssetsLibrary/ALAssetsLibraryGroupResultBlock)

Signature for the block executed if the user grants access to the caller to access the data managed by the framework..

[`ALAuthorizationStatus`](/documentation/AssetsLibrary/ALAuthorizationStatus)

Constants to indicate authorization status.

[Notification Keys](/documentation/AssetsLibrary/notification-keys)

Keys used to get values from the user information dictionary of the [`ALAssetsLibraryChangedNotification`](/documentation/AssetsLibrary/ALAssetsLibraryChangedNotification) notification.

[Error Domain](/documentation/AssetsLibrary/error-domain)

Constant for the AssetsLibrary domain.

[Error Codes](/documentation/AssetsLibrary/error-codes)

AssetsLibrary-related error codes

### Notifications

[`ALAssetsLibraryChangedNotification`](/documentation/AssetsLibrary/ALAssetsLibraryChangedNotification)

Sent when the contents of the assets library have changed from under the app that is using the data.

## Relationships

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)