Skip to content

Instantly share code, notes, and snippets.

@MoussaHellal
Created September 23, 2021 19:40
Show Gist options
  • Save MoussaHellal/ab7fbc1373a15738470d0111f4d55d9c to your computer and use it in GitHub Desktop.
Save MoussaHellal/ab7fbc1373a15738470d0111f4d55d9c to your computer and use it in GitHub Desktop.
class Human {
static var name = "Mousa"
class var age : Int {
return 27
}
}
// Type Method : we accessed both properties without even creating an instance of Human Class.
print(Human.name)
print(Human.age)
class SuperHuman: Human {
override static var name = "Super Human" // Cannot override with a stored property 'name'
override class var age : Int {
return 1000
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment