Created
June 20, 2018 20:32
-
-
Save paulw11/d74a17780e4ceee57bf3d516a6e08313 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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