Skip to content

Conversation

@yageek
Copy link

@yageek yageek commented Feb 14, 2014

Keep origin status bar style if possible.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is presentingViewController non-nil for the only view controller in a window?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If presentingViewControlleris nil, a message is sent to nil and the test fails
if([self.presentingViewController respondsToSelector:@selector(preferredStatusBarStyle)]) equals if(nil) and the code below will not be called.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While the above is true, I was asking because I'm not positive that presentingViewController is ever non-nil. Since this view controller is never really ever presented, and simply used as the root view controller of a window that we control. The only way I could see this working is if the presentedViewController that we are querying is on the key window's root view controller and not our own window.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. I did tests with a tab bar controller based application and a navigation controller based application and the behavior is different. With the tab bar based application, the presentingViewController is the controller within the tab bar that presented the HUD. With the navigation controller, presentingViewController is nil.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants