Skip to content

Instantly share code, notes, and snippets.

@matux
Last active May 16, 2016 03:49
Show Gist options
  • Select an option

  • Save matux/ecfd82472d6f50b7553f to your computer and use it in GitHub Desktop.

Select an option

Save matux/ecfd82472d6f50b7553f to your computer and use it in GitHub Desktop.
protocol Protocolable {
func function()
}
extension Protocolable where Self: BaseClass {
func function() {
print("yay")
}
}
extension Class: Protocolable {
}
////////////////////////////////////////////////////////////////////////////////////////////
// separate file
class BaseClass {}
class Class: BaseClass {
func theFunction() {
self.function()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment