Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replacement for _stdlib_getDemangledTypeName() in Swift 2.2

Tags:

swift

swift2

The latest release of Swift 2.2 removes _stdlib_getDemangledTypeName().

What are my options to replace this?

I'm currently using in debug messages like this:

let debugStr = "\(_stdlib_getDemangledTypeName(self)) -> \(self.versionString) (\(self.versionInfo))"
like image 612
Richard Stelling Avatar asked Dec 02 '22 15:12

Richard Stelling


1 Answers

You can get pretty descriptions of type names through the String initialiser. This should suffice as a replacement for _stdlib_getDemangledTypeName.

Example:

String(self.dynamicType)
like image 67
Benjamin Mayo Avatar answered Dec 10 '22 11:12

Benjamin Mayo