YuKagi
YuKagi

Reputation: 2501

How do you ensure a UIView to be frontmost?

I have UILabels animating on my mainView and I want to have a custom UIView pop onto the main view when a button is pressed. The labels animating in the background continue to animate and the problem that I'm having is that the labels animate on top of my custom UIView.

Does anyone know how I can ensure that my custom UIView is the front-most view so that the UILabels animate behind it?

Upvotes: 0

Views: 213

Answers (2)

NSResponder
NSResponder

Reputation: 16861

@implementation UIView (moveToFront)

- (void) moveToFront {  [[self superview] bringSubviewToFront:self]; }

@end

Upvotes: 0

Eiko
Eiko

Reputation: 25632

You may want to look at

- (void)bringSubviewToFront:(UIView *)view

in the parent view.

Upvotes: 4

Related Questions