overriding static vars in subclasses swift 1.2

后端 未结 4 1847
北海茫月
北海茫月 2021-01-07 16:58

unlike class var, where they can overridden in subclasses, I believe same applies to static as well but unfortunately not. Here\'s an example

4条回答
  •  攒了一身酷
    2021-01-07 17:28

    The documentation says:

    “ static ” methods and properties are now allowed in classes (as an alias for “ class final ”).

    So it is final, which means you cannot override it.

提交回复
热议问题