alexanderjarvis / PXAlertView

A drop-in replacement for UIAlertView that is more customisable and skinnable
MIT License
592 stars 95 forks source link

Fixed bug falsely showing status bar on alert display #9

Closed regexident closed 10 years ago

regexident commented 10 years ago

When the current UIViewController has no status bar shown…

…like by implementing:

- (BOOL)prefersStatusBarHidden
{
    return YES;
}

…then PXAlertView currently shows one anyway.

alexanderjarvis commented 10 years ago

Thanks for this. What's your opinion of moving PXAlertView back to a subclass of UIView instead of UIViewController?

It was moved to UIViewController only for overriding the landscape/orientation methods. I had a brief go yesterday at moving it at the same time as the multiple buttons commit using the UIDevice notification but decided to do one thing at a time. If it's moved, would this fix still be relevant?

regexident commented 10 years ago

Well, it was relevant for my project (which does use a "real" UIView backed by a shared UIViewController). Adding the method to the controller fixed it. So I figured it would probably affect PXAlertView too. I checked: It did. So I fixed it and made a pull request. ;) Add above snippet to PXViewController and you'll see what I mean. It's not that disturbing in the demo app, but if the layout of the UIViewController beneath it heavily relies on not having a status bar, then it sure does disturb the experience.

Personally I'd be all for moving PXAlertView into a real UIView subclass. Even if just for the sake of correct naming. It's the first thing that bothered me about PXAlertView. ;) You'd still need a backing UIViewController though, I'd say. For observing orientation changes, at least. The UIDevice notification has the drawback of only allowing you respond to orientation changes once they're already done. No chance for a nice animated shift.

Apropos, should you ever want to add textfields: orientation changes + keyboard changes = p.i.t.a. Be warned. ;)

alexanderjarvis commented 10 years ago

Merged :+1:

Also, I want to move it back to a UIView soon. Thanks for the confirmation that i'll need a backing UIViewController for the orientation methods - I think this is what made me revert my changes.