I've a backBarButtonItem for few view controllers it is default showing with back arrow and text I wanted to create a leftBarButtonItem for some other view controller(which are presented instead of push).
How can I create a leftBarButtonItem should look same as backBarButtonItem in Objective C
backBarButtonItem Implemention and ViewControllers are pushed.
UIBarButtonItem *backNavigationItem = [[UIBarButtonItem alloc] initWithTitle:@"Back"
style:UIBarButtonItemStylePlain
target:self
action:nil];
NSString *accentContrastcolorString = [NSUserDefaults.standardUserDefaults valueForKey:@ "AccentcontrastColor"];
UIColor *accentContrastcolor = [self colorFromHexCode:accentContrastcolorString];
backNavigationItem.tintColor = accentContrastcolor;
viewController.navigationItem.backBarButtonItem = backNavigationItem;
I've created leftBarButtonItem as like below it shows Back title need left arrow arrow with same size.
UIBarButtonItem *bacNavigationItem = [[UIBarButtonItem alloc] initWithTitle:@"Back"
style:UIBarButtonItemStylePlain
target:self
action:@selector(backButtonTapped:)];
NSString *accentContrastcolorString = [NSUserDefaults.standardUserDefaults valueForKey:@ "AccentcontrastColor"];
UIColor *accentContrastcolor = [self colorFromHexCode:accentContrastcolorString];
bacNavigationItem.tintColor = accentContrastcolor;
viewController.navigationItem.leftBarButtonItem = bacNavigationItem;
Followed some other links but not working as expected can anyone suggest solution.
How to make leftBarButtonItem looking like backBarButtonItem?