How can I present a modal view controller after selecting a contact?

I am trying to present a modal view controller after selecting a contact, and it does not seem to work.

In my -

(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person

I reject peoplePicker, instantiate my new view controller, and then present it with

[self.navigationController presentModalViewController:newController animated:YES];

and it does not work. However, if I PUSH the view controller works with this code:

[self.navigationController pushViewController:newController animated:YES];

How can i do this?

Thank,

0
source share
1 answer

Just call presentModalViewController on your own controller instead of the navigation controller. If you are in the context of a UIViewController: [self presentModalViewController: newController animated: YES];

+1
source

Source: https://habr.com/ru/post/1787701/


All Articles