The following is a workaround for the "problem" that protocols and their extensions in Swift do not store properties. It seems to "work" but I am wondering what reasons people might have for avoiding it?
fileprivate var strings: [String] = []
protocol SomeProat {
func add(someString: String)
}
extension SomeProat {
func add(someString: String) {
strings.append(someString)
print(strings)
}
}
(I realise this question could be interpreted as subjective btw).