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