---
title: "replacePass(with:)"
framework: passkit
role: symbol
role_heading: Instance Method
path: "passkit/pkpasslibrary/replacepass(with:)"
---

# replacePass(with:)

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

## Declaration

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

## Parameters

- `pass`: The new pass.

## Return Value

Return Value true if PassKit replaces the pass successfully; otherwise, false.

## Discussion

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.

## See Also

### Managing passes

- [isSecureElementPassActivationAvailable](passkit/pkpasslibrary/issecureelementpassactivationavailable.md)
- [activate(_:activationData:completion:)](passkit/pkpasslibrary/activate(_:activationdata:completion:).md)
- [removePass(_:)](passkit/pkpasslibrary/removepass(_:).md)
