init(selection:matching:preferredItemEncoding:photoLibrary:label:)
Creates a picker that selects an item from the photo library you specify and optionally configures the types of items to show, item encoding, and label behavior.
Declaration
@preconcurrency nonisolated init(selection: Binding<PhotosPickerItem?>, matching filter: PHPickerFilter? = nil, preferredItemEncoding: PhotosPickerItem.EncodingDisambiguationPolicy = .automatic, photoLibrary: PHPhotoLibrary, @ViewBuilder label: @Sendable () -> Label)Parameters
- selection:
The item the picker displays in a selected state.
- filter:
The types of items that the picker shows.
- preferredItemEncoding:
The encoding policy of the selection.
- photoLibrary:
The photo library to select from.
- label:
The view that describes the action of choosing an item.