[self.view bringSubviewToFront: handle];
Ah, in that case, this looks a little hackish, but you could always add a category to do the following: stackoverflow.com/questions/4236304/
Assuming that handle is an object that is/inherits from UIView. If this isn't what you're looking for, then by all means, go with sortSubviewsUsingFunction:context:, in which case you'll need to alter the individual tag properties for each subview, and sort accordingly.
I'm working on OSX non iOS... but +1 because I can search for similar functions.
No problem! I can't say authoritatively that it would be faster, but my thought would be a solid yes. This hinges on the internals of sortSubviewUsingFunction:context:, which I can't comment on. I imagine, however, that it works something like this: 1) manipulate the internal array of subview pointers, then 2) repaint the UI. Certainly ours will be faster for step 1, given that it doesn't iterate through all the subviews like the sort would. For step 2, it's probably either faster or equal, in that the implementation will either repaint all (ours is faster) or repaint just the change (equal).
Thank you, I need to understand if this solution, in terms of performance, is better then the sortSubviewsUsingFunction
Yes, sortSubviewsUsingFunction:context: can do what you're looking to do, however it might be overkill if all you'd like is for one particular view to sit on top of the (unordered) others. In that case, you should look into the bringSubviewToFront: method of UIView. That way, you could do something like this in your IBAction for bringing up the handle: