I have a barbuttonitem which i have customised using a custom button with an image. I want to change this image everytime after I click it. Like on and off. Once I click it it will show OFF image. Then again it will go ON image.
Is it possible?
I have a barbuttonitem which i have customised using a custom button with an image. I want to change this image everytime after I click it. Like on and off. Once I click it it will show OFF image. Then again it will go ON image.
Is it possible?
Yes. In your target method just change out the UIBarButtonItem
- (void)toolbarButtonPressedAwesomeMethod {
Do awesome stuff...
// Change the button here…
UIBarButtonItem *bbi = [[[UIBarButtonItem alloc] init…
// Set it in the view
[self.navigationItem setRightBarButtonItem:bbi];
}