改变代码的横竖屏 3.0
override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask
3.0.2
func supportedInterfaceOrientations(for window: UIWindow?) -> UIInterfaceOrientationMask{ return .portrait }
加载URL 3.0
let url = Bundle.main.urlForResource("main.json", withExtension: nil)
3.0.2
let url = Bundle.main.url(forResource: "main.json", withExtension: nil)
GCD 延迟加载 3.0
DispatchQueue.main.after(when: DispatchTime.now() + 1) { }
3.0.2
let dispatchTime = DispatchTime.now() + 1 DispatchQueue.main.asyncAfter(deadline: dispatchTime) { }