Customize the background color and title of a UINavigationBar and the status bar

Here’s an example of how to customize the background and title color of a UINavigationBar without having to use an image (in this case, a blue background with a white title AND white status bar):

    // Set the navigation bar to blue
    [[UINavigationBar appearance] setBarTintColor:[UIColor blueColor]];
    [[UINavigationBar appearance] setTranslucent:NO];

    // Set the navigation bar's title text to white
    [[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}];

    // Here's where it gets a little weird: we set the barStyle property to *UIBarStyleBlack* to achieve a *white* status bar.
    [[UINavigationBar appearance] setBarStyle:UIBarStyleBlack];