Skip to content

Instantly share code, notes, and snippets.

@paulw11
Created June 20, 2018 20:32
Show Gist options
  • Save paulw11/d74a17780e4ceee57bf3d516a6e08313 to your computer and use it in GitHub Desktop.
Save paulw11/d74a17780e4ceee57bf3d516a6e08313 to your computer and use it in GitHub Desktop.
class Father {
public func doSomething() {
print("Did the father thing")
}
}
class Child: Father {
@available (*, unavailable)
override func doSomething() {
print("did the child thing")
}
fileprivate func internal_doSomething() {
super.doSomething()
}
}
class Unrelated {
func operateOnAThing(_ someThing:Father) {
someThing.doSomething()
}
}
let u=Unrelated()
let f = Father()
let c = Child()
u.operateOnAThing(f)
u.operateOnAThing(c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment