Structures inheritance in Swift
Forums:
protocol PText {
func toText() -> String
}
struct Point: PText {
var x, y: Int
func toText() -> String {
return "x = \(x); y = \(y)"
}
}
struct RedPoint: Point {} //<- Error
- Log in to post comments