Swift小技巧(持续更新)

1.Swift强制旋转屏幕设置

关键代码:

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        let value = UIInterfaceOrientation.portrait.rawValue
        UIDevice.current.setValue(value, forKey: "orientation")
    }

未完待续~~~

你可能感兴趣的:(Swift小技巧(持续更新))