Swift 3: The difference between Public and Internal access modifiers?

前端 未结 6 1764
孤独总比滥情好
孤独总比滥情好 2020-12-15 09:16

I read the Apple\'s reference about access modifiers in Swift 3. I read also about the same on stackoverflow but I didn\'t get an answer as the person who asked. As I unders

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-15 09:50

    Depends on access modifier of class, function or property it can be subclassed, overrode, accessible

    Access modifier can be applicable for class, field[About], method. Try to access, subclass or override this.

    • Access to field or method is through a class
    • Inheritance and Open Closed Principle. Successor class(subclass) access modifier should be the same or restrict it(except private <-> fileprivate). Successor method(override) access modifier should be the same or expand it

    [Java access modifiers]

提交回复
热议问题