Skip to content

Instantly share code, notes, and snippets.

@carlosypunto
Last active April 19, 2016 04:08
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 carlosypunto/40a79bffc0aaf4ec44dbf7d4cc8211b4 to your computer and use it in GitHub Desktop.
Save carlosypunto/40a79bffc0aaf4ec44dbf7d4cc8211b4 to your computer and use it in GitHub Desktop.
Swift 2 Abstarct Class
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