<!--
{
  "availability" : [
    "macOS: 10.13.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PhotosUI",
  "identifier" : "/documentation/PhotosUI/PHProjectExtensionContext",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "PhotosUI"
    ],
    "preciseIdentifier" : "c:objc(cs)PHProjectExtensionContext"
  },
  "title" : "PHProjectExtensionContext"
}
-->

# PHProjectExtensionContext

An object that provides Photos project extensions with access to the underlying project, as well as to the user’s photo library for editing.

```
class PHProjectExtensionContext
```

## Overview

When a Photos project extension is initialized, it is handed an extension context object. This object provides the extension with access to the underlying project, as well as the photo library from which assets are fetched and edited.

## Topics

### Accessing the Project and the Photo Library

[`var project: PHProject`](/documentation/PhotosUI/PHProjectExtensionContext/project)

A read-only version of the project being edited.

[`var photoLibrary: PHPhotoLibrary`](/documentation/PhotosUI/PHProjectExtensionContext/photoLibrary)

A read-only version of the photo library being modified.

### Updating Assets

[`func showEditor(for: PHAsset)`](/documentation/PhotosUI/PHProjectExtensionContext/showEditor(for:))

Invokes the built-in photo editor for the given asset.

[`func updatedProjectInfo(from: PHProjectInfo?, completion: (PHProjectInfo?) -> Void) -> Progress`](/documentation/PhotosUI/PHProjectExtensionContext/updatedProjectInfo(from:completion:))

Creates an updated [`PHProjectInfo`](/documentation/PhotosUI/PHProjectInfo) instance from existing project information and current assets.

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CVarArg`](/documentation/Swift/CVarArg)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

[`Equatable`](/documentation/Swift/Equatable)

### Inherits From

[`NSExtensionContext`](/documentation/Foundation/NSExtensionContext)

---

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)