Swift小技巧(持续更新)
程序员文章站
2022-07-02 19:20:50
...
1.Swift强制旋转屏幕设置
关键代码:
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
let value = UIInterfaceOrientation.portrait.rawValue
UIDevice.current.setValue(value, forKey: "orientation")
}
未完待续~~~