swift - Syntax for method hiding -
what syntax method hiding in swift? i've tried bunch of options in playground, keep getting errors. haven't been able find documentation on either.
in superclass:
func performfunction() { print("performing function...") }
in subclass, tried couple different options not seem work
new func performfunction() { print("function...") }
and
func new performfunction() { print("function...") }
you're looking override
keyword:
class subclass: parentclass { override func performfunction() { println("function...") } }
see the swift programming language: inheritance more info.
Comments
Post a Comment