1
對不起,如果這不是一個具體的問題,但你能提出一些方法來解決泛型參數循環依賴?Swift泛型:參數循環依賴分辨率
我有兩種類型:
typealias RiskListPresenter = ListPresenter<RiskListViewController, ...> // <View: ListViewType (generic protocol)>
typealias RiskListViewController = SectionedListViewController<RiskListPresenter, ...> // <Presenter: ListPresenterType (generic protocol), ...>
的事情是,演示者需要知道的視圖類型調用方法來填充它,並在視圖控制器需要知道主持人的類型進行實例化。
我試過一個依賴注入庫浸,但我無法注入一個泛型類型。也許還有其他一些技巧?