<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macOS: 13.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/photosPicker(isPresented:selection:matching:preferredItemEncoding:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewP07_Photosb1_aB0E12photosPicker11isPresented9selection8matching21preferredItemEncodingQrAA7BindingVySbG_AKyAD0dfL0VSgG0dB014PHPickerFilterVSgAN0M20DisambiguationPolicyVtF"
  },
  "title" : "photosPicker(isPresented:selection:matching:preferredItemEncoding:)"
}
-->

# photosPicker(isPresented:selection:matching:preferredItemEncoding:)

Presents a Photos picker that selects a `PhotosPickerItem`.

```
nonisolated func photosPicker(isPresented: Binding<Bool>, selection: Binding<PhotosPickerItem?>, matching filter: PHPickerFilter? = nil, preferredItemEncoding: PhotosPickerItem.EncodingDisambiguationPolicy = .automatic) -> some View
```

## Parameters

`isPresented`

The binding to whether the Photos picker should be shown.

`selection`

The item being shown and selected in the Photos picker.

`filter`

Types of items that can be shown. Default is `nil`. Setting it to `nil` means all supported types can be shown.

`preferredItemEncoding`

The encoding disambiguation policy of the selected item. Default is `.automatic`. Setting it to `.automatic` means the best encoding determined by the system will be used.

## Discussion

The user explicitly grants access only to items they choose, so photo library access authorization is not needed.

---

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)