XCode 6.4, for iOS 8.4, ARC enabled
Obviously lots of ways of doing it. The one that has worked for me is the following...
@property(nonatomic, readonly, getter=isKeyWindow) BOOL keyWindow
This can be used in any view controller in the following way,
[self.view.window isKeyWindow]
If you call this property in -(void)viewDidLoad
you get 0, then if you call this after -(void)viewDidAppear:(BOOL)animated
you get 1.
Hope this helps someone. Thanks! Cheers.