Changing back button in iOS 7 disables swipe to navigate back

IMPORTANT: This is a hack. I would recommend taking a look at this answer. Calling the following line after assigning the leftBarButtonItem worked for me: self.navigationController.interactivePopGestureRecognizer.delegate = self; Edit: This does not work if called in init methods. It should be called in viewDidLoad or similar methods.

How to Edit Empty Spaces of Left, Right UIBarButtonItem in UINavigationBar [iOS 7]

I was also facing this problem. I also have feelings that in iOS 7 there is more space. And I figured out that this is about 10 points more. I usually use negative spaces when I want for LeftBarItemButton to start from the edge. This can be useful for you as well. UIBarButtonItem *negativeSpacer = … Read more

Add button to navigationbar programmatically

Inside my UIViewController derived class, I am using the following inside viewDidLoad: UIBarButtonItem *flipButton = [[UIBarButtonItem alloc] initWithTitle:@”Flip” style:UIBarButtonItemStyleBordered target:self action:@selector(flipView:)]; self.navigationItem.rightBarButtonItem = flipButton; [flipButton release]; This adds a button to the right hand side with the title Flip, which calls the method: -(IBAction)flipView This looks very much like you #3, but it is working … Read more

How to remove all navigationbar back button title

If you want back arrow so following code put into AppDelegate file into didFinishLaunchingWithOptions method. For Objective-C [[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60) forBarMetrics:UIBarMetricsDefault]; For Swift let BarButtonItemAppearance = UIBarButtonItem.appearance() BarButtonItemAppearance.setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.clear], for: .normal) Another option give below. In Objective C self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@”” style:UIBarButtonItemStylePlain target:nil action:nil]; In Swift self.navigationItem.backBarButtonItem = UIBarButtonItem(title:””, style:.plain, target:nil, action:nil) … Read more

“Plain Style unsupported in a Navigation Item” warning with my customized Bar Button Item

I was able to remove these errors by manually editing the storyboard files and find the offending style=”plain” entry on Bar Button items in the <navigationItem> element. Changed from: <barButtonItem key=”rightBarButtonItem” style=”plain” id=”juB-DL-F9i”> To: <barButtonItem key=”rightBarButtonItem” id=”juB-DL-F9i”> This cleared the warnings… right or wrong. This may be a stupendous hack and the larger concern is … Read more

How to set the action for a UIBarButtonItem in Swift

As of Swift 2.2, there is a special syntax for compiler-time checked selectors. It uses the syntax: #selector(methodName). Swift 3 and later: var b = UIBarButtonItem( title: “Continue”, style: .plain, target: self, action: #selector(sayHello(sender:)) ) func sayHello(sender: UIBarButtonItem) { } If you are unsure what the method name should look like, there is a special … Read more

Adding a UILabel to a UIToolbar

Have a look into this [[UIBarButtonItem alloc] initWithCustomView:yourCustomView]; Essentially every item must be a “button” but they can be instantiated with any view you require. Here is some example code. Note, since other buttons are typically on the toolbar, spacers are placed on each side of the title button so it stays centered. NSMutableArray *items … Read more

xcode/storyboard: can’t drag bar button to toolbar at top

I have got the same problem using Xcode6 and I noticed that UINavigationItem is added automatically for the first ViewController that you embed into NavigationController but for the subsequent ViewControllers, you will have to add it manually as follows: In the Object library, find Navigation Item then drag it to your 2nd ViewController in the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)