Task is simple: I need to create wrapper that delegates everything to wrapped object. Only the type of wrapped object is a protocol that contains optional methods. My wrapper is to implement the same protocol.
What do I do about optional methods? I can:
- I can implement them in my wrapper. But if they are not implemented by the object that gets wrapped what do I return from this implementations?
- Not implement them. In that case the wrapper object will not provide some of functionality of the wrapped object which I don't want.
Are there any better options? Please note that I am working in Swift.