title: Change UIButton border color after tapping it
body: <p>I have customized my own button. I want to change the button textcolor and the border color when I tap on it. I override the UIButton setHighlighted method by the following code</p>
  
  <pre><code>if (highlighted) {
      self.layer.borderColor = [[UIColor colorWithRed:0.447 green:0.443 blue:0.443 alpha:1.000] CGColor];
      self.titleLabel.textColor = [UIColor colorWithRed:0.447 green:0.443 blue:0.443 alpha:1.000];
  }
  else{
      self.layer.borderColor = [[ UIColor whiteColor] CGColor];
      self.titleLabel.textColor = [UIColor whiteColor];
  }
  </code></pre>
  
  <p>However, it won't work when I just tap the button, and it would change the color when I made a move on the button.
  I tried to create the breakpoint to check whether this function could be entered correctly. I observed that these codes would be executed once when I just tap the button(triggered by touchbegan event), but be executed twice when I further move on it(triggered by touchbegan, touchmove event ). </p>
  
  <p>I also try to add the action on the view level: </p>
  
  <pre><code>[downloadBtn addTarget:self action:@selector(allDownloadBtnClicked:) forControlEvents:UIControlEventTouchUpInside];
  [downloadBtn addTarget:self action:@selector(allDownloadBtnHighlighted:) forControlEvents:UIControlEventTouchDown];
  </code></pre>
  
  <p>But it still can't be operated as my expection.</p>
  
  <p>Anyone could give me any suggestion to achieve my goal? Thanks!</p>