I'm trying to override the debugDescription
property when displaying the value of NSDate
objects in the Xcode debugger.
My extension code:
import Foundation
extension NSDate {
public override var debugDescription: String {
return "FOOFOOFOO"
}
public func yeah() -> String {
return "yeah!"
}
}
I've confirmed that the file with my extension code is included in the test project targets as I'm able to call the yeah
function and print
it successfully in the debugger's output. However, I can't seem to get the debugDescription
property to get used.
Note my actual goal is to do what I did in Objective-C previously (see this question for details), but struggling so far with how to do it in Swift.