View Controller lifecycle methods are not called after init()

98 views Asked by At

I'm facing a strange problem. I'm calling my CommonListViewController in the following way from my main tab bar screen:

self?.navigator.go(module: CommonListBuilder(mode: .vacation), mode: .push(animated: false))

This is my build() method:

func build() -> BaseViewController {
        CommonListViewController(interactor: CommonListInteractor(mode: mode), mode: mode)
    }

This method is called, then CommonListViewController's init is called:

init(
        interactor: CommonListInteractorProtocol,
        mode: CommonListMode
    ) {
        self.interactor = interactor
        self.mode = mode
        self.adapter = CommonListTableAdapter(mode: mode)
        self.searchAdapter = CommonListSearchAdapter()
        super.init()
        interactor.sendMetrics(event: .openScreen, params: mode.paramsForOpenScreen)
    }

But then nothing happens. Loadview(), viewDidLoad() (I'm using breakpoints) and other lifecycle methods are not called, so CommonListViewController is not opening. What can be the reason?

IMPORTANT: This happens not on the first launch, but only after switching between tabs.

0

There are 0 answers