Contents

init(_:selection:matching:preferredItemEncoding:photoLibrary:)

Creates a picker with a title and selection from the photo library you specify, and optionally configures the types of items to show, item encoding, and label behavior.

Declaration

nonisolated init<S>(_ title: S, selection: Binding<PhotosPickerItem?>, matching filter: PHPickerFilter? = nil, preferredItemEncoding: PhotosPickerItem.EncodingDisambiguationPolicy = .automatic, photoLibrary: PHPhotoLibrary) where S : StringProtocol

Parameters

  • title:

    A string that describes the purpose of showing the picker.

  • 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.

See Also

Creating a picker with a title