I am trying to set a state for UIButton.
But i don\'t know the difference between the UIControlStateHighlighted
and UIControlStateSelected
.
From the official doc:
UIControlStateHighlighted Highlighted state of a control. A control enters this state when a touch enters and exits during tracking and when there is a touch up event. You can retrieve and set this value through the highlighted property.
UIControlStateSelected Selected state of a control. For many controls, this state has no effect on behavior or appearance. But other subclasses (for example, the UISegmentedControl class) may have different appearance depending on their selected state. You can retrieve and set this value through the selected property.
Your button get highlighted
in reaction of a touch event. It could then be on a selected
state within a group (for segmented control).