2

I have a tab bar in my app that has 3 items leading to 3 separate view controllers. However, within one of those pages I have a button transition to another view controller (click on the button and it takes you to another page), and the tab on the bottom is no longer visible.

Think of Instagram where you can search for a person...if you click on that person's profile, the tab on the bottom is still visible and responsive, while the tab bar in my app is not. I need that same effect that Instagram has in my app, however I am confused on how to achieve that.

halfer
  • 19,824
  • 17
  • 99
  • 186
Andy Lebowitz
  • 1,471
  • 2
  • 16
  • 23
  • Make use of ContentView in Your TabVC let's say **controller1** and navigate Views inside that **controller1** using a **NavigationController Don't present there** – iOS Geek Jun 09 '18 at 05:23
  • @iOSGeek can u pls try to explain a little more clearly and write it as an answer? – Andy Lebowitz Jun 09 '18 at 17:41

1 Answers1

1

I created a sample Project to explain what I was trying to explain

Screenshot - Storyboard

enter image description here

View Hierarchy

---> Tab Controller
  ---> Tab Vc 1 --> ContentView With Navigation Controller
  ---> Tab Vc 2 --> ContentView With Navigation Controller
  ---> Tab Vc 3 --> ContentView With Navigation Controller
---> Demo Vc - Which wis the second ViewController to be displayed with in Tab Bar bounds

Output

enter image description here

Project Link

Link - https://github.com/RockinGarg/ContainerView-TabBar.git

check branch - stack_Tab_VC_Container

clone - git clone -b stack_Tab_VC_Container https://github.com/RockinGarg/ContainerView-TabBar.git

iOS Geek
  • 4,825
  • 1
  • 9
  • 30
  • This looks better, thanks. I'll try to implement it in my project and if it looks like it fixes the issue I'll upvote you and give you answer check. – Andy Lebowitz Jun 14 '18 at 19:58
  • Just try implementing, if any issue occurs fell free to ask – iOS Geek Jun 15 '18 at 04:11
  • Also, by ContentView do you mean container view? – Andy Lebowitz Jun 15 '18 at 20:48
  • Hi, it's working very well. Only one issue I have found that when changing tabs navigation controller doesn't show the root view controller rather it shows the inside navigated view, how we can navigate to the root view controller when tabs are changed? – Asad Ali Choudhry May 05 '21 at 10:33