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

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.

主站蜘蛛池模板: 中卫市| 鞍山市| 宁蒗| 宜章县| 江口县| 阿拉尔市| 织金县| 南召县| 修武县| 奉贤区| 旬阳县| 商河县| 闸北区| 澎湖县| 东平县| 隆德县| 海南省| 沈阳市| 台前县| 砚山县| 南安市| 乐安县| 定兴县| 宣汉县| 门头沟区| 宜兴市| 荣成市| 象州县| 巴青县| 浦县| 嘉黎县| 保亭| 阿拉善左旗| 常宁市| 桂林市| 东明县| 焉耆| 嘉兴市| 中西区| 崇信县| 晋中市|