<!--
{
  "availability" : [
    "iOS: 27.3.0 -",
    "iPadOS: 27.3.0 -",
    "macOS: 27.3.0 -",
    "visionOS: 27.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/photosPickerOnPrimaryAction(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewP07_Photosb1_aB0E27photosPickerOnPrimaryActionyQryyScMYccF"
  },
  "title" : "photosPickerOnPrimaryAction(_:)"
}
-->

# photosPickerOnPrimaryAction(_:)

Sets the primary action handler for the Photos picker.

```
nonisolated func photosPickerOnPrimaryAction(_ action: @escaping @MainActor () -> Void) -> some View
```

## Parameters

`action`

Action to be performed when the primary action is triggered.

## Return Value

A Photos picker with specified primary action handler.

---

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)