I'm working at a custom control that presents different handles. I want to be sure that the selected handle has a Z-index grater then the others handles.
Is there a way to swap view order?
I found this function sortSubviewsUsingFunction:context:
but i can't understand whether this is the right solution.
Cocoa introduced a new API in macOS 10.0.
It's similar to iOS, you can pass another view to be displayed below or above.
[self.view addSubview:myView positioned:NSWindowBelow relativeTo:myViewInBackground];
Checkout the documentation; in my experience NSWindowBelow
and NSWindowAbove
seemed reversed though.