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

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.

主站蜘蛛池模板: 天水市| 长寿区| 成安县| 突泉县| 莎车县| 丹江口市| 勐海县| 开鲁县| 格尔木市| 涡阳县| 斗六市| 宁安市| 江油市| 新平| 双辽市| 驻马店市| 贵南县| 铜山县| 秦安县| 日土县| 望都县| 梁山县| 和平区| 景德镇市| 吉木萨尔县| 林州市| 益阳市| 孝昌县| 郁南县| 盖州市| 泰兴市| 肇源县| 保德县| 读书| 清河县| 水富县| 广南县| 轮台县| 习水县| 蓝山县| 岑溪市|