Avatar
norio_nomura 8/29/2017 2:19 AM
https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/AccessControl.html#//apple_ref/doc/uid/TP40014097-CH41-ID3 Open access applies only to classes and class members, and it differs from public access as follows: - Classes with public access, or any more restrictive access level, can be subclassed only within the module where they’re defined. - Class members with public access, or any more restrictive access level, can be overridden by subclasses only within the module where they’re defined. - Open classes can be subclassed within the module where they’re defined, and within any module that imports the module where they’re defined. - Open class members can be overridden by subclasses within the module where they’re defined, and within any module that imports the module where they’re defined. (edited)
2:23 AM
サブクラスのメンバーとして使えるかどうか?の制限ってあるんだっけ?よくわからない…
2:24 AM
こっちか https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/swift/grammar/access-level-modifier ### public Apply this modifier to a declaration to indicate the declaration can be accessed and subclassed by code in the same module as the declaration. Declarations marked with the public access-level modifier can also be accessed (but not subclassed) by code in a module that imports the module that contains that declaration. (edited)