Custom image of the Back button on the navigation bar does not work! [iPhone SDK]

Hi guys, I am creating a custom navigation button, but when I add this code my spin animation is not working and comes back with .why animation? I think it depends on my @selector action!

- (void)viewDidLoad {


    UIButton *button =  [UIButton buttonWithType:UIButtonTypeCustom];
    [button setImage:[UIImage imageNamed:@"goback.png"] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(//HERE ! i don't know put what thing !) forControlEvents:UIControlEventTouchUpInside];
    [button setFrame:CGRectMake(0, 0, 32, 32)];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];


}
+3
source share
1 answer

ok I created a function and works fine: D:

-(void)pushNav {
[self.navigationController popViewControllerAnimated:YES];  
}
+3
source

Source: https://habr.com/ru/post/1727201/


All Articles