Question

My app uses only portrait mode. But ABPeoplePickerNavigationController supports landscape. Is it possible to have ABPeoplePickerNavigationController support only portrait mode?

Was it helpful?

Solution

Subclass it and override shouldAutorotateToInterfaceOrientation:

// .h file
@interface MMABPeoplePickerPortraitOnlyNavigationController : ABPeoplePickerNavigationController
@end

// .m file
@implementation MMABPeoplePickerPortraitOnlyNavigationController

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return UIInterfaceOrientationIsPortrait(interfaceOrientation);
}

@end
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top