What's New / App Services, Foundation & Diagnostics

What's new in _PhotosUI_SwiftUI

+3 New~2 DeprecatediOS · macOS · visionOS

_PhotosUI_SwiftUI is a Swift cross-import overlay, not a standalone framework. Its API is available only when a target imports both PhotosUI and SwiftUI. It adds SwiftUI view modifiers for PhotosUI features.

The 27 SDK adds 3 APIs and deprecates 2. New are the ExtensionHostNotifying protocol and the View.photosSharedAlbumPostingSheet modifier. The deprecations are the two View.postToPhotosSharedAlbumSheet overloads, which photosSharedAlbumPostingSheet replaces.

New

3
protocol

ExtensionHostNotifying

NewvisionOS
public protocol ExtensionHostNotifying : AnyObject
Declaration
@MainActor public protocol ExtensionHostNotifying : AnyObject {

    @MainActor func notifyBeganGenerating()

    @MainActor func notifyEndedGenerating()

    @MainActor func notifyReadyForTermination()

    @MainActor func notifyFailure()

    @MainActor func notifyBeganGeneratingEnvironment(withUUID id: UUID)
}
func

View.photosSharedAlbumPostingSheet

NewiOSmacOS
nonisolated public func photosSharedAlbumPostingSheet(isPresented: Binding<Bool>, items: [PhotosPickerItem], defaultAlbumIdentifier: String? = nil, photoLibrary: PHPhotoLibrary, completion: ((Result<String, any Error>) -> Void)? = nil) -> some View

Presents an "Add to Shared Album" sheet that allows the user to post the given items to a shared album.

Parameters

isPresented
The binding to whether the sheet should be shown.
items
The items to be posted to the shared album.
defaultAlbumIdentifier
Identifier for the shared album to be pre-selected. If none provided user can manually choose the shared album in UI.
photoLibrary
Library to choose from.
completion
Called with the result on completion of the request.
func

View.photosSharedAlbumPostingSheet

NewiOSmacOS
nonisolated public func photosSharedAlbumPostingSheet(isPresented: Binding<Bool>, items: [PHPickerResult], defaultAlbumIdentifier: String? = nil, photoLibrary: PHPhotoLibrary, completion: ((Result<String, any Error>) -> Void)? = nil) -> some View

Presents an "Add to Shared Album" sheet that allows the user to post the given items to a shared album.

Parameters

isPresented
The binding to whether the sheet should be shown.
items
The items to be posted to the shared album.
defaultAlbumIdentifier
Identifier for the shared album to be pre-selected. If none provided user can manually choose the shared album in UI.
photoLibrary
Library to choose from.
completion
Called with the result on completion of the request.

Deprecated

2
func

View.postToPhotosSharedAlbumSheet

DeprecatediOS
nonisolated public func postToPhotosSharedAlbumSheet(isPresented: Binding<Bool>, items: [PhotosPickerItem], photoLibrary: PHPhotoLibrary, defaultAlbumIdentifier: String? = nil, completion: ((Result<Void, any Error>) -> Void)? = nil) -> some View

Presents an "Add to Shared Album" sheet that allows the user to post the given items to a shared album.

Parameters

isPresented
The binding to whether the sheet should be shown.
items
The items to be posted to the shared album.
photoLibrary
Library to choose from.
defaultAlbumIdentifier
Identifier for the shared album to be pre-selected. If none provided user can manually choose the shared album in UI.
completion
Called with the result on completion of the request.
func

View.postToPhotosSharedAlbumSheet

DeprecatediOS
nonisolated public func postToPhotosSharedAlbumSheet(isPresented: Binding<Bool>, items: [PHPickerResult], photoLibrary: PHPhotoLibrary, defaultAlbumIdentifier: String? = nil, completion: ((Result<Void, any Error>) -> Void)? = nil) -> some View

Presents an "Add to Shared Album" sheet that allows the user to post the given items to a shared album.

Parameters

isPresented
The binding to whether the sheet should be shown.
items
The items to be posted to the shared album.
photoLibrary
Library to choose from.
defaultAlbumIdentifier
Identifier for the shared album to be pre-selected. If none provided user can manually choose the shared album in UI.
completion
Called with the result on completion of the request.

No APIs match your filter.

← More in App Services, Foundation & Diagnostics