📜  swift set view z order front - Swift 代码示例

📅  最后修改于: 2022-03-11 15:00:58.644000             🧑  作者: Mango

代码示例1
//https://stackoverflow.com/a/4631895/13171606
//in controller class
var myView = UIView()

override func viewDidLoad() {
        super.viewDidLoad()
  myView.layer.zPosition = 1 //this line will order view on front
}

//if you get any error using "zPosition" then import following 
//swift
import QuartzCore
//Or for obj c
#import QuartzCore.h is for obj c