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
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.