antiguab / BATabBarController

A TabBarController with a unique animation for selection
https://antiguab.github.io/batabbarcontroller/
MIT License
1.06k stars 131 forks source link

Push to tabbar controller #52

Closed HarshPandya136 closed 4 years ago

HarshPandya136 commented 4 years ago

Simulator Screen Shot - iPhone XR - 2019-11-13 at 12 34 24

Hello Bryan antiguab,

whenever I load tabbar without push its work fine but whenever I Push to this tabbar controller this issue happned I checked and apply all properties but not working

can you please check?

Thank you

antiguab commented 4 years ago

looking into this!

lucaventura commented 4 years ago

@HarshPandya136 I noticed this as well when setting the window root view controller to the view controller containing the tab bar. This is an interim solution that works in the meantime, add this right after adding the tab bar to your view:

NSLayoutConstraint.activate([ tabBar.view.bottomAnchor.constraint(equalTo: self.view.bottomAnchor), tabBar.view.trailingAnchor.constraint(equalTo: self.view.trailingAnchor), tabBar.view.leadingAnchor.constraint(equalTo: self.view.leadingAnchor) ])

@antiguab There are a few Unable to simultaneously satisfy constraints errors logged to the console in the demo project. Could be related. I tried overriding safeAreaInsetsDidChange in BATabBar.swift and performing the same action as in layoutSubviews since the safeAreaInsets can sometimes be 0 when accessing them immediately but that didn't do the trick.

antiguab commented 4 years ago

@lucaventura which simulator did you use? I'm not seeing those errors in the demo project.

antiguab commented 4 years ago

also swift version and ios version you're trying to support

antiguab commented 4 years ago

happy to look into this more if you guys can provide some sample code that causes the above.