Search code examples
iphonekeyboardlegacy

show uiview on top of everything (even keyboard)


In my application, I sometimes show a message to the user and I want it to be on top of everything (even keyboard), like a UIAlertView could do.

I googled it and found the solution which is:

    [[[[UIApplication sharedApplication] delegate] window] addSubview:myViewOnTop];

This works. However this is not documented, so I guess Apple won't accept it, right ?

What do you think about it ? Do you know an Apple legacy way to do it ?

Thanks

Vincent


Solution

  • UIWindow is just a subclass of UIView. Therefore the addSubView function is documented which should make it acceptable :)