Hopefully this isn't too confusing.
I have a main view controller (MainView) with a stackview at the bottom of the view and inside the stackview I have three views. Inside one the views (lets call it footerView) i'm adding a little tooltipView - and because footerView is nestled inside a stackview at the bottom of MainView - it's got some overlap with the other views. I want to tell the tooltipView to be on top of all the views but it's not working. Inside footerView - it has no superview (I presume because it's inside a stackview) so I can't use parentView.bringSubviewToFront(childView).
What could I do instead? Is delegation through the layers the only way?
You can manually set the
zPositionof each layer. The default value is 0 so you may not get the desired value you want without manually controlling it. As an example you could tryor
Setting it to 1 will make it above other views that default to 0 or setting it to
.greatestFiniteMagnitudewill always have it at the front.Check out this answer on zPostion and Apple's documentation on zPostion.