Q:

iOS: setting statusbar color without using UINavigationController

In my iOS application I am using a UINavigationBar without a UINavigationController.  How can I still set the color of the application statusbar to match the color of my UINavigationBar, which is a custom blue color?  Tried but doesn't work:

Setting the UIViewControllerBasedStatusBarAppearance property in the plist doesn't have any effect
Setting the barTintColor of my UINavigationBar does not affect the statusbar, presumably because it's not managed by a UINavigationViewController? 
Setting UINavigationBar.appearance().barTintColor doesn't work either

Any suggestions? 

A:

Ok I just figured it out thanks to the accepted answer in this question:
How to add custom navigation bar to a full-screen VC in iOS 7 and make it tint the status bar to match? 
Adopt the UINavigationBarDelegate protocol in your viewcontroller and implement the following method (Swift):
func positionForBar(bar: UIBarPositioning) -> UIBarPosition {
    return UIBarPosition. TopAttached
}

Apparently, all navigation bars positioned in this way extend their barTintColor to the statusbar.