Skip to content

Instantly share code, notes, and snippets.

@mayooresan
Last active July 12, 2017 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mayooresan/688977ca26c280c8751cf394085f31cc to your computer and use it in GitHub Desktop.
Save mayooresan/688977ca26c280c8751cf394085f31cc to your computer and use it in GitHub Desktop.
class Cat : Eye{
var isIdle: Bool? = true
func closeEyesAndSleep() {
if isIdle == true{
print("Cat is sleeping now")
}else{
print("Cat will NOT sleep now")
}
}
func openEyesAndLookAround() {
print("Cat is looking around")
}
}
extension Cat : Animal{
func run() {
isIdle = true
print("Cat is running now")
}
func stop() {
isIdle = false
print("Cat has stopped now")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment