Is there anyway to simulate the [NSString stringWithFormat:@\"%p\", myVar], from Objective-C, in the new Swift language?
[NSString stringWithFormat:@\"%p\", myVar]
For example:
le
My solution on Swift 3
extension MyClass: CustomStringConvertible { var description: String { return "<\(type(of: self)): 0x\(String(unsafeBitCast(self, to: Int.self), radix: 16, uppercase: false))>" } }
this code create description like default description