Instance Method

addPasses:withCompletionHandler:

Presents lightweight UI for adding multiple passes at once.

Declaration

- (void)addPasses:(NSArray<PKPass *> *)passes withCompletionHandler:(void (^)(PKPassLibraryAddPassesStatus status))completion;

Parameters

passes

The passes being added.

completion

The completion block called after the user selects an action. This block takes the following parameter:

status

A PKPassLibraryAddPassesStatus value that indicates whether the passes were added. If the user selects to review the passes, this status is set to PKPassLibraryShouldReviewPasses. In this case, you must present an instance of PKAddPassesViewController to let the user review and add the passes.

Discussion

Use this method whenever the user initiates an action that generates a single pass (like purchasing a concert ticket) or multiple passes (like checking into a multi-connection flight). The user is asked to confirm the overall action or review the passes individually. If you want to force the user to review individual passes visually before adding them, use an instance of PKAddPassesViewController.

See Also

Adding and Removing Passes

PKPassLibraryAddPassesStatus

Statuses used when adding passes to the pass library.

- canAddFelicaPass

Returns a Boolean value that indicates whether the library can add Felica passes.

- removePass:

Removes the pass from the user’s pass library.

- replacePassWithPass:

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