---
title: "sharedAlbumCreationViewController(_:didCompleteWithError:)"
framework: photosui
role: symbol
role_heading: Instance Method
path: "photosui/phsharedalbumcreationviewcontroller/delegate-swift.protocol/sharedalbumcreationviewcontroller(_:didcompletewitherror:)"
---

# sharedAlbumCreationViewController(_:didCompleteWithError:)

## Declaration

```swift
func sharedAlbumCreationViewController(_ creationViewController: PHSharedAlbumCreationViewController, didCompleteWithError error: (any Error)?)
```

## Discussion

Discussion Called when shared album creation completes. If creation was successful, -[PHSharedAlbumCreationViewController albumIdentifier] will be non-nil and error will be nil. If creation was unsuccessful, -[PHSharedAlbumCreationViewController albumIdentifier] will be nil and error will be non-nil. The creation was cancelled by the user, both -[PHSharedAlbumCreationViewController albumIdentifier] and error will be nil. The view controller won’t be dismissed automatically when this method is called.
