When using Apple's UISplitViewController, the master view has a black toolbar when in portrait mode and gray when in landscape.
I have created a label inside a UIView on the toolbar, as described here: Adding a UILabel to a UIToolbar, but by default the text is black which means it is only visible in landscape mode.
How should I code my view controller so it can change the text color so it is always visible, and ideally to match the way Apple apps like Mail work (white in portrait and dark gray in landscape) ?
...later...
Following the direction in Alan Moore's answer, I decided to use code like this:
UIInterfaceOrientation o = [UIApplication sharedApplication].statusBarOrientation;
if (UIDeviceOrientationIsPortrait(o))
label.textColor = [UIColor whiteColor];
else
label.textColor = [UIColor darkTextColor];
This is called from my viewDidLoad and didRotateFromInterfaceOrientation methods. Seems to me that didRotate is better than shouldRotate for this case.
Also note I am querying the statusBar, because in my view self.interfaceOrientation always returns 1. This is also noted here: Determine UIInterfaceOrientation on iPad.
Not 100% sure that darkText is the right color for landscape.