Example (Apple Official)
struct Point {
let x: Int, y: Int
}
extension Point: CustomStringConvertible {
var description: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 0, y: 10)
print(p)
Example (Apple Official)
struct Point {
let x: Int, y: Int
}
extension Point: CustomStringConvertible {
var description: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 0, y: 10)
print(p)