MohAliBou
MohAliBou

Reputation: 109

How to visually display a PKPass without using PKAddPassesViewController?

I am working on a SwiftUI app where I want to display a PKPass visually without using PKAddPassesViewController. The pass needs to be shown in a way that resembles how it would appear in Apple Wallet, but I don’t want the user to be prompted to add it to their Wallet.

I am unsure how to render it properly in a UIView. Ideally, I would like to display it as a preview without relying on Apple’s pass-adding UI. I cannot seem to find any API from Apple that allows this.

Is there a native way to display a PKPass visually without using PKAddPassesViewController? If not, are there any workarounds or custom rendering techniques to achieve this?

Upvotes: 0

Views: 26

Answers (1)

Lovina Hajirawala
Lovina Hajirawala

Reputation: 153

As far as I understood the ask, you want to add multiple passes without presenting this view controller.

For this, use the addPasses(_:withCompletionHandler:) method of PKPassLibrary.

Reference: https://developer.apple.com/documentation/passkit/pkaddpassesviewcontroller

Upvotes: 0

Related Questions