Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

Swift Conform Class To Swift Protocol

// conform class to Greet protocol
class Employee: Greet {

  // implementation of property
  var name = "Perry"

  // implementation of method
  func message() {
    print("Good Morning!")
  }
}
 
PREVIOUS NEXT
Tagged: #Swift #Conform #Class #To #Swift #Protocol
ADD COMMENT
Topic
Name
9+9 =