iOS中的只读属性

目录
1 OC只读,Swift设置set私有private(set)
public private(set) var someKey: String
当外部调用set方法时的报错信息:
Cannot assign to property: 'somekey' setter is inaccessible
OC表示只读readonly
:
@property (nonatomic, strong, readonly) NSString *someKey;