Let's say we have a Swift protocol:
protocol SomeProtocol: class {
static var someString: String { get }
}
Is there a way to access someString from an extension instance method, like so?
extension SomeProtocol {
public func doSomething() -> String {
return "I'm a \(someString)"
}
}
I get a compiler error:
Static member 'someString' cannot be used on instance of type 'Self'
Is there any way to accomplish this?