Dec 102012

The app I’m working on does not use UIStoryboards, but the previous developer had used ButtonPeoplePicker and when I went to rev BPP I found that it now used UIStoryboards. Hmmm, how can I integrate BPP into my app?

It was easy. First, you load your storyboard:

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil];

This gives you a Storyboard object, note the name that ButtonPicker used. That could collide with other names so you should change it to something like BPP_MainStoryboard_iPhone. Then to bring up the BPP all you have to do is:

ButtonPeoplePicker *svc = [storyboard instantiateViewControllerWithIdentifier:@"ButtonPeoplePicker"];

Where the ButtonPeoplePicker name is the “storyboard id” that I assigned with IB. (It was nil in the code I got, presumably because it wasn’t used.) Then you just do the normal:

self presentViewController:svc animated:YES completion:nil];