美文网首页
swift Access Controller

swift Access Controller

作者: tom__zhu | 来源:发表于2022-06-03 20:00 被阅读0次

    我来了,swift

    简介

    通过access modifier控制代码的访问权限,用来隐藏一些不必要的实现细节

    所有modifier

    Controls Description
    public declarations are accessible from everywhere
    private declarations are accessible only within the defined class or struct
    fileprivate declarations are accessible only within the current swift file
    internal declarations are accessible only within the defined module (default)

    适用范围

    适用于各个类型(class/struct/enum/func/property/initializers/subscripts)

    如何适用

    文档

    Access Control Syntax

    相关文章

      网友评论

          本文标题:swift Access Controller

          本文链接:https://www.haomeiwen.com/subject/utagprtx.html