Skip to content

Instantly share code, notes, and snippets.

@inailuy
Last active December 14, 2015 02:48
Show Gist options
  • Save inailuy/5016066 to your computer and use it in GitHub Desktop.
Save inailuy/5016066 to your computer and use it in GitHub Desktop.
Adding Navigation button to the right side
UIImage *buttonImage = [UIImage imageNamed:@"image"];
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(0, 0, 50, 44);
[button setImage:buttonImage forState:UIControlStateNormal];
[button addTarget:self
action:@selector(nil)
forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
self.navigationItem.rightBarButtonItem = barButtonItem;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment