Tab Bar Within a Scroll View - swift

I need to be able to have a scrollable view that contains Tab Bar and two views. The Tab Bar is only supposed to show on the first view; when you swipe right to get to the second view, the tab bar shouldn't be there. (Its supposed to work exactly like Instagram's stories where you can slide to get to the camera on the home screen). Right now I have the scrollable container view embedded in the tab bar controller and I added the two views to the container view within its class. However the Tab Bar is on the bottom of both views.
container view embedded in tab bar controller
code for container view
Does anyone have a solution to fix This?

Related

Bottom Bar overlay outside navagationview

I am creating a UI from a mockup that looks like this.
You can see the bottom bar is over the navigation view but not over the sidebar. I want to make the bottom bar outside the navigation view so it does not create a new instance for every view.
Is there any way to do this while supporting macos v11.

Apple's Blue Warning Bar overlaps the NavBar of my Navigation Controller

I have a view setup inside a UINavigationController. The Blue Warning Bar displays over the top of the NavigationController's NavBar. In another part of my project I have another UINavigationController setup inside a UITabController. The NavBar allows enough room for the Blue Warning Bar to display without an overlay.
What am I missing? How can I prevent the Blue Bar from overlaying the NavBar?
Blue Bar of Shame
I figured it out!
Here is what was actually happening:
I have a View Controller inside a Navigation Controller. This View Controller contains a list of “Appointments”. When the user taps on an “Appointment” the application segues to a detail view that uses a Tab Bar Controller with five tabs, each of which have their own Navigation Controller. The first tab has an address field that allows the user to launch a Navigation App (Apple Maps, Google Maps or Waze) by tapping on it.
After opening the Navigation App, if the user returns to my application while the navigation app is still open and they did not provide the proper permission to suppress the Blue Bar of Shame, then the Blue Bar of Shame is displayed above my Navigation Bar, as it should be. If they then tap the back button to dismiss the Tab Bar Controller and return to the original Navigation Controller, the Blue Bar of Shame is overlaid on top of the Navigation Bar.
I'm not sure if this is a bug with UIKit or not.
What I did to work around this:
I changed the manner in which an Appointment List selection opens the selected Appointment's Detail. I was using a simple segue. For some reason when navigating back to the Appointment List view from the Appointment Detail, the Appointment List view's Navigation Bar was not accounting for the expanded status bar when the Blue Bar of Shame was displayed. I ended up completely replacing the rootView, which was displaying the Appointment List, with the Appointment Detail Tab Bar Controller. When transitioning back, I do the same thing in reverse - replace the Appointment Detail with the Appointment List; this seems to have alleviated the rendering problem.
I then created an extension for UIWindow to emulate the default navigation style transition during the rootView replacements.

Tab bar disappears after touching cell in tableview

I have an issue with a tab bar app. I am making a tab bar app with three bars on the bottom. On my my first bar it is a tableviewcontroller. When i ckick on the table view controller it takes me to a different view (which doesn't have the tab bar). When I clicked back to the home screen (which has the tab) the tab bar is gone.If you need a picture i will post it!
You may have set your UITableViewController segue to a modal style. If this is the case, you should change it to a push style.
In order for a push to work, your view controller needs to be in a UINavigationController. In your story board, select your root view controller and embed it into a Navigation Controller like this...

UISearchBar displays in the root view but not in any other view on the tab bar

I have implemented the search bar for the table in the first tab and this works fine and filters fine, however, with the same code and the xib linked up all the same etc on the second tab it no longer displays the search bar. Is there a simple reason to this?
Separate out the UISearchBar into its own class and then call it from the multiple views. It is not meant to be reinstantiated for each view controller.
Yes, there is a simple reason—the search bar is a subview of your main view, so when that view gets swiped off screen, it disappears with that view. To fix this, you'll have to add the search bar to the view that holds your tab bar controller—you'll probably have to put it in MainWindow.xib. You can still connect it to your tab bar controller if you need to—just add a reference to in the XIB.

Table View going to video

Building an app with some video clips.
First we see a table view showing the different clip names. It has a navigation bar just to make it look nice. I also have a tab bar at the bottom.
Once the user click on the clip name it get passed on to the next view and the video starts playing. So far so good. The problem I have is that the navigation bar and the tab bar is also in that view.
How can I take them away (read clear the window/start a new window)?
How do I get the video to play full screen with nothing from the last view?
to hide the navigation bar, use the UINavigationController's navigationBarHidden property.
to hide the tab bar: before you push the new view controller (with the video), set its hidesBottomBarWhenPushedproperty. This will hide the tab bar until this UIViewController is popped from the view hierarchy stack.