let screenW = UIScreen.main.bounds.size.width
let screenH = UIScreen.main.bounds.size.height
fileprivate let timeInterval = 0.1
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.setupUI()
}
func setupUI() {
self.view.addSubview(self.playBtn)
}
lazy var playBtn: UIButton = {
let playBtn = UIButton(frame: CGRect(x: screenW*0.5, y: screenH*0.5, width: screenW*0.5, height: screenH*0.5))
playBtn.backgroundColor = UIColor(red: 66/255.0, green: 75/255.0, blue: 226/255.0, alpha: 1.0)
playBtn .setImage(UIImage(named: "play"), for: .normal)
playBtn.addTarget(self, action: #selector(playBtnClick), for: .touchUpInside)
return playBtn
}()
@objc func playBtnClick() {
}
网友评论