How can I implement class-internal protocols in Swift?
The problem is that
class C {
private protocol P {
func aFunction()
}
private class D: P {
func aFunction() {
//...
}
}
}
results in the error
Declaration is only valid at file scope
Any ideas for bypassing the problem?
Exclusion: I do not refer to class-only protocols, which is possible, of course.