uitabbarcontroller

Dealloc not called changing tab

自作多情 提交于 2019-12-13 05:08:56
问题 Let's suppose to have a tab bar controller with two tabs, A and B, where A is a navigation controller. When the user is in A, he can push A1 and then A2, which are both view controllers. A back button on A2, performs: [self.navigationController popViewControllerAnimated:YES]; which correctly triggers the dealloc method on A2. If the user is in A2 and then switches to tab B, I need the dealloc method to be called on A2; therefore I've implemented the following method in the TabBarController: -

General way to pass data to UIViewControllers when using a UITabController

风流意气都作罢 提交于 2019-12-13 04:56:15
问题 I still haven't grasped this transfer with the structure below. I have read many posts, and have seen the same unanswered post by others, but no resolution. I will try to simplify the question to make it easier for all. The structure of the project is: UITabbar with tab1 and tab2 Tab1 has a Nav controller-->ViewController1 Tab2 has a Nav controller -->ViewController2 In viewcontroller1 (tab1) I have object X. In ViewCOntroller2 (tab2) I want to display object X. Don't worry about displaying,

Act on click of a button on the Nav Bar for moreNavigationController — Can't pushviewcontroller

我的梦境 提交于 2019-12-13 04:44:24
问题 Okay, here is my issue: My app has a display of categories in the tab bar at the bottom of the iPhoneOS screen. This only allows 5 categories before it presents the MORE button. I have over 25 (please do not answer this by saying: "Rethink your application...etc" -- that was rudely said before. They are food, drink, etc categories and cannot be changed). I want to allow the user to put their favorites on the home page. The Apple moreNavigationController editing system only allows 20 tab bar

ViewController transition bottleneck in UITabBarController

邮差的信 提交于 2019-12-13 04:38:27
问题 When I tap on a specific UITabBarItem to switch ViewControllers, the transition takes about 4 - 5s. There is no heavy processing being done, so this leads me to believe that the code is simply inefficient. After having taken a look inside Instruments as suggested in the comments, I have pinpointed the following process to be taking ~> 2500 ms Running Time Self (ms) Symbol Name 2485.0ms 44.3% 0.0 TDescriptorSource::CopyDescriptorsForRequestFromArray(__CFArray const*, __CFDictionary const*,

How to exit from UITabBarController to UINavigationController on button click

大憨熊 提交于 2019-12-13 04:31:10
问题 I have a MainMenu which navigates me to a TabBarController with 4 views (4 Tabs) in it. Now I've a button in the 4th view of the TabBarController which OnClick should take me to the MainMenu. Problem is when I pushViewController (MainMenu) I'm not able to dismiss the TabBarController and also NavigationBar is not visible on the MainMenu!! Can someone please suggest me how to solve this, Thanks in advance. 回答1: Do not use this : [self.navigationController pushViewController

Set image for tab bar IOS

感情迁移 提交于 2019-12-13 04:27:40
问题 I'm experiencing issue when trying to set png image for tab bar item icon for my iOS application. If I'm creating png image (with transparent background) and setting it, everything works as expected, but when I'm using another png file (created by another person, or downloaded from web) it not works. Actually in my case I'm making png file from .pdf file and it's absolutely not clear for me why this not works. For more information please see screen captures below (top image represents not

Why DetailViewController pop to first DetailViewController with Tabbar and Navigation Controller?

佐手、 提交于 2019-12-13 03:58:01
问题 First of all I am using storyboard. My ViewController hierarchy like this NavigationController -> SplashScreen -> LoginScreen -> MainTabBarController -> MainNavigationController -> MainViewController -> DetailViewController . When I click a button on the DetailViewController page does not back to MainViewController . It is going to LoginScreen . I tried this codes within addToBasket action in DetailViewController . @IBAction func addBasket(_ sender: Any) { SingletonCart.sharedFood.food.append

Unwind Segue Hides Tab Bar

廉价感情. 提交于 2019-12-13 03:57:37
问题 I have the following layout : Tab Bar Controller Nav Controller View Controller 1 View Controller 2 I am currently trying to unwind segue from View Controller 2 to View Controller 1. The segue works however the tab bar disappears. Is there any way where I can force the tab bar to remain without removing the navigation controller. I have already tried the follow: setting the tabBar.isHidden property to false unchecking the hide bottom bar on push Any other ideas? Any help will be greatly

Custom navigationBar on moreNavigationController

故事扮演 提交于 2019-12-13 03:48:58
问题 Hot to customize navigation bar that appear on "More" tab in UITabBarController to have 2 px line (in different color) as bottom border? I created subclass of the UINavigationBar that overrides drawrect: method with drawing of that line, and that works for first four tabs, except tabs that are under more navigation controller. Any help? 回答1: #import <objc/runtime.h> And dynamically set the class of the more view controller's navigation bar: object_setClass(yourTabBarController

TabBarController switch views in TabBarItem

二次信任 提交于 2019-12-13 03:24:25
问题 I have a app based off the default xcode "Tab Bar Application" template. It has 3 tabBar Items that each load their own xib FirstView.xib, SecondView.xib, and ThirdView.xib. What i would like is a UIButton on the FirstView.xib that loads the FirstAltView.xib where the FirstView.xib is. Can someone please post some sample code on how to do this or a complete xCode project because i cannot figure out how to link the view controllers together. Here is a flow chart of how the flow of my app