Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't play well with UIMenuController under iOS 5.1(b) #35

Closed
bzotto opened this issue Dec 7, 2011 · 5 comments
Closed

Doesn't play well with UIMenuController under iOS 5.1(b) #35

bzotto opened this issue Dec 7, 2011 · 5 comments

Comments

@bzotto
Copy link

bzotto commented Dec 7, 2011

Heads-up. Under iOS 5.1b, once the HUD has appeared and then disappeared, invocations elsewhere in the UI of UIMenuController will fail (ie the menu will simply not appear), both in custom views but also in system-standard text views.

It's something to do with the interactions in window ordering, though I'm not sure whether it's a beta-only bug that Apple's introduced, or whether this is going to be a production problem. I'm not well enough versed in the UIWindow stuff to understand what's happening exactly, but possibly the UIMenuController lives on its own window and that's getting shuffled behind when the HUD dismisses?

Opening another modal view controller (e.g. the mail compose controller, or any custom form sheet, etc) "clears" the condition and the menu will function again.

Workaround: If I turn the HUD into a UIView subclass (rather than UIWindow) and simply add it as a subview to my current known window, I find it no longer exhibits this interaction.

@samvermette
Copy link
Contributor

Thanks @bzotto, I will look into this shortly.

@samvermette
Copy link
Contributor

I'm currently away from home and don't have access to the 5.1 SDK, but you can start by checking the value of previousKeyWindow at the end of the show method and then in the dismiss method. My guess would be that your UIMenuController instance isn't assigned to it (maybe because of its windowLevel property, haven't looked at the 5.1 doc yet), so it's not made the key window again upon the HUD's dismiss.

@bzotto
Copy link
Author

bzotto commented Dec 11, 2011

Hey Sam,
Thanks for the comment. It looks like this issue doesn't appear with your
stock SVProgressHUD. I've been playing with a modified fork from BarrettJ,
and the HUD's UIWindow seems to linger on in the window list after it
dismisses there, which looks suspicious. I'll keep poking at it and let him
(and you) know if I root-cause it.

Thanks, sorry for the confusion.

Ben

On Sun, Dec 11, 2011 at 3:49 AM, Sam Vermette <
reply@reply.github.com

wrote:

I'm currently away from home and don't have access to the 5.1 SDK, but you
can start by checking the value of previousKeyWindow at the end of the
show method and then in the dismiss method. My guess would be that your
UIMenuController instance isn't assigned to it (maybe because of its
windowLevel property, haven't looked at the 5.1 doc yet), so it's not made
the key window again upon the HUD's dismiss.


Reply to this email directly or view it on GitHub:
#35 (comment)

Cocoa Box -- http://www.cocoabox.com
Makers of fine applications for iPad and iPhone
Follow us on Twitter at http://twitter.com/cocoabox

@bzotto
Copy link
Author

bzotto commented Dec 11, 2011

OK, nevermind. Not only was this not an issue with core SVProgressHUD, it was not an issue with Barrett's fork, either. I'd introduced a subtle behavior change in the window search when I retrofitted it for iOS 3.x compatibility that only caused a problem on 5.1b, weirly. This one was all me. Sorry guys, and thanks.

@bzotto bzotto closed this as completed Dec 11, 2011
@samvermette
Copy link
Contributor

Hah, ok. Thanks for the follow-up!

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

No branches or pull requests

2 participants