Métodos Swift
class Person {
. . .
// define methods
func greet() {
// method body
}
}
SAMER SAEID
class Person {
. . .
// define methods
func greet() {
// method body
}
}
class Person {
// define a method
func greet() {
print("Hey there!")
}
}
var nick = Person()
// call method
nick.greet()