在Objective-C实例中,数据可以是public,protected或private.例如:
@interface Foo : NSObject
{
@public
int x;
@protected:
int y;
@private:
int z;
}
-(int) apple;
-(int) pear;
-(int) banana;
@end
Run Code Online (Sandbox Code Playgroud)
我没有在Swift参考中找到任何访问修饰符.是否可以限制Swift中数据的可见性?