uinavigationcontroller

iPhone - Change target or selector for Back Button on UINavigationController

烈酒焚心 提交于 2019-12-21 06:18:36
问题 The default behaviour when pushing a UIViewController on a UINavigationController is for the OS to display a back button that pops the UIViewController off again. I have the desire to set a different behavior for this back button (to go back two screens) - is there anyway I can do this without having to create my own back button with custom graphic etc. Thanks :) 回答1: As I half suspected originally, this isn't possible any exceptionally easy way. So same method applies when creating any

Pushing View Controller Twice

 ̄綄美尐妖づ 提交于 2019-12-21 06:07:40
问题 Within my app I'm having an issue with the following error: Pushing the same view controller instance more than once is not supported It's a bug report that's comeback from a few users. We've tried to replicate it but can't (double tapping buttons etc). This is the line we use to open the view controller: let storyboard = UIStoryboard(name: "Main", bundle: nil) let editView = storyboard.instantiateViewControllerWithIdentifier("EditViewController") as! EditViewController editView.passedImage =

Best practice for switching between UINavigationController stacks in Storyboard

好久不见. 提交于 2019-12-21 05:06:42
问题 In our storyboard we have multiple UINavigationController stacks. For example, the LoginViewController stack is completely separate from the SWRevealViewController stack. What's the best practice for switching between them? When I press the logout button (the logout button is on the SWRevealController stack) and then try to present the LoginViewController stack, I get an error like this: Warning: Attempt to present LoginViewController on SWRevealViewController whose view is not in the window

Passing ManagedObjectContext to view controllers using storyboards with a root UITabBarController

最后都变了- 提交于 2019-12-21 04:52:39
问题 Using storyboards you have no easy access to the first view controller in appDelegate (though once you do prepareForSegue makes it easy to pass the ManagedObjectContext down the navigation stack. I've settled on giving each view controller (or superclass of each view controller) requiring Core Data access a moc member: @synthesize moc = _moc; @property (nonatomic) __weak NSManagedObjectContext *moc; I'm uneasy about it because it doesn't seem a very elegant way to do it - too much code. But

UINavigationController back button half works in iPad landscape orientation

守給你的承諾、 提交于 2019-12-21 04:42:06
问题 In an iPad application with a UINavigationController, everything works in portrait mode but in landscape mode the back button sometimes only goes back half a level. That is to say, on the first press the title bar animates as if it was popping a controller, and on the second press it animates the content popping. Has anyone found a solution to this? The contradictory solution in this question did not help. I have a shouldAutorotate method in the navigation controller but no others. -(BOOL)

Making back button for root view in UINavigationController

时光怂恿深爱的人放手 提交于 2019-12-21 03:48:13
问题 So I created a UINavigationController manually, set it as my UIWindow's rootViewController, and I would like to use a back button to exit the UINavigationController and load another viewController in its place. However, the backItem property of the UINavigationBar is readonly , so I don't know how to set it properly (it is readonly and defaults to nil in the root navigation view). How can I achieve this (or similar effect, I want to be able to effectively "exit" this UINavigationController by

How to set title of Navigation Bar in Swift? [duplicate]

坚强是说给别人听的谎言 提交于 2019-12-21 03:17:24
问题 This question already has answers here : what would be a proper storyboard example of combining nav bars and tab bars in one app? (2 answers) Closed 4 years ago . I'm trying to set title of Navigation Bar in Swift, I set Tab Bar and in Navigation Bar nothing is showing, no button, no title, nothing. I used some code but it's not working while I use Tab Bar , and when I deleted Tab Bar , code is working and everything is ok with Navigation Bar , title is showing and buttons are showing. Code

Swipe back and forward on navigationController

对着背影说爱祢 提交于 2019-12-21 02:59:25
问题 Each UIViewController, starting with rootViewController uses [self.navigationController pushViewController nextView] to push new views. Swipe works fine. How can I implement the same behavior for the swipe forward? I more exactly, how I keep the UIViewController after popped with swipe back or back button, so I can add it again in case of swipe forward? 回答1: To keep track of your view controllers, you could do the following: Add an instance variable (as a strong property) nextViewController

Using pkrevealcontroller on existing Xcode storyboard

人盡茶涼 提交于 2019-12-21 02:52:05
问题 I am trying to integrate the pkrevealcontroller sliding menu into an existing iOS project that has an existing storyboard with segues, etc. I extended UINavigationViewController and linked my new class to the Nav Controller on the storyboard. In my app delegate I do the following: MainNavViewController *frontViewController = [[MainNavViewController alloc] initWithRootViewController:[[myRootViewController alloc] init]]; UIViewController *rightViewController = [[menuViewController alloc] init];

How to create an UIViewController with UINavigationController with Interface Builder?

眉间皱痕 提交于 2019-12-21 02:48:09
问题 In my iOS application, I want to provide a settings-view. "presentModalViewController" works very well: ViewSettings *controller = [[ViewSettings alloc] initWithNibName:@"ViewSettings" bundle:nil]; UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:controller]; [self.navigationController presentModalViewController:navController animated:YES]; [controller release]; [navController release]; Unfortunately, I have to change my running code and