How can I go about achieving this
Property has to be readwrite for inner implementation in class
Property has to be readonly for external interaction to instances of the class
@interface MyObject : NSObject
@property (nonatomic, readonly, strong) NSString *myProperty;
@end
// Class extension
@interface MyObject ()
// Redeclare property read-write
@property (nonatomic, readwrite, strong) NSString *myProperty;
@end
@implementation MyObject
...
class MyObject {
private(set) var myProperty: String
...
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments