0

I have a tabbed application. I want AddressBook to appear in one of my tabs. The following code works, but AddressBook appears not in the tab itself, but in the entire view of the application.

_addressBookController = [[ABPeoplePickerNavigationController alloc] init];

[_addressBookController setPeoplePickerDelegate:self];

[self presentViewController:_addressBookController animated:YES completion:nil];
dimabin
  • 107
  • 1
  • 6

1 Answers1

0

The following code helped me:

[self.view addSubview:_addressBookController.view];
[self addChildViewController:_addressBookController];
[_addressBookController didMoveToParentViewController:nil];

instead of

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

I also replaced

[_addressBookController dismissViewControllerAnimated:YES completion:nil];

with

[_addressBookController.view removeFromSuperview];
dimabin
  • 107
  • 1
  • 6