Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
protocol Animal{
func run()
func stop()
}
protocol Eye{
func closeEyesAndSleep()
func openEyesAndLookAround()
}
class Cat : Animal, Eye{
func run() {
print("Cat is running now")
}
func stop() {
print("Cat has stopped now")
}
func closeEyesAndSleep() {
print("Cat is sleeping now")
}
func openEyesAndLookAround() {
print("Cat is looking around")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment