The error message is quite explicit:
An instance override method should be as accessible as declaring its override.
This means that the method should not have a lower level of access than the method that it overrides.
For example, this class:
public class Superclass {
internal func doSomething() {
...
}
}
You cannot override doSomething
with a method that is less accessible than interal
. eg.
public class Subclass : Superclass {
private override func doSomething() {
}
}
:
public class Subclass : Superclass {
public override func doSomething() {
super.doSomething()
}
}
, , .