在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ 1 import UIKit 2 3 class StandardViewController: UIViewController { 4 5 //1、视图即将显示 6 override func viewWillAppear(_ animated: Bool) { 7 super.viewWillAppear(animated) 8 9 } 10 11 //2、UIKit将更新当前布局边距 12 @available(iOS 11.0, *) 13 override func viewLayoutMarginsDidChange() { 14 super.viewLayoutMarginsDidChange() 15 16 } 17 18 //3、UIKit将更新安全区域内边距 19 @available(iOS 11.0, *) 20 override func viewSafeAreaInsetsDidChange() { 21 super.viewSafeAreaInsetsDidChange() 22 23 } 24 25 //4、将要布局子空间 26 override func viewWillLayoutSubviews() { 27 super.viewWillLayoutSubviews() 28 29 } 30 31 //5、已布局子空间 32 override func viewDidLayoutSubviews() { 33 super.viewDidLayoutSubviews() 34 35 } 36 37 //6、视图已经出现 38 override func viewDidAppear(_ animated: Bool) { 39 super.viewDidAppear(animated) 40 } 41 42 //7、最后即将显示视图 43 override func viewDidLoad() { 44 super.viewDidLoad() 45 // Do any additional setup after loading the view. 46 47 } 48 49 //8、视图即将消失 50 override func viewWillDisappear(_ animated: Bool) { 51 super.viewWillDisappear(animated) 52 53 } 54 55 //9、视图已消失 56 override func viewDidDisappear(_ animated: Bool) { 57 super.viewDidDisappear(animated) 58 59 } 60 /* 61 // MARK: - Navigation 62 63 // In a storyboard-based application, you will often want to do a little preparation before navigation 64 override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 65 // Get the new view controller using segue.destination. 66 // Pass the selected object to the new view controller. 67 } 68 */ 69 }
|
请发表评论