<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PassKit",
  "identifier" : "/documentation/PassKit/PKPassLibrary/replacePass(with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "PassKit (Apple Pay and Wallet)"
    ],
    "preciseIdentifier" : "c:objc(cs)PKPassLibrary(im)replacePassWithPass:"
  },
  "title" : "replacePass(with:)"
}
-->

# replacePass(with:)

Replaces a pass in the user’s pass library with the specified pass.

```
func replacePass(with pass: PKPass) -> Bool
```

## Parameters

`pass`

The new pass.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if PassKit replaces the pass successfully; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

The new pass replaces the existing pass with the same pass type identifier and serial number. If there isn’t such a pass in the user’s pass library, the replacement fails.

---

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)