Automatically generate a CustomStringConvertible implementation for any Object

102 Views Asked by At

I have to write a lot of code like this:

extension MyData: CustomStringConvertible {
  public var description: String {
      return "x: \(x), y: \(y), z: \(z)"
  }
}

Is there a good way to automatically synthesise this repetitive code?

0

There are 0 best solutions below