AddPassToWalletButton vs. PKAddPassButton

Hello everyone,

I am trying to figure out the difference between the AddPassToWalletButton and the PKAddPassButton. When I read through the Apple Wallet documentation, it always mentions using the PKAddPassButton. Now I'm using SwiftUI, which the PKAddPassButton isn't compatible with. During my research I came across the AddPassToWalletButton (https://developer.apple.com/documentation/passkit/addpasstowalletbutton) and wanted to know whether it is the equivalent of PKAddPassButton (for SwiftUI) and whether it can be used in accordance with the apple developer guidelines (https://developer.apple.com/wallet/add-to-apple-wallet-guidelines/). It got me wondering since the guidelines only refer to the PKAddPassButton.

Thanks for your help.

AddPassToWalletButton is the SwiftUI equivalent of PKAddPassButton. It allows you to present a pass without having to wrap a view controller in SwiftUI. Simply initialise the button with the pass(es) you wish to display: https://developer.apple.com/documentation/passkit/addpasstowalletbutton/3962762-init

AddPassToWalletButton vs. PKAddPassButton
 
 
Q