eggswift / ESTabBarController

:octocat: ESTabBarController is a Swift model for customize UI, badge and adding animation to tabbar items. Support lottie!
MIT License
5.18k stars 580 forks source link

Add tab bar controller after login view controller #166

Closed ChandraPrakashJangid closed 1 year ago

ChandraPrakashJangid commented 5 years ago

Actually I am new to iOS and I want to use custom tab as supported by you. Let me explain how I am trying to do and where I am stuck

  1. I have a navigation view controller and my login screen is root view controller.
  2. After successful login I show dashboard screen. There I need to show custom tab bar.

But I am not getting the way how I need to call tab bar from dashboard screen.

bishalg commented 5 years ago

@ChandraPrakashJangid : For generic case like yours, stack-over flow is a better place to post such questions as this particular issue is not related to this specific library.

Following code should be called after the login is successful -

 let mainStoryboard = UIStoryboard(name: "Main", bundle: Bundle.main)
 let mainTabBarController = mainStoryboard.instantiateViewController(withIdentifier: "MainTabBarController")
 window = UIWindow(frame: UIScreen.main.bounds)
 window?.rootViewController = mainTabBarController
 window?.makeKeyAndVisible()

Where MainTabBarController is the ESTabBarController