protocol SomeProtocol {
var mustBeSettable: String { get set }
}
class Stage1: SomeProtocol {
//Here "mustBeSettable" should be {get set}
}
class Stage2: SomeProtocol {
//Here "mustBeSettable" should be {get} only
}
in Stage1 class I need access for "mustBeSettable" as {get set}, where as in Stage2 class "mustBeSettable" should be {get} only. but same property I need to use in both classes.
The possible solution is to do it in reverse order, make originally read-only at protocol level (otherwise it would not be possible to fulfil protocol requirements):