Swift equivalent of Java toString()
The description property is what you are looking for. This is the property that is accessed when you print a variable containing an object. You can add description to your own classes by adopting the protocol CustomStringConvertible and then implementing the description property. class MyClass: CustomStringConvertible { var val = 17 public var description: String … Read more