Here is the Protocols:
protocol WireFrameProtocol{
// router for all normal cases
// like showing login page
}
protocol InteractorProtocol{
var wireFrame: WireFrameProtocol? { get set }
}
protocol HomeWireFrameProtocol: WireFrameProtocol{
// home specific routers
}
protocol HomeInteractorProtocol: InteractorProtocol{
var wireFrame: HomeWireFrameProtocol? { get set }
}
class Test: HomeInteractorProtocol{
var wireFrame: HomeWireFrameProtocol?
}
extension Test: InteractorProtocol{
}
WireFrameProtocol will have all the routing functions. HomeWireFrameProtocol will extend and have some home relating routing only. The test class inherits from HomeInteractorProtocol, which has a var wireFrame: HomeWireFrameProtocol, again HomeWireFrameProtocol is extending WireFrameProtocol.
Is var wireFrame: HomeWireFrameProtocol also represent var wireFrame: WireFrameProtocol?
Ok I realise it now, and fixed my own problem. What I did was
The variable
wireFrame: WireFrameProtocolcan also hold the reference ofHomeWireFrameProtocol.so in Test class I updated: