uitabbarcontroller

How can I perform a segue to a different tab in a UITabBarController when user selects a cell? [duplicate]

我只是一个虾纸丫 提交于 2020-01-06 20:10:12
问题 This question already has answers here : How can I segue to the second tab of a tab bar controller from the first tab? (2 answers) Closed 2 years ago . I have a UITableViewCell in the 1st tab of a UITabBarController that contains a list of things. When the user selects a cell, I'd like it to segue to a different tab in the UITabBarController . I did it using the following code: func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { performSegueWithIdentifier(

How to add UITabBarController programatically without using AppDelegate?

别等时光非礼了梦想. 提交于 2020-01-06 12:42:55
问题 I want to put a UITabBar in two views, but not in the MainViewController, because I am not using the AppDelegate to put it. Is there a solution without .xib or storyboard 回答1: UIViewController *vc1 = [[UIViewController alloc] init]; vc1.title = @"FIRST"; vc1.view.backgroundColor = [UIColor blueColor]; UIViewController *vc2 = [[UIViewController alloc] init]; vc2.title = @"SECOND"; vc2.view.backgroundColor = [UIColor redColor]; UITabBarController *tabBar = [[UITabBarController alloc] init];

iOS Tab bar controller containing same Table views inside all tabs but different filtered data

人走茶凉 提交于 2020-01-06 07:53:05
问题 SOLVED: I think I figured it out on how to do it. I added tags to each of my view controllers for each tab. Then in the viewDidLoad method on the view controllers, I can add a switch based on which tab's tag is selected: self.tabBarController.tabBar.selectedItem.tag Issue: I am pretty new to iOS development and need some feedback on this- Here is the scenario: I am using storyboards for this. We have a navigation controller inside a tab bar controller. The Tab bar controller contains the same

UITabBarController not loading “More” views at applicationDidFinishLaunching

此生再无相见时 提交于 2020-01-06 06:51:11
问题 I'm trying to restore the state of my multi-tabbed iPhone application. There are more than 5 tabs, each with it's own navigation controller. On applicationDidFinishLaunching, I determine which was the last tab the user was on and set it with myTabController.selectedIndex = persistedTabIndex; I then call a function on that tab's root view controller to restore itself. The problem is, if the tab has been moved to the "More" page, the view has not been loaded and the call disappears into NIL

UITabBarController not loading “More” views at applicationDidFinishLaunching

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-06 06:51:10
问题 I'm trying to restore the state of my multi-tabbed iPhone application. There are more than 5 tabs, each with it's own navigation controller. On applicationDidFinishLaunching, I determine which was the last tab the user was on and set it with myTabController.selectedIndex = persistedTabIndex; I then call a function on that tab's root view controller to restore itself. The problem is, if the tab has been moved to the "More" page, the view has not been loaded and the call disappears into NIL

iPhone sdk tab bar auto rotate on orientation change

好久不见. 提交于 2020-01-06 06:44:02
问题 I have a an application that has a tabbar controller and some navigation controllers inside the tab bar controller. I customized the tab bar by extending it and implementing the shouldAutoRotateOnOrientation Change method and returning YES for specific view controllers that I wish to show allow auto rotation. This works fine until I programatically change the selectedIndex of the tabbar. Once I change the selectedIndex of the tabbar, the tabbar controller's shouldAutoRotateOnOrientation

iPhone sdk tab bar auto rotate on orientation change

我的未来我决定 提交于 2020-01-06 06:43:04
问题 I have a an application that has a tabbar controller and some navigation controllers inside the tab bar controller. I customized the tab bar by extending it and implementing the shouldAutoRotateOnOrientation Change method and returning YES for specific view controllers that I wish to show allow auto rotation. This works fine until I programatically change the selectedIndex of the tabbar. Once I change the selectedIndex of the tabbar, the tabbar controller's shouldAutoRotateOnOrientation

tabBarController didSelect does not get called

安稳与你 提交于 2020-01-06 06:12:28
问题 I am having a problem with tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) delegate firing. The problem lies when I try to use self.tabBarController?.selectedIndex and change a tab programmatically. Once I use selectedIndex and go back to a previous tab and click on the tabBarItem the delegate does not fire anymore. Delegate only fires if I do not use selectedIndex but once i use it the didSelect delegate never fires again even if I tap on

tabBarController didSelect does not get called

妖精的绣舞 提交于 2020-01-06 06:12:16
问题 I am having a problem with tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) delegate firing. The problem lies when I try to use self.tabBarController?.selectedIndex and change a tab programmatically. Once I use selectedIndex and go back to a previous tab and click on the tabBarItem the delegate does not fire anymore. Delegate only fires if I do not use selectedIndex but once i use it the didSelect delegate never fires again even if I tap on

UIVIew subclass object becomes mysteriously nil in tabbar app

喜欢而已 提交于 2020-01-06 05:33:44
问题 Hola caballeros, I am stumped, mystified, and worse yet, stymied: in my first tab bar project I have an object that is instance of a subclass "BarGraph of UIView, which I've used before without trouble. In this project I do an alloc-init in the viewDidLoad method of the second viewController, graphViewController. This sets up the BarGraph. The data which is read in is displayed properly by that object. The trouble comes when I use a tab to go to a different viewControler where I add to the