Swift中的作用域关键字

用关键字private, fileprivate, internal, public, open修饰的func

关键字 类,结构体,枚举间(文件内) 文件间(file) 模块间(module)
private 不可访问,不可重写 不可访问,不可重写 不可访问,不可重写
fileprivate 可访问,可重写 不可访问,不可重写 不可访问,不可重写
internal 可访问,可重写 可访问,可重写 不可访问,不可重写
public 可访问,可重写 可访问,可重写 可访问,不可重写
open 可访问,可重写 可访问,可重写 可访问,可重写

注: 用final修饰的函数不能被重写

你可能感兴趣的:(Swift中的作用域关键字)