Swift nested class properties

前端 未结 3 1798
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-29 08:15

Does swift not have nested classes??

For example, I can\'t seem to access the property test of the master class from the nested class.

class master{         


        
3条回答
  •  青春惊慌失措
    2020-11-29 08:22

    Nested for Swift and Java

    • Swift has Nested Types definitions
    • Java has more complex hierarchy of nested class

    Swift's Nested is more similar to Java's Static Nested, as a result you do not have an access to properties of outer class. To get access of outer class you can pass it as a parameter.

提交回复
热议问题