uinavigationcontroller

Adjust position of custom Navigation Back Button

一个人想着一个人 提交于 2019-12-24 18:48:31
问题 I am using a custom image as the back button of my Navigation Controller but the problem is that the image is not aligned correctly with the title and the right button item. I've been trying to move the back button down a few pixels with no success. extension UINavigationController { func addBackButton() { let imgBack = UIImage(named: "ic_back") navigationBar.backIndicatorImage = imgBack navigationBar.backIndicatorTransitionMaskImage = imgBack navigationBar.topItem?.backBarButtonItem =

Navigation Controller - How to Add in Another View Controller in Xcode?

隐身守侯 提交于 2019-12-24 18:12:52
问题 I'm relatively new to iOS programming but I'm learning bit by bit. I've got two nib files, one is my HomeViewController and the other is called 'ReceiptTableViewController'. The HomeVC should not have a top nav bar but the ReceiptTableVC should, with a title and 'back' where the user can swipe to go back to HomeVC. How would I go about adding this? I've dragged the Navigation Controller to the side of my ReceiptTableVC in the nib file. I've searched for various answers but some contradict

Variable not changed in custom initialiser

微笑、不失礼 提交于 2019-12-24 17:48:00
问题 I am trying to set a value of variable in swift when initialising an instance of a UINavigationController subclass. The code looks like this: private var initWithRootViewController = false init() { super.init(rootViewController: contentVC) initWithRootViewController = true } init(parameters: OAuth2Parameters) { initWithRootViewController = true super.init(rootViewController: contentVC) initWithRootViewController = true //defer { initWithRootViewController = true } } required init?(coder

Swift: Presenting modally and dismissing a navigation controller

你离开我真会死。 提交于 2019-12-24 17:09:50
问题 I have a very common iOS app scenario: The MainVC of the app is a UITabBarController . I set this VC as the rootViewController in the AppDelegate.swift file: func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { window = UIWindow() window?.rootViewController = MainVC() window?.makeKeyAndVisible() } When the user logs out, I present a navigation controller with the LandingVC as the root view controller of

unable to stop device rotation

泪湿孤枕 提交于 2019-12-24 15:18:27
问题 I have posted a question here . In which one buddy replied and gave solution. Although the solution is working on few view controllers but on view its not working. When I enter a view controller that has TabController + navigation controller on there tab Bar Items, the code doesn't work. and the views are able to rotate. I used the Following code for iOS 6.1 //For iOS6 - (BOOL)shouldAutorotate { return NO; } - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return

iOS - go to second uiviewcontroller of some tab from another tab

旧巷老猫 提交于 2019-12-24 14:39:12
问题 I'm developing an iOS 5 app using Storyboard. I have UITabBarController which has 3 tabs. Every tab has its own UINavigationController . UINavigationController of first tab has one UITableViewController which segues to another UIViewController etc. UINavigationController of second tab has only one UIViewController . What I want to achieve is to navigate to UIViewController (second view in UINavigationController of first tab) when certain action happens in UIViewController of second tab. I've

UITabBar with UINavigationController in code

耗尽温柔 提交于 2019-12-24 14:30:45
问题 I've currently got a UITabBar with 5 screens calling UIViews. That part works fine but I want to put in a UINavigationController in a couple of them. I have found a few tutorials that work fine but all of them implement it in IB and I want to avoid that if possible. I'm lost as to where to implement the UINavigationController, should I do it in the App Delegate with the UITabBar and call the navigation controller from the UIView or should I create it in the UIView class? I've tried about 8

Call NavigationController (xib) from ViewController (storyboard)

拟墨画扇 提交于 2019-12-24 13:42:08
问题 I'm normally just use storyboard for my iOS, but needed to integrate an SDK which does not use storyboard, rather xib. My initial view controller is from storyboard, and when a button is pushed (IBAction), I would like it to go to the xib view controller, but not sure how programmatically to do so. Here is my AppDelegate: //AppDelegate.m - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:...{ // set to storyboard on launch UIStoryboard *mainStoryboard =

Swift: SWReavealController Can't Swipe to close menu “only open with swipe”

偶尔善良 提交于 2019-12-24 13:28:50
问题 This is Slideout menu using SWRevealController Which run perfectly but can swipe to open but doesn't swipe to close the menu After adding the library I did few changes but I did know where is the issue. This is the code in the main viewcontroller @IBOutlet weak var menuButton:UIBarButtonItem! override func viewDidLoad() { super.viewDidLoad() if self.revealViewController() != nil { menuButton.target = self.revealViewController() menuButton.action = "revealToggle:" self.revealViewController()

issue while changing Navigation Root View Controller

巧了我就是萌 提交于 2019-12-24 13:15:59
问题 I am making an app. In which First User have to sign In then He allowed to use the app. After successful login I want the user to directly switch to my HomeViewController. Here is my code tho change navigation root view but it is not working TermsConditionsController *firstViewController = [[TermsConditionsController alloc]init]; FirstPage *secondViewController = [[FirstPage alloc]init]; firstViewController.navigationController.viewControllers = [NSArray arrayWithObject: secondViewController]