uitabbarcontroller

Hide UITabBar in landscape

ぐ巨炮叔叔 提交于 2021-02-08 09:51:40
问题 How does one hide the UITabBar programmatically? It's been asked and answered multiple times on SO, but the answers seem to come in roughly two varieties: 1) Using a navigation controller, one can hide the next vc's tab bar before the push using hidesBottomBarWhenPushed property. Typical answer here. 2) Walk through the tabbar controller's view hierarchy and modify the tab bar's frame and/or visibility. Typical answer here. But both sorts of answers fall short, imo. 1) What if we need to hide

Properly redirect to a view controller inside tab bar's navigation controller when push notification is clicked

痴心易碎 提交于 2021-02-07 14:35:12
问题 I have a tabBar . Each of its tabs' ViewControllers have been embedded inside their respective NavigationControllers . Hierarchy: Tabbarcontroller --> NavigationController --> VC1 --> VC2 -->...VCn (for tab1) I have to redirect to one of the viewcontrollers say VC2 when i click on push notifications. The code i am using is as follows. let navigationController = UINavigationController() let storyboard = UIStoryboard.init(name: "Main", bundle: Bundle.main) if let chatViewController = storyboard

Properly redirect to a view controller inside tab bar's navigation controller when push notification is clicked

限于喜欢 提交于 2021-02-07 14:32:29
问题 I have a tabBar . Each of its tabs' ViewControllers have been embedded inside their respective NavigationControllers . Hierarchy: Tabbarcontroller --> NavigationController --> VC1 --> VC2 -->...VCn (for tab1) I have to redirect to one of the viewcontrollers say VC2 when i click on push notifications. The code i am using is as follows. let navigationController = UINavigationController() let storyboard = UIStoryboard.init(name: "Main", bundle: Bundle.main) if let chatViewController = storyboard

How to refresh Tab Bar Items in swift ios

痴心易碎 提交于 2021-02-07 13:14:09
问题 I do app like Instagram with tab bar items. In app I have simple user and company user . I have main ViewController: MainTabBarController: UITabBarController with 5 tab bar items. And each item has own ViewController I need refresh MainTabBarController when user is Simple user it is 5 items and when user is Company user it is 4 items. How to refresh or reload without close app? One solution I already do with UserDefaults, but need close app. Platform iOS > 9.0, Swift 3.0 回答1: Use

How to refresh Tab Bar Items in swift ios

那年仲夏 提交于 2021-02-07 13:12:44
问题 I do app like Instagram with tab bar items. In app I have simple user and company user . I have main ViewController: MainTabBarController: UITabBarController with 5 tab bar items. And each item has own ViewController I need refresh MainTabBarController when user is Simple user it is 5 items and when user is Company user it is 4 items. How to refresh or reload without close app? One solution I already do with UserDefaults, but need close app. Platform iOS > 9.0, Swift 3.0 回答1: Use

Swift Placing TabBar on top of the screen not working in iOS 11

只谈情不闲聊 提交于 2021-02-07 10:51:39
问题 In UITabBarController, I am placing the tab bar on top of the screen using below code : self.tabBar.frame = CGRectMake(0,0,UIScreen.mainScreen().bounds.width,50) This works perfectly on iOS 10. But when the same app is installed on iOS11. It placing at the bottom only and not moving up. Realy dont know what has changed in iOS11 But How to move tabbar up for iOS 11 回答1: After so much struggle figured out the solution. I was placing the tabBar.frame code inside viewDidAppear which works for iOS

Swift -Tabbar item frame is returning questionable value when converting frame to window

我的未来我决定 提交于 2021-01-29 17:22:48
问题 I have a tabBar with 5 items. To get the frame of the first tabBar item and set something based on that frame I use this which works perfectly: guard let firstTab = tabBarController?.tabBar.items?[0].value(forKey: "view") as? UIView else { return } guard let window = UIApplication.shared.windows.filter({$0.isKeyWindow}).first else { return } let windowRect = lastTab.convert(firstTab.frame, to: window) print(firstTab) // (2.0, 1.0, 79.00000000298023, 48.0) print(windowRect) // (4.0, 689.0, 79

Programmatically assign view controller to tab bar controller

夙愿已清 提交于 2021-01-28 07:08:21
问题 I am fairly new to swift and am trying to create a movie database application using TMDB from Apiary. I have created the layout of the view controllers for one category. However, I am planning to have multiple categories, the but only difference between them is the data I retrieve from the API. For example "now_playing" key gets the now playing list and the "top_rated" key gets the top rated list of movies. When I was initially doing this I created the tab bar controller in AppDelegate.swift

Blank space coming between keyboard and UIVew in iOS

纵然是瞬间 提交于 2020-12-06 05:41:42
问题 I have a tab bar controller-based application and I am using IQKeyboardManager to handle form-like stuff. Step 1: Tab bar controller with bottom a UITextView inside a UIView . Check Image 1. Step2: When I click on UITextView , the keyboard appears but a blank space is appearing due to the tab bar. I have tried to remove IQKeyboardManager but it still occurs, so it is confirmed that it is not the issue of IQKeyboardManager . It is an issue due to the tab bar controller. How to remove that