AirXygène
AirXygène

Reputation: 2921

CNContactPickerViewController in popover (iOS)

Is there any way to get a popover showing a Contact picker ?

I tried this (and many other variants) with no results... (this is an IBAction method in my controller that should show the popover when "sourceView" is tapped)

I always get a full screen modal presentation of the contact picker, not a popover (my tests are on ipPad simulator).

     CNContactPickerViewController  *picker = [CNContactPickerViewController new] ;
     picker.delegate                                 = self ;
     picker.popoverPresentationController.sourceView = sourceView ;
     picker.popoverPresentationController.sourceRect = sourceView.bounds ;
     picker.popoverPresentationController.permittedArrowDirections   = UIPopoverArrowDirectionUp | UIPopoverArrowDirectionDown ;

     [self presentViewController:picker
                        animated:YES
                      completion:nil] ;

Upvotes: 0

Views: 334

Answers (1)

rmaddy
rmaddy

Reputation: 318774

Not specific to CNContactPickerViewController but you would need to set the view controller's modalPresentationStyle to UIModalPresentationPopover.

Upvotes: 1

Related Questions