I am converting my view controllers into a split view controller with a Universal Storyboard to show two views on screen at the same time, which will only appear on iPad - only one will be visible on iPhone. I have a situation where a UIBarButtonItem
is only relevant when only one view controllers is on screen. I want this button removed or hidden when both view controllers in the split view controller are visible.
I cannot use Size Classes to do this, since the button I want removed is in the master view controller (actually I have button in both the master and detail that should be removed), which won't have a size class of Regular w Regular h. Plus Interface Builder doesn't provide an "Installed" option for UIBarButtonItem
s, and I cannot check size classes in code because the app will also run on iOS 7.
How can I remove/hide a UIBarButtonItem
when both the master and detail view controller are on screen? Or I could not add this button in IB, then add it in code when deemed appropriate, but how would I know if both view controllers will be on screen?