FAQ Database Discussion Community


Set selected tab bar item tint?

ios,objective-c,uitabbarcontroller,uitabbaritem
I am aware there are similar answers on this topic, but I cant seem to come to any conclusion. I'm using IOS 8 and a tab bar created in app delegate. Is there a way to set the selected tab bar item to a certain colour. preferably without using an...

How do I make a UIBarButtonItem be a circle and behave like a UIButton

ios,uibutton,uitabbarcontroller,uibarbuttonitem,uitabbaritem
I have a tabbar and I want to add a UIButton (giant box) on top of the center. How do I make a UIBarButtonItem do this? I want layers, rounded borders, etc.

How to get the RootViewController from a UITabBarItem

ios,objective-c,uitableview,uinavigationcontroller,uitabbarcontroller
Im not even sure if the title is correct but i do not understand how else to explain it so here it goes. I will show you in steps what i do so you will understand. First off , i am using UITabBarController where i got three different items. 1)...

Is this an example of UITabBarController?

ios,objective-c,uiviewcontroller,uitabbarcontroller,viewcontroller
I would like your help to understand whether the native iOS weather app utilizes or not a UITabBarController (or is this a different view controller?) with multiple ViewControllers inside. Here is the screeenshot: Doubts: Is the bar at the bottom a tab with custom images? Is each city associated to...

Load UITabBarController from Nib

ios,swift,uitabbarcontroller,uitabbar
How do we load a UITabBarController from NIB? for UIViewControllers we could easily do this let viewController = SubclassOfViewController(nibName: "SubclassOfAViewController", bundle: nil); But I could not find any similar method to load a UITabBarController which is from Nib Any thoughts? Thank you Edit: I am not using Storyboards...

UITabBarController Header with Title

ios,uinavigationcontroller,uitabbarcontroller,uinavigationbar
I have been trying to hours to implement a simple UITabBarController where each view (or tab) has an active header (or top bar) with the title of the view. Is there a way in Xcode 6.1.x to create a UITabBarController with pages whose title is reflected in the top bar?...

iOS8 behavior on nested navigation controllers

ios,uinavigationcontroller,uitabbarcontroller,uisplitviewcontroller
My app has a top level navigation controller. It navigates between different pages and displays a navigation panel on top, as usual. One of those pages is a tab controller with 3 tabs. Each tab has its own navigation controllers because while being in a tab I need to open...

iOS/xcode - How can I open a new storyboard from UITabBarController and keep the UITabBar from disappearing?

ios,objective-c,iphone,xcode,uitabbarcontroller
I have been working to link multiple storyboards off of a singleUITabBarController. I have it working where I can get the new storyboard to open and present the initial UIViewController, just the UITabBar disappears when it opens the new storyboard. Here is the code I am using to switch to...

Auto Layout and “Hide bottom bar when pushed”

ios,objective-c,storyboard,uitabbarcontroller,autolayout
My app's (simplified) structure is this: UITabBarController with one UINavigationController holding a UITableViewController as root view controller. when tapping one of the table view controller cells, I push a regular UIViewController (lets call it VC) end hiding the bottom tab bar. (using the "Hide bottom bar when pushed" flag) In...

iOS tabBarController detect selected index in AppDelegate

ios,objective-c,uitabbarcontroller,uitabbar,appdelegate
AppDelegate.h ***** @interface AppDelegate : UIResponder <UIApplicationDelegate,UITabBarControllerDelegate,UITabBarDelegate> AppDelegate.m ***** - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController { NSLog(@"%lu",(unsigned long)tabBarController.selectedIndex); } This method not work any idea ? I want to scroll top when click tab bar item Help please :)...

Tab bar item not showing

ios,swift,uinavigationcontroller,uitabbarcontroller
if(!isUserLoggedIn){ var loginViewController = mainStoryBoard.instantiateViewControllerWithIdentifier("loginView") as! LoginViewController window!.rootViewController = loginViewController window!.makeKeyAndVisible() }else{ var mainViewController = mainStoryBoard.instantiateViewControllerWithIdentifier("mainView") as! FirstViewController var myDealsViewController = mainStoryBoard.instantiateViewControllerWithIdentifier("myDealsViewController") as!MyDealsViewController var settingsViewController =...

Get currentViewController of View Controller in UITabBarController in UINavigation Controller

ios,objective-c,uinavigationcontroller,uitabbarcontroller,appdelegate
I would like to know how I can find the current view controller if I have a UITabBarController and within that TabBarController I have 4 different UINavigationControllers and then that NavigationController obviously has the stack of view controllers. In my app delegate I am trying to find out this information...

view with navigationController over tabBarController [duplicate]

ios,swift,uinavigationcontroller,uitabbarcontroller
This question is an exact duplicate of: IOS pushViewController without tabBar and navigationBar 2 answers How I can open new view over UITabBar and with working UINavigationController? self.navigationController?.pushViewController(view, animated: true) Example: ...

Detect UITabBar Selected Index/ Item Changes that is set Programmatically

ios,uitabbarcontroller,uitabbar,uitabbaritem
I would like to know how do we detect when the selected TabBar Item or Index is changed when the changes is done programmatically? self.tabBarController.selectedIndex = 1; This two delegate function only detect changes when the tabBar Item was selected by user. It does not fire when the changes to...

How to determine, in an app with several ViewControllers attached to NavigationControllers, what the currently displayed View is?

objective-c,uiviewcontroller,ios8,uinavigationcontroller,uitabbarcontroller
I have an iOS 8 app, built with Objective-C, with a TabBarController, with 3 tabs. Each Tab links to a NavigationController (so there are 3 NavigationControllers), and each NavigationController has a stack with several ViewControllers in it. So, at any given time, the app's user can be on, say, ViewController...

Transparent Navigation Bar & Tabbar in iOS

ios,uinavigationcontroller,uitabbarcontroller
I want to have a navigation bar and tabbar transparent to view background (reference image ==> https://www.dropbox.com/s/3vn8ef0p5lv1cw7/Required.png?dl=0). I am already setting background to view. But, I couldn't have Navigation Controller & Tabbar Controller transparent (reference image ==> https://www.dropbox.com/s/vfewqpwve78l4dq/Current.png?dl=0). This is what I have tried before : 1. Setting background color...

Change item color in UITabBar iOS

ios,objective-c,uitabbarcontroller
My app has a Tab Bar like the follow: The Tab Bar must be green and as you can see the icon of the item in Tab Bar are a little hard to see. How I can change the color of the icon in this Tab Bar? I've to use...

Issue with a UINavigationController inside a UITabBarController inside another UINavigationController

ios,cocoa-touch,uinavigationcontroller,uikit,uitabbarcontroller
Don't ask me to show the code because there's no code. Everything has been done in a storyboard. My app starts with a main navigation controller which holds a login view controller as its root view controller. The login view controller has a button. When the button is pressed a...

Swift: Table in tabcontroller only is positioned correctly if it's the first tab?

ios,uitableview,swift,uitabbarcontroller
I have attached the sample code that illustrates the issue I'm having. For some reason a tableview needs to be the first tab in order for the tableviewcontroller recognize the navbar. This question is an extension on this question I asked yesterday Here's a link to the actual sample project...

Swift : How to add icon image and image background to the UItabBar in App delegate?

ios,xcode,swift,uitabbarcontroller
self.window = UIWindow(frame: UIScreen.mainScreen().bounds) var nav1 = UINavigationController() var first = ViewController(nibName: nil, bundle: nil) nav1.viewControllers = [first] var second = ccDiscovery(nibName: nil, bundle: nil) var nav2 = UINavigationController() nav2.viewControllers = [second] var third = ccPosting(nibName: nil, bundle: nil) var nav3 = UINavigationController() nav3.viewControllers = [third] var fourth = ccProfile(nibName:...

How to set TabBar Image in UITabBarController

ios,objective-c,ios8,uitabbarcontroller,uitabbar
I have used UITabBarController in my application. I am really confuse about what image size should be there for UITabBar. It must support all devices. iPhone 4s,5,5s,5c,6,6 plus. Sometimes it's create space between tabs. If I change image size then sometimes it looks blur. I have put normal image,@2x and...

Swift: Storyboard TabViewController Segue Not Being Triggered

ios,swift,uitabbarcontroller,barcode-scanner
I am working on an iOS app that allows users to scan barcodes of food items into a shopping list. My goal is that when the scanner picks up on a barcode, it grabs the metadata and sends it (via segue) to another view where the user can log the...

(Swift) Change the Image tint color of tab bar?

ios,swift,uiimage,uitabbarcontroller,tintcolor
I have created the tabBarController programmatically and I want to change color of tint color of images(not the bar) that tab contains. Can anyone tell me how to do that in Swift?

TabBarItem background color of selected item in iOS

ios,uitabbarcontroller,uitabbar,tabbar
How can I change background color of selected tabBarItem to other color? To red like on my attached image ...

Remove TabBar item in Swift

ios,swift,uitabbarcontroller,tabbar
I currently try to find a way to remove while run the app a TabBar Item, i found a way to enable or disable it but not to complete remove it. For disable it i do: In ViewDidLoad if let tabBarItem = self.tabBarController?.tabBar.items?[3] as? UITabBarItem { tabBarItem.enabled = false }...

UITextview selected text

swift,uitabbarcontroller,uitextview
I've an UITabBarController. In my UIViewController a UItextView where I can select the text but when I change the View, text is kept selected. I've tried to add that code but doesn't work: var range:NSRange = textView.selectedRange range.length = 0 range.location = NSNotFound ...

Programmatically switching tabBar causes IBOutlet to be nil

ios,swift,delegates,uitabbarcontroller,iboutlet
I am switching tabBar programmatically - which works fine. However, an IBOutlet mapView (google maps) becomes nil - leading to a crash... I've spent quite a few hours on this. Feels like I am missing something trivial. Looked through SO, e.g.: Switch tab bar programatically in Swift and All my...

How can I connect a UIButton to a specific tab in my Tab Bar Controller?

ios,swift,ios8,uitabbarcontroller,uitabbar
I have a UITabBarController that has 2 tabs. Each tab is different, but both have the option to make a new post on the top. When I tap the new post button on either view, I have the same ViewController Present Modally. If I hit the cancel button, it dismisses...

push a UIViewController when received a remote notification

ios,uinavigationcontroller,uitabbarcontroller
The project's initial viewController is a UITabBarViewController, I want to push a new viewController when received a remote notification, but not sure now which viewController is in, how to deal with it?

How to redisplay parse login from child view controller in swift

ios,swift,uiviewcontroller,parse.com,uitabbarcontroller
I have a view controller which is triggered from a UITabBarController (which is the root of my app) if a parse session doesn't exist. override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) self.initialiseLogin() } func initialiseLogin() { if (PFUser.currentUser() == nil) { let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil) let vc:...

How to set UITabBarController when setting initial view controller in app delegate

ios,xcode,swift,uitabbarcontroller,uistoryboard
I need to programatically set initial view controller (based on user login status). This is my initial code: func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { let storyboard = UIStoryboard(name: "Main", bundle: nil) let mainRootController = storyboard.instantiateViewControllerWithIdentifier("MainViewController") as UIViewController if self.window != nil { let navigationController:UINavigationController = storyboard.instantiateInitialViewController()...

Override UITabBarController Icon Selection

ios,objective-c,uitabbarcontroller
I'm using a standard UITabBarController with icons at the bottom, each bringing to it's ownViewController. My question is basically: Is there a way to override what happens when an icon is selected rather then directly bringing them to the view? Reason being is because I'm adding a login screen to...

What is the best way to implement UITabbarcontroller with sidepanel?

ios,uitabbarcontroller
I want to implement sidebar(drawer) using uitabbarcontroller. I have implemeted for uiviewcontroller using lib JASidePanel. but I didn't find any way to implement with uitabarcontroller. Appreciate for help...

Hide a UIViewController (Screen) in swift

swift,uiviewcontroller,uitabbarcontroller,segue,xcode6.3
As you can see the screen flow as follows: After clicking on the 'button2' of 'screen A', app shows 'screen B' from same storyboard which has a tab bar. After clicking on the 'red tab' of 'screen B', app shows the 'green button'(right corner). After clicking on the 'green...

UITabBarItem invisible in iOS 7 with UISplitViewController

ios,ios7,uitabbarcontroller,uisplitviewcontroller,uitabbaritem
I have a little problem easily reproductible with Xcode 6.1.1 : Create a new Tabbed application project Set the deployment target to iOS 7 Go into the storyboard and drag and drop a UISplitViewController Link it to the UITabBarController Edit the new Tab Bar Item, set an image and set...

Change the appearance of badge value in UITabBarController iOS?

ios,uitabbarcontroller,uibaritem
How can I change the text font and the location of a badge value in a UITabBarController?

Start uitabviewcontroller with screen not on tabbar

ios,swift,uiviewcontroller,uitabbarcontroller
My uitabbarcontroller has 5 tabs, but when the initial uitabbarcontroller is loaded I want to display a viewcontroller that is not any of these 5. I also want none of the 5 to be selected. The most recent questions that I have found were for iOS 5 and in the...

Get selected index tabbar controller Swift

ios,swift,uitabbarcontroller,selectedindex
I'm newbie in Swift and I'm trying to get the selected index of the tabbarController. var application: AppDelegate = UIApplication.sharedApplication().delegate as AppDelegate var tabbarController = application.tabBarController as UITabBarController var selectedIndex:Int = tabBarController.selectedIndex I'm getting this error: 'UITabBarController?' does not have a member named 'selectedIndex' Am I missing something?...

iOS: Show login viewcontroller or “another” viewcontroller inside of UITabbarController?

ios,xcode,swift,uitabbarcontroller,uitabbaritem
I have a tabbar with 5 tabs. 3 of these tabs requires authentication by having an account. I know one solution is to present a modal viewcontroller when pressing one of these tabs. I wish to present the login viewcontroller inside of the tabs instead of showing it modally. How...

UITabBarItem image colour changes to blue after first time it is selected

ios,swift,cocoa-touch,uitabbarcontroller,uitabbar
I'm having this issue with a UITabBar. I have custom images I'm using for the UITabBarItems and after I select a tab the correct highlight colour shows but the original colour of the image (grey) is no longer grey. it is no blue. So basically: I select a tab and...

Can't set tab bar icon iOS

ios,uiimage,uitabbarcontroller,uitabbar
I have a UITabBarController with a tab bar (of course), and I'm trying to set custom images to the tabs on my tab bar with the following code: - (void)viewDidLoad { [super viewDidLoad]; UITabBar *menuTab = self.tabBarController.tabBar; UIImage *friendImage = [UIImage imageNamed:@"[email protected]"]; UIImage *friendImageSelected = [UIImage imageNamed:@"[email protected]"]; UITabBarItem *friendItem =...

UITabBarController tabBar setItemWidth doesn't work

ios,xcode,uitabbarcontroller,uitabbar,uitabbaritem
I have six tabs and need to show them all without More button.jomafer answer says that setItemWidth does that. I called this in AppDelegate but it didn't work. [[UITabBar appearance] setItemWidth:self.window.frame.size.width/6]; I then called the above in TabBarController viewDidLoad but it still didn't work. Even tried [self.tabBar setItemWidth:self.window.frame.size.width/6]; But there...

How to call sub-tableVIew method from UITabBarViewController

ios,objective-c,uitableview,uitabbarcontroller
- (void)tabBarController:(UITabBarViewController *)tabBarController didSelectViewController:(UIViewController *)viewController { NSLog(@"selected %lu",(unsigned long)tabBarController.selectedIndex); if (tabBarController.selectedIndex == 0) { //call refresh() in PlayerTableViewController } else { // ... } } Below is UITabBarViewController. In line 4, I have want to call a method called refresh() to update data in PlayerTableViewController. How can I implement it...

UITabBarController wont show

ios,objective-c,xcode6,uitabbarcontroller
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.main_tabs = [[UITabBarController alloc] init]; self.viewController1 = [[ViewController alloc] initWithNibName:nil bundle:NULL]; self.viewController1.title = @"Home"; UINavigationController *nav1 = [[UINavigationController alloc] initWithRootViewController:self.viewController1]; self.viewController2 = [[ViewController2 alloc] initWithNibName:nil bundle:NULL]; self.viewController2.title = @"About";...

Referencing TabbarController created from StoryBoard in AppDelegate?

ios,swift,uitabbarcontroller,appdelegate
I have a tabbar app with an initial login screen. The tabbarController is set as the initial view in Storyboard with 1 VC that has a navigationController also embed. I have a loginVC instantiated and set as rootViewController in my AppDelegate. After the user has successfully sign in from the...

Using a UITabBarController and a UINavigationController together

ios,objective-c,iphone,uinavigationcontroller,uitabbarcontroller
What is the best practice or good way to have with 2 tabs behave like a UINavigationController when clicking through views after the tab bar views. Do I make a UINavigationController for each tab? The tab bar is created like so: // Create the tab bar text and images AViewController...

Video in original VC continues playing after switching to a different tab in tab bar

ios,swift,video,uitabbarcontroller,uitabbar
I currently have a view controller that is playing a video. When i click a tab in in the tab bar, I switch to a new VC but the audio from the original video is still playing. Is there any way to stop the audio? Thank You! ...

How should a tab bar controller be integrated into a navigation controller workflow?

ios,uinavigationcontroller,uitabbarcontroller
I've been given a design with the following workflow: User logs into an app Upon successful login the user sees a tableview with data rows Upon clicking a data row the user is taken to a view controller with a tabbed inteface. Each view controller in the tabbed interface provides...

UITabBarController and UIPopover Screen Flashes White

ios,ipad,uitabbarcontroller,uipopovercontroller
I'm running into a unique bug: I have a UITabBarViewController that I have presented with presentViewController:animated:completion: (I'm presenting it fullscreen in this way, because the presenting view controller only permits landscape orientations, while the presented tab bar vc permits all orientations. So when you dismiss the presented tab bar vc...

How to get Multitasking between ViewControllers in Objective-C?

ios,objective-c,uitabbarcontroller,multitasking
I'm developing an app that required to switch between viewcontrollers but without losing the current data when multitasking ! My QUESTION : There is a Way to get something like UITabbarcontroller but with an animation (Multitasking) thanks to a Menu ?...

Xcode Storyboard Tabbed application (UITabBarController) - tell when tab selected

ios,xcode,xcode6,uitabbarcontroller,tabbed-interface
Using Xcode 6 I have created an Tabbed Application using a storyboard with the supplied template. I need a function to fire when the third tab of the UITabBarController is selected. I can’t use the ViewDidLoad as I need it fire every time the view is accessed by clicking on...

iOS 8 UITabBar selectionIndicatorImage leaves rounded rectangle

ios,uikit,uitabbarcontroller,uitabbar
I am creating a sample "Tabbed Application project" with Xcode 6.3. The tab bar is configured in the Storyboard view, and its configuration is set thus: As you can see, the Selection part is set to an empty string, which is the default value. However, when running the app in...

Creating UITabBarController in Nib instead of Storyboard

ios,objective-c,uitabbarcontroller,uitabbaritem
I am trying to create a UITabBarController from a Nib. In my project, I do not use Storyboards at all, I prefer going the Nib method, as it makes the project much more managable. So here is what I did so far I create a new CocoaTouch class file and...

UITabBarViewController doesn't rotate - iOS

ios,uitabbarcontroller,auto-rotation,shouldstartload
I have a UITabBarViewController that contains 5 tabs and a login view which is not part of my tab bar, in my settings I have set that I support all device orientations. but when I run my app, only my login view is the only which rotates. I have created...

Dismiss all Detail Views when switching Tabs on TabBarController

ios,objective-c,uitabbarcontroller
My iOS app has: TabBarController NavigationController1 TableView1 ViewController1 (Details View) NavigationController2 TableView2 ViewController2 (Details View) Behavior: When the app loads, I see the TableView1. I select an Item in the table, and it takes me via Show (Push) segue the details view 1. I switch to the second tab on...

Nav Bar Item in XIB that Presents a StoryBoard Tab Bar Root View Controller Segue

ios,objective-c,xcode,uitabbarcontroller,uinavigationbar
My App has a lot going on with it, lol. On my Main Menu, if you click "Chat", it will take you to the Chat XIB. If you look to the top left in the Navigation Bar I have something called "Main Menu". I want this to take me back...

Could not cast value of type 'UINavigationController' (0x10836e698) to 'UITabBarController' (0x10836e6e8).?

xcode,swift,uiviewcontroller,uinavigationcontroller,uitabbarcontroller
This is the code for UITabBarController in which I am trying to open a splitviewcontroller. import UIKit class SecondViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() } override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) ///here after this line I am getting error var mainCont : UITabBarController = ((UIApplication.sharedApplication().delegate) as! AppDelegate).window?.rootViewController as!...

Remove mask from deselected tabs UITabBarItem Swift

ios,swift,ios8,uitabbarcontroller,uitabbaritem
I am trying to implement an UITabBarController with 2 UITabBarItems . I added in storyboard the TabBarController. I almost did it, but still I am blocked with 2 important issues: 1) Here is how tab bar should look: Please ignore orange button, that is not a tabItem. So I put...

How to change the text 'More' on the standard UITabBarItem

ios,objective-c,cocoa-touch,uitabbarcontroller,uitabbaritem
I have a TabBarController with several UITabBarItems, the last of those items is the standard 'More' UITabBarItem provided by iOS. I want the title to be 'Meer' (More in my language), but when I try to set the title programmatically it doesn't work. I've tried this: UITabBar *tabBar = self.tabBar;...

iOS switch tab's child view controller

ios,objective-c,uitabbarcontroller
Is there a way to programmatically switch the view of a certain tab? For example lets say I have a tab bar with 3 tabs. The 3rd tab contains a login/registration flow and when this is complete an account screen should be displayed in the same 3rd tab. Something along...

How to refresh UITabBar after changing viewControllers

ios,swift,uitabbarcontroller,uitabbar
I'm implementing a user authentication system for an app. If the user is logged in they get one set of available tabs to select. If They're not logged in they get another. Now the issue I'm running into is that after a user logs in (app redirects to safari to...

UIWebView white screen on every launch while preloading all tabs

ios,objective-c,performance,uiwebview,uitabbarcontroller
Before I present my issue, I want to mention that I tried looking for solutions here and here. I am creating a hybrid application which uses native UIWebView for rendering the responsive designed web application. Following is the issue description : 1. I have a UITabBarController. 2. Each of the...

Tittle shows bigger in UITabBarController in iOS 7 programatically

ios,swift,uitabbarcontroller,uitabbar
I have implemented UITabBarController programatically. The title of the viewControllers show bigger and clipped. Here is the source code: var tab: UITabBarController = UITabBarController() tab.tabBar.translucent = false var homeVC: UINavigationController = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController() as UINavigationController homeVC.tabBarItem = UITabBarItem(title: "Home", image: UIImage(named: "icon-home"), tag: 0) var messagesNavC: UINavigationController =...

How to add custom gesture to a tab in UITabBarController

ios,uitabbarcontroller,gesture
I have a tabbarController: UITabBarController* tabBarController = [[UITabBarController alloc] init]; UIViewController* view1 = [[UIViewController alloc] init]; UIViewController* view2 = [[UIViewController alloc] init]; tabBarController.viewControllers = [NSArray arrayWithObjects:view1, view2, nil]; I want to add a long press gesture to view1's tab button(called tabBarItem) or just add a long press gesture to the...