Get class name of UIViewController in swift

后端 未结 9 903
野的像风
野的像风 2020-12-25 11:20

How to get class name of UIViewController Class in swift

In Objective C, we can do something like this :

self.appDelegate = (shAppDeleg         


        
9条回答
  •  滥情空心
    2020-12-25 11:29

    Use String.init(describing: self.classForCoder)

    example:

    let viewControllerName = String.init(describing: self.classForCoder)
    print("ViewController Name: \(viewControllerName)")
    

提交回复
热议问题