Push ViewController from Right To Left with UINavigationController

You can create a NSMutableArray from the navigationController’s array of viewcontrollers and insert new viewController before the current one. Then set the viewControllers array without animation and pop back. UIViewController *newVC = …; NSMutableArray *vcs = [NSMutableArray arrayWithArray:self.navigationController.viewControllers]; [vcs insertObject:newVC atIndex:[vcs count]-1]; [self.navigationController setViewControllers:vcs animated:NO]; [self.navigationController popViewControllerAnimated:YES];

How to go back one view in UINavigationController?

I don’t mean to be rude, but this is really well documented. A google search or even an Apple documentation search on UINavigationController will turn up exactly what you need. To programmatically pop the current view controller you use: [[self navigationController] popViewControllerAnimated:YES]; To pop to a specific view controller, you use: [[self navigationController] popToViewController:controller animated:YES]; … Read more

On iOS 7, pushing a controller with a toolbar leaves a gap of unusable space if it’s ultimately contained within a tab bar controller

I found that adding the following 2 lines of code in viewDidLoad of SecondViewController (where you want to hide TabBar but show the tool bar) fixes the problem. self.extendedLayoutIncludesOpaqueBars = YES; self.edgesForExtendedLayout = UIRectEdgeBottom; My viewDidLoad of SecondViewController is as follows: – (void)viewDidLoad { [super viewDidLoad]; // These 2 lines made the difference self.extendedLayoutIncludesOpaqueBars = … Read more

Add toolbar to UITableViewController

No problem at all, UITableViewController is a subclass of UIViewController. And it so happens that in iPhone OS 3.0 any UIViewController (and subclasses) can work in conjunction with a UINavigationController to provide a context aware toolbar. In order for this to work you must: Make sure that you use a UINavigationController to contain all your … Read more

How to add image in UINavigationBar in IPhone app

One way to do this is to use UINavigationItem.titleView and UINavigationItem.rightBarButtonItem. Like this : viewController.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@”yourimage.png”]]; UIBarButtonItem * item = [[UIBarButtonItem alloc] initWithCustomView:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@”yourimage2.jpg”]]]; viewController.navigationItem.rightBarButtonItem = item; Here I am using UIImageView as custom view, but it can be UIButton with custom image.

How can I change the font of the back button for my navigation bar?

If you need to change font style entirely across you app (aka. each navigation button), preferred method is to use UIBarButtonItem.appearance() proxy. Sample code snippet would look like this: SWIFT 3.0+ //make sure font name u use below *actually* exists in the system ! //if it doesn’t app will crash because we’re force unwrapping an … Read more