官术网_书友最值得收藏!

Access control

Access control restricts access to parts of our code from code in other source files and modules. Access levels are as follows:

  • Open and Public accesses enable entities to be used within any source file from their defining module and also in a source file from another module that imports the defining module. Open access enables subclassing, as opposed to Public access, which disallows subclassing.
  • Internal access enables entities to be used within any source file from their defining module, but not in any source file outside of this module.
  • File-private access restricts the use of an entity to its defining source file.
  • Private access restricts the use of an entity to its enclosing declaration.

Swift evolution proposals SE-0025 and SE-0117 explain the motivation, proposed solution, and provide code examples for access levels.

主站蜘蛛池模板: 吉首市| 淄博市| 托里县| 随州市| 富锦市| 崇仁县| 宁陕县| 临高县| 西平县| 辽宁省| 临邑县| 双辽市| 剑阁县| 化德县| 乐至县| 罗城| 侯马市| 宁德市| 罗甸县| 皮山县| 冕宁县| 阜康市| 盱眙县| 安阳市| 仪陇县| 长岭县| 赞皇县| 舟曲县| 枝江市| 金乡县| 昆山市| 靖西县| 铜陵市| 永靖县| 阿荣旗| 托克逊县| 石嘴山市| 松桃| 水城县| 望都县| 安岳县|