Use - (BOOL) isVisible (so BOOL visible = [self.window isVisible] to determine if the window is hidden or not, and if you want to hide or show the window, use this: [self.window setHidden:YES] And, obviously , you pass NO to display it.
Edit
Sorry, use the - (void) setIsVisible:(BOOL) yourBOOL method instead of the setHidden method.
Hope I helped.
source share