Calling NSStringFromClass on a Swift Class in Objective-C returns module mangled name

前端 未结 7 813
遇见更好的自我
遇见更好的自我 2021-02-07 07:53

I am aware of this question regarding how we can get a readable class name of an objective-c class in Swift.

What I want to achieve is getting the readable class name of

7条回答
  •  北海茫月
    2021-02-07 08:47

    Swift 5.1 solution for NSStringFromClass

    If you want the string description of a class name (say CustomTableViewCell) use:

    String(describing: CustomTableViewCell.self)
    

提交回复
热议问题