Can I make a class conforms to two protocols with same property but different access level attribute?
E.g.
@interface Test () <ProtocolA, ProtocolB> {
}
@end
@protocol ProtocolA <NSObject>
@property(nonatomic, readwrite) id prop;
@end
@protocol ProtocolB <NSObject>
@property(nonatomic, readonly) id prop;
What I’m trying to achieve is to expose prop
only in test environment. In test cases, I’ll set prop
to be a mocked object.
Thanks!
I tried to expose prop
in ProtocolB to be readwrite
and set it successfully in tests, however, this is less ideal since I sacrifice the access level.