appsquickly / typhoon

Powerful dependency injection for Objective-C ✨✨ (https://PILGRIM.PH is the pure Swift successor to Typhoon!!)✨✨
https://pilgrim.ph
Apache License 2.0
2.7k stars 270 forks source link

Fix ViewControllerInjector for UITabBarController #592

Closed Pireax closed 5 years ago

Pireax commented 5 years ago

The UITabBarController's property childViewControllers only contains the visible tabs, when there are more than 4 tabs on a smaller screen a more tab gets created. This screws with the injection and ignores the tabs that are now in the more tab. This pull request tries to fix this issue by instead calling the UITabBarController's viewController property which does contain the other tabs.

Pireax commented 5 years ago

It might make more sense to use a category for this, let me know what you think.

alexgarbarev commented 5 years ago

Hi @Pireax. Thanks for your fix. I think it makes sense, although I've tested UITabBarController case before, it must be a change in latest iOS versions. I'll merge it.