Xcode Persistent Tab Bar Navigation - ios

So I'm building an app where I need a persistent tab bar navigation at the bottom of the screen, exactly like how the Facebook, Twitter, LinkedIn and Instagram iOS apps do. Now whilst I can use a TabBarController and link the main pages of the app, I need the TabBar to be present on every page and not just the first page of each section.
I tried creating a UITabBar class and importing it into one of my ViewControllerClasses so that I don't have to add a TabBar on every single view. But when I add this UITabBar class as a subview of the ViewController I can't seem to change any of it's properties such as background colour.
Can anyone suggest what might be wrong or suggest any better methods of approaching a persistent tab bar navigation on every page of the app?

Related

iOS Admob - How to add Ad that is ALWAYS under the navigation bar even when navigating pages?

I would like an Admob ad to be displayed below my navigation bar in my app. The whole app is built using a navigation controller so no view controller would be without it.
Google recommends that we don't load a new ad on each page as it's better to keep the same ad going for the whole time it has.
I would like the SAME ad that loads to be moved between every view controller below the navigation bar. I want it to take up space so that the content of any tableviews etc start AFTER the ad.
I read that you can create a bannerview in storyboard, so I tried to create a view on the navigation controller in the storyboard, but storyboard wouldn't let me drag any views on the navigation bar, only the specific view controllers.
How can I accomplish what I'm trying to do being making the same Ad appear on every view controller in the navigation stack?
Not sure if this matters but the app is iOS 11 with Xcode 9 beta. Using objective-c.
If you want to make the same add below your navigation bar - then you need to subclass from UINavigationController and add this view programatically. Ant that view will called like this - "GADBannerView *bannerView;".
This might be really overdue, but I found a way to do something similar. You can't drag and drop a view into the TabBar in the storyboard but you can add the AdMob Banner programmatically once you create a custom view controller for your UITabBarController.
First - Create a custom UITabBarController file for your project and link it to the actual UITabBarController you have in your storyboard.
Second - Add the implementation code from Google to display the AdMob Banner ad.
This should allow the ad to persist on all tabs of your UITabBarController.

IOS using different navigation bars

I'm creating an application where I need to use two different navigation bars. When the application first opens up, the nav1 bar should be displayed with an image and a Login button .. when they login screen appears, there is no nav bar. After login, it goes to a Detail screen where I need to show a back arrow image, a screen title and a menu button with drop down options.
I'm using one View_Controller that all my Views inherit from. I've been working on this for days and I'm so lost, please help.
I'm a little confused about the structure of your app.
As I understand it, you want an initial view that is contained in a UINavigationController. Once someone taps the "Login" UIBarButtonItem on the UINavigationBar, then you have a view come up that is not contained in a UINavigationController (probably because it is a modal view that is outside the navigation flow of your app).
The part I'm confused about is where the Detail view comes in. Is the modally presented view dismissed while the Details view is pushed onto the navigation stack from the initial view? Why does the Details view need a back button? Does going back to the initial view effectively log out the user?
At any rate, you should be able to change the UINavigationBar for every view that is pushed on to the stack (that is also contained in your UINavigationController). If you are using Storyboard, you need to make sure that you embed the views pushed on to the stack in a UINavigationController. You can do that by going to the "Editor" menu, selecting "Embed in" and then selecting "Navigation Controller".
Let me know if I didn't understand your question or if you can post more details.
Navigation bar will be the same in the app. You can hide it, show it, change title, change background color, or background image on each view depending on your requirements. But there is only one navigation bar in navigation based apps.

Make More button in tabbed bar application slide out in iOS

This is a simple question. So I have a tabbed bar application with a More... tab button. I was wondering if it's possible to make the More... button be a slide out menu button? I found tutorials on how to do it on a regular app design but things get a little more complicated when it comes to the tabbed bar application.
The thing is that you don't own the More button in the tab bar of a UITabBarController, so you can't control what happens. (You can access the navigation controller that appears when the More button is tapped, but it's still going to be just another view controller whose view is displayed above the tab bar.) If you want to write a new interface you'll have to write a whole new interface, i.e. don't use the built-in UITabBarController. That's no big deal; it isn't doing anything you can't manage to do yourself.

Single navigation bar in iOS tabbed app

I'm doing iPhone tabbed application, but I need to use navigation bar also (just for app title and single icon for Settings in the corner) like twitter did: link. I have 4 tabs in my app too. I was wondering is there any chance to create only one navigation bar, so when I want to change it, I will change it only in one place?
I was looking at this tutorial, but there are two "Navigation Bar" objects. And I would like to have single object that will appear in every tab.
Right now I created tabbed app and manually added navigation bar item into first tab. Then I copied it into others. It works ofc, but I'm not sure about that solution:/
Your use of separate navigation controllers for each tab isn't a bad solution.
Setting up the navigation bar and its items in only one place is also a good idea. To achieve this, you could always have your view controllers derive from a custom view controller that overrides navigationItem.

STACKING OF TABS similar to iPad Chrome app

I need to develop tab bar similar to Chrome's tab bar functionality on iPad. If the user opens more then 5 tabs it displays the extra tabs as a stack:
stacked tabs http://uploads.hipchat.com/26718/169836/yfzwdgq80m4rzbw/Screen%20Shot%202013-04-10%20at%202.36.56%20PM.png
How can I achieve this?
There's nothing like that built into iOS, so you're going to have to implement it yourself. I'd suggest implementing the tab bar portion of the window as a separate view that knows how to draw the individual tabs, including the currently selected tab, and which sends an appropriate message to it's target or delegate object when one of the tabs is tapped.
You can build a UINavigationController like Controller, with its own stack. If you are targeting iOS 5.0 and above you can use childViewController. The controller will have a tab bar, and container view. You will add view controllers to the stack of the Controller. From the stack you can form the tab bar item View, using titles of respective vc and views can overlap.
When they are selected bring the tab bar item view to the front and add the respective viewController as childViewController to the CustomTabBarController.

Resources