I have a need for a UIButton that knows it's state (there are 5 possible) so that the when the Touch Up Inside is handled, I can query the state from the button and act accordingly.
In pseudo-code (and in Java) it would be something like this:
Code:
class MyButton extends UIButton {
private int myState = 0;
public MyButton() {
super();
}
public void setState(int state) {
myState = state;
}
public int getState() {
return myState;
}
}
Can this be done with a UIButton, and if so, how? Examples at this point would be wonderful.
Thanks!