I need to re-code in Swift a Kotlin class defined like this:
class A(private val foo: FooInterface = FooBase()) : FooInterface by foo {
...
}
Is the only way to achieve that is by directly extending the class A with the FooInterface protocol and redirecting all calls to a local private Foo instance?
extension A: FooInterface {
func fooFun1() {
self.privateFooInstance.fooFun1()
}
}
What is the most concise way to do that?
Aucun commentaire:
Enregistrer un commentaire