Programmatically setting tabBarItem title in Swift

You can set the tab titles in the view controllers themselves in viewDidLoad by setting the view controller’s title property. title = “Number 0” Alternatively, if want to set the titles from your tab bar controller, you can set them like this in your tab bar controller’s viewDidLoad: tabBar.items?[0].title = “Number 0” tabBar.items?[1].title = “Number … Read more

Prevent automatic popToRootViewController on double-tap of UITabBarController

Use the tabBarController:shouldSelectViewController: method of the UITabBarControllerDelegate protocol. – (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController { return viewController != tabBarController.selectedViewController; } Don’t forget to set the delegate of the tab bar controller to the object that actually implements this delegate method.

Tap tab bar to scroll to top of UITableViewController

Implement the UITabBarControllerDelegate method tabBarController:didSelectViewController: to be notified when the user selects a tab. This method is also called when the same tab button is tapped again, even if that tab is already selected. A good place to implement this delegate would probably be your AppDelegate. Or the object that logically “owns” the tab bar … Read more

How to set tab bar item title programmatically in objective c?

You can set all the UITabBar icons in an easy way. You can do this in your viewWillAppear: method: [[self.tabBarController.tabBar.items objectAtIndex:0] setTitle:NSLocalizedString(@”BotonMapas”, @”comment”)]; [[self.tabBarController.tabBar.items objectAtIndex:1] setTitle:NSLocalizedString(@”BotonRA”, @”comment”)]; [[self.tabBarController.tabBar.items objectAtIndex:2] setTitle:NSLocalizedString(@”BotonEstado”, @”comment”)]; [[self.tabBarController.tabBar.items objectAtIndex:3] setTitle:NSLocalizedString(@”LabelInfo”, @”comment”)]; Swift 3.1 Solution self.tabBarController?.tabBar.items?[0].title = NSLocalizedString(“BotonMapas”, comment: “comment”) self.tabBarController?.tabBar.items?[1].title = NSLocalizedString(“BotonRA”, comment: “comment”) self.tabBarController?.tabBar.items?[2].title = NSLocalizedString(“BotonEstado”, comment: “comment”) self.tabBarController?.tabBar.items?[3].title = … Read more

Reordering view controllers in a UITabBarController, all defined in a Storyboard

you can simply drag and drop and resort them with the mouse in the storyboard. it still works in 4.5.1 EDIT maybe you have first to switch the storyboard view to “Source Code” and go back before you can drag. right-click the storyboard file and select “Open as” -> “Source Code” and then back again … Read more

viewWillAppear, viewDidAppear not being called, not firing

I’m going to go ahead and disagree with @St3fan, and use UIKit as the counter-example. However, the wisdom (or lack thereof), of embedding controllers in general should be guided by sane UI design principles. The easiest counter-example is UINavigationControllers embedded in UITabBarControllers. These appear all over the place. Just off the top of my head, … Read more

Changing font in UITabBarItem

As per: How to change the Color of text in UITabBarItem in iOS 5 It looks like the solution may be sending the message to the appearance proxy, instead of one item: (Deprecated in iOS 7.0+) [[UITabBarItem appearance] setTitleTextAttributes:@{UITextAttributeFont: [UIFont fontWithName:@”AmericanTypewriter” size:20.0f]} forState:UIControlStateNormal]; For iOS 7.0+ use: [[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName: [UIFont fontWithName:@”AmericanTypewriter” size:20.0f]} forState:UIControlStateNormal];

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)