My app has a requirement to add multiple passes (a group of the pass) in apple wallet
I have PKAddPassesViewController, and it has a method to add multiple passes but after adding in it, it shows only 1 pass.
//destinationURLs are download file URL
let pkfile1 : Data = try! Data(contentsOf: destinationURL1)
let pkfile2 : Data = try! Data(contentsOf: destinationURL2)
var pkPasses = [PKPass]()
let pass : PKPass = PKPass(data: pkfile1 as Data, error: nil)
let pass1 : PKPass = PKPass(data: pkfile2 as Data, error: nil)
pkPasses.append(pass)
pkPasses.append(pass1)
let vc = PKAddPassesViewController(passes: pkPasses) as PKAddPassesViewController
vc.delegate = self
appDelegate.window?.rootViewController!.present(vc, animated: true, completion: nil)
With this code, I get only 1 proper formatted graph
my screenshot of PKAddPassesViewController's passes