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

# photosPicker(isPresented:selection:maxSelectionCount:selectionBehavior:matching:preferredItemEncoding:photoLibrary:)

Presents a Photos picker that selects a collection of `PhotosPickerItem` from a given photo library.

```
nonisolated func photosPicker(isPresented: Binding<Bool>, selection: Binding<[PhotosPickerItem]>, maxSelectionCount: Int? = nil, selectionBehavior: PhotosPickerSelectionBehavior = .default, matching filter: PHPickerFilter? = nil, preferredItemEncoding: PhotosPickerItem.EncodingDisambiguationPolicy = .automatic, photoLibrary: PHPhotoLibrary) -> some View
```

## Parameters

`isPresented`

The binding to whether the Photos picker should be shown.

`selection`

All items being shown and selected in the Photos picker.

`maxSelectionCount`

The maximum number of items that can be selected. Default is `nil`. Setting it to `nil` means maximum supported by the system.

`selectionBehavior`

The selection behavior of the Photos picker. Default is `.default`.

`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 selected items. Default is `.automatic`. Setting it to `.automatic` means the best encoding determined by the system will be used.

`photoLibrary`

The photo library to choose from.

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