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

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.

主站蜘蛛池模板: 弥勒县| 忻城县| 天镇县| 益阳市| 册亨县| 兴隆县| 方城县| 乌什县| 定襄县| 蚌埠市| 西乌| 会泽县| 雅安市| 成都市| 和平县| 黔江区| 炉霍县| 蒙山县| 建阳市| 铁力市| 高邑县| 迁西县| 西宁市| 威信县| 枞阳县| 闻喜县| 新竹县| 四川省| 林西县| 化隆| 迁安市| 利川市| 左云县| 泰宁县| 崇信县| 盖州市| 合川市| 正定县| 乐平市| 集贤县| 九龙县|