0

I want Cancel action on PKAddPassesViewController to perform some validation but its delegate method addPassesViewControllerDidFinish does not have any property to differentiate between Cancel and AddAll action. Please help to identify which button is tapped to solve this mystery.

Mohit Singhal
  • 43
  • 1
  • 9

1 Answers1

0

Have you tried this ? I know this is a Objective c !

please refer this Link

-(void) addPassesViewControllerDidFinish:(PKAddPassesViewController *)controller {

    if (self.HKPass) {
        PKPassLibrary *pkLibrary = [[PKPassLibrary alloc] init];
        if ([pkLibrary containsPass:self.HKPass]) 
                // add or update clicked
        else 
           // Cancel Clicked   

    }
    [controller dismissModalViewControllerAnimated:YES];

}
Vicky_Vignesh
  • 584
  • 2
  • 14
  • It will not work on second time tap of Cancel button but its doable right now for my one of case but failed in other case. Thanks !! – Mohit Singhal Jun 21 '19 at 08:14