Contents

init(_:selection:maxSelectionCount:selectionBehavior:matching:preferredItemEncoding:)

Creates a picker with a title and selection, and optionally configures the max selection count, selection behavior, types of items to show, item encoding, and label behavior.

Declaration

nonisolated init<S>(_ title: S, selection: Binding<[PhotosPickerItem]>, maxSelectionCount: Int? = nil, selectionBehavior: PhotosPickerSelectionBehavior = .default, matching filter: PHPickerFilter? = nil, preferredItemEncoding: PhotosPickerItem.EncodingDisambiguationPolicy = .automatic) where S : StringProtocol

Parameters

  • title:

    A string that describes the purpose of showing the picker.

  • selection:

    The items the picker displays in a selected state.

  • maxSelectionCount:

    The maximum number of items available to select.

  • selectionBehavior:

    The selection behavior of the picker.

  • filter:

    The types of items that the picker shows.

  • preferredItemEncoding:

    The encoding policy of the selection.

See Also

Creating a picker with a title