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

前端 未结 7 817
遇见更好的自我
遇见更好的自我 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:40

    On the latest Swift below worked for me:

    NSStringFromClass(type(of: yourClass!.self))
    

提交回复
热议问题