Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

Methods Swift

class Person {
  
  // define a method
  func greet() {
    print("Hey there!")
  }
}

var nick = Person()

// call method
nick.greet()
 
PREVIOUS NEXT
Tagged: #Methods #Swift
ADD COMMENT
Topic
Name
8+7 =