specta

Feature tests with KIF: beforeEach is called after my view controller is loaded?

主宰稳场 提交于 2019-12-11 10:43:45
问题 i have got simple (i guess) question. I want to make a feature test in my app with Specta and KIF. The problem is that i am setting dependency in viewDidLoad method of my View Controller, and in beforeEach method of my spec i'm injecting fake object just to not hit the network. The result is wrong because viewDidLoad is being called before beforeEach method in specs. Is there a possibility to set dependencies before AppDelegate loads root view controller so everything is set up properly? 回答1: