Consider the following view hierarchy:
let bottomView = UIView()
addSubview(bottomView)
let bottomViewSubview = UIView()
bottomView.addSubview(bottomViewSubview)
let topView = UIView()
addSubview(topView)
// bottomViewSubview.displayOnTopOfTopView() - How?
I'm wondering if there is a possibility in UIKit without changing the view/subview hierarchy, to always display a subview of some view on top of all other views, including views that cover its superview. As far as I know CALayer.zIndex works only within UIView's sublayers, not globally as I need. And I can't change the hierarchy since I want to rely on it in everything else like subviews transforms.
I guess the only option is to create the new view, which is actually on top of the view hierarchy, and manually sync all the transforms for it to appear like it's someone's subview?