IOS Swift3.1 打印视图生命周期

xiaoxiao2021-02-28  88

import UIKit class ViewController: UIViewController {     override func viewDidLoad() {         super.viewDidLoad()         // Do any additional setup after loading the view, typically from a nib.     }

    override func didReceiveMemoryWarning() {

        super.didReceiveMemoryWarning()         // Dispose of any resources that can be recreated.     }     //     override func loadView() {         super.loadView()         print( object_getClass(self), "-->", #function )     }          override func viewWillAppear(_ animated: Bool) {         super.viewWillAppear(animated)         print( object_getClass(self), "-->", #function )     }          override func viewWillLayoutSubviews() {         super.viewWillLayoutSubviews()         print( object_getClass(self), "-->", #function )     }          override func viewDidLayoutSubviews() {         super.viewDidLayoutSubviews()         print( object_getClass(self), "-->", #function )     }          override func viewDidAppear(_ animated: Bool) {         super.viewDidAppear(animated)         print( object_getClass(self), "-->", #function )     }          override func viewWillDisappear(_ animated: Bool) {         super.viewDidAppear(animated)         print( object_getClass(self), "-->", #function )     }          override func viewDidDisappear(_ animated: Bool) {         super.viewDidAppear(animated)         print( object_getClass(self), "-->", #function )     }          // }
转载请注明原文地址: https://www.6miu.com/read-54621.html

最新回复(0)