2

How to send UIButton to front programmatically. Where I have drag and drop UIButton at storyboard UIView and I have created another custom UIView to display another view after button action is fire.

1 Answer 1

2

There are a number of methods of UIView that allow you to modify the view hierarchy.

bringSubviewToFront:
sendSubviewToBack:
insertSubview:atIndex:
insertSubview:aboveSubview:
insertSubview:belowSubview:
exchangeSubviewAtIndex:withSubviewAtIndex:

Since your views are already inserted into your superview, you could easily call bringSubviewToFront: once for each view in whatever order you like.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.