Created
January 17, 2016 23:50
-
-
Save anonymous/44a108093e45db43b6df to your computer and use it in GitHub Desktop.
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 BaseClass { | |
class var testProperty: String { | |
return "Original" | |
} | |
class func testingFunc()->Self { | |
return self | |
} | |
} | |
class ChildClass { | |
override class var testProperty: String { | |
return "Modified" | |
} | |
} | |
ChildClass.testingFunc().testProperty // should print "Modified" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
class BaseClass {
class var testProperty: String {
return "Original"
}
class func testingFunc()->BaseClass.Type {
return self
}
}
class ChildClass: BaseClass {
override class var testProperty: String {
return "Modified"
}
}
ChildClass.testingFunc().testProperty prints "Modified"