Last active
April 19, 2016 04:08
-
-
Save carlosypunto/40a79bffc0aaf4ec44dbf7d4cc8211b4 to your computer and use it in GitHub Desktop.
Swift 2 Abstarct Class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol MyInterface { | |
func myMethod() -> String | |
} | |
extension MyInterface { | |
func myMethod() -> String { | |
fatalError("Not Implemented") | |
} | |
} | |
class MyConcreteClass: MyInterface { | |
func myMethod() -> String { | |
return "The output" | |
} | |
} | |
MyConcreteClass().myMethod() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment