<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: -",
    "macOS: 13.0.0 -",
    "visionOS: -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PhotoKit",
  "identifier" : "/documentation/PhotosUI/PhotosPicker/init(selection:maxSelectionCount:selectionBehavior:matching:preferredItemEncoding:label:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "PhotosUI",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:015_PhotosUI_SwiftB00A6PickerV9selection17maxSelectionCount0E8Behavior8matching21preferredItemEncoding5labelACyxG0cB07BindingVySayAA0adL0VGG_SiSgAA0adgI0V0aB014PHPickerFilterVSgAO0M20DisambiguationPolicyVxyXEtcfc"
  },
  "title" : "init(selection:maxSelectionCount:selectionBehavior:matching:preferredItemEncoding:label:)"
}
-->

# init(selection:maxSelectionCount:selectionBehavior:matching:preferredItemEncoding:label:)

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

```
@preconcurrency nonisolated init(selection: Binding<[PhotosPickerItem]>, maxSelectionCount: Int? = nil, selectionBehavior: PhotosPickerSelectionBehavior = .default, matching filter: PHPickerFilter? = nil, preferredItemEncoding: PhotosPickerItem.EncodingDisambiguationPolicy = .automatic, @ViewBuilder label: @Sendable () -> Label)
```

## Parameters

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

`label`

The view that describes the action of choosing an item.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)