I want to make a custom Formatter to strip any white space. Following Creating a Custom Formatter: need to at least implement these two methods:
class SanSpaceFormatter: Formatter {
override func string(for obj: Any?) -> String? {
// what's obj? How to cast Any? to something?
"placeholder for now"
}
override func getObjectValue(_ obj: AutoreleasingUnsafeMutablePointer<AnyObject?>?, for string: String, errorDescription error: AutoreleasingUnsafeMutablePointer<NSString?>?) -> Bool {
// obj is what?
false // placeholder for now
}
}
they don't look very Swift...
Please help