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

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

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

---

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)