i am setting the state of a UIButton to highlighted state programmatically.
[currentButton setHighlighted:YES];
once the user presses the button, i need to check if it is already in the highlighted state and accordingly perform some action.开发者_StackOverflow But, the state of the button is getting changed automatically after it is being pressed. I think this is the default behavior of a UIButton. Is there any way in which i can first check wether the button is already in the highlighted state???
Hilighted state is only for that time when user press a button as user remove his finger it will return to its notmal state, you can set a selected state for a button and can check for this.
Maybe:
if(currentButton.highlighted){
}
精彩评论