Created
December 26, 2022 10:13
-
-
Save ldct/2bd3be5a81097a65f70a130f312d9c7b to your computer and use it in GitHub Desktop.
child
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
class SuperClass { | |
public var customInt: Int? { | |
didSet { | |
print("super") | |
} | |
} | |
} | |
class ChildClass: SuperClass { | |
override public var customInt: Int? { | |
didSet { | |
print("child") | |
} | |
} | |
} | |
var obj: ChildClass | |
obj = ChildClass() | |
obj.customInt = 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment