title: UIButton: when isHighlighted = true, I can only call a function by swiping my finger
body: <p>Need some of your great knowledge :) </p>
  
  <p>I wrote a subclass of UIButton (<em>CustomWideButton.swift</em>) without using a UIButton object. I did it this way because it's more flexible for the types of buttons I need to create. </p>
  
  <p>There is a strange thing and I don't know if it is a normal behaviour. </p>
  
  <p><strong>var isHighlighted</strong> is called when tapping the button area which is normal. So if I write something like this:</p>
  
  <pre class="lang-swift prettyprint-override"><code>var isHighlighted {
      didSet {
        print("I am Highlighted")
        animateHighlight()
      }
  }
  </code></pre>
  
  
  
  <p>I will see in the console "I am highlighted", but it won't call <em>animateHighlight()</em> unless I slightly start swiping my finger on the button. If I do so, then <em>animateHighlight()</em> works.</p>
  
  <p>I posted a sample project on BitBucket so it'll be easier for you to understand the issue I'm facing:
  <a href="https://bitbucket.org/stephaneDepoilly/stackohighlightedbutton" rel="nofollow noreferrer">https://bitbucket.org/stephaneDepoilly/stackohighlightedbutton</a></p>
  
  <p>Direct link for zip: <a href="https://bitbucket.org/stephaneDepoilly/stackohighlightedbutton/get/ee4fc398f475.zip" rel="nofollow noreferrer">https://bitbucket.org/stephaneDepoilly/stackohighlightedbutton/get/ee4fc398f475.zip</a></p>
  
  <p>I'm sorry if the custom button code looks overkill, it's because I partially extracted it from my project and we're using MVVM.</p>
  
  <p>Thanks in advance for your help!</p>