Update - based on this answer - stack overflow.site/questions/522934 / ...
It looks like you will need to do something like this so that the button itself disappears.
[self.navigationItem setRightBarButtonItem:nil animated:YES];
And do something like this to make it disappear in
[self.navigationItem setRightBarButtonItem:myButton animated:YES]
Otherwise, if you want more control over the properties of the animation, you need to create your own view, which I consider.
EDIT: I just confirmed that you can change the custom look of the UIBarButtonItem using this.
As a test, I created a simple project and dropped the UIBarButtonItem into the navigation bar. I created an output for the view controller. In viewDidLoad on the view controller, I set up a custom view
-(void)viewDidLoad{ [super viewDidLoad]; UILabel *lbl = [[UILabel alloc]initWithFrame:CGRectMake(0,0,40,40)]; lbl.text = @"test"; UIView *customView = [[UIView alloc]initWithFrame:CGRectMake(0,0,40,40)]; [customView addSubview:lbl]; self.barButtonItem.customView = customView; }
As a test in viewDidAppear, I animated it
-(void)viewDidAppear:(BOOL)animated { [UIView animateWithDuration:3.0 delay:3.0 options:UIViewAnimationOptionCurveEaseOut animations:^{ self.barButtonItem.customView.alpha = 0; } completion:^(BOOL finished) { NSLog(@"animation complete"); }];
EDIT: Here's a link to the apple documentation for a full explanation of the UIView animation. https://developer.apple.com/library/ios/documentation/windowsviews/conceptual/viewpg_iphoneos/animatingviews/animatingviews.html
digitalHound
source share