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

来源:互联网 发布:java int 0x 编辑:程序博客网 时间:2024/05/22 04:24
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 )
    }
    
    //////////////////////////////////////////////////////////////////////
}
原创粉丝点击