title: How to remove grey layer on half transparent button when clicked
body: <p>I would like to disable the grey layer that appears when a button is pressed. My button has a special shape and a part of it is transparent.</p>
  
  <p><strong>Not pressed:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/ktwzO.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ktwzO.jpg" alt="Not pressed"></a></p>
  
  <p><strong>pressed:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/HiIbx.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HiIbx.jpg" alt="pressed"></a></p>
  
  <p>My button is inside a UIView. My UIView has a <code>clearColor()</code> background. I already tried to set a background image for the button for the state Normal and Highlighted:</p>
  
  <p><code>agendaButton.setBackgroundImage(UIImage(), forState: .Normal)</code>
  <code>agendaButton.setBackgroundImage(UIImage(), forState: .Highlighted)</code></p>
  
  <p>I also tried to set the same image for both states:</p>
  
  <p><code>agendaButton.setImage(UIImage(named: "agenda"), forState: .Normal)</code>
  <code>agendaButton.setImage(UIImage(named: "agenda"), forState: .Highlighted)</code></p>
  
  <p>I tried to set the image as a subview of my view and put a transparent button on top:</p>
  
  <p><code>agendaView.addSubview(UIImageView(image: UIImage(named: "agenda")))</code></p>
  
  <p>I also tried to set <code>agendaButton.adjustsImageWhenHighlighted = false</code>
  and to set only the image for the <code>.Normale</code> state. Or to set the image for both state. I still have the grey layer. I wondered if it was maybe the UIView that becomes grey but apparently not. I set the <code>UIView</code> background in red and made the button smaller, and I can see that it is clearly the button that becomes grey and not the UIView.</p>
  
  <p>I tried to do everything programmatically and to set my <code>UIButton</code> type as <code>.Custom</code> and with <code>agendaButton.adjustsImageWhenHighlighted = false</code> and <code>agendaButton.setImage</code>, then with <code>agendaButton.setBackgroundImage</code>, both for <code>.Normal</code> and <code>.Highlighted</code> state. Same behaviour.</p>
  
  <p>I wonder if there is a way to deactivate this gray layer to come.</p>
  
  <p>The thing is that the white part of the button does not become grey, only the transparent part. I tried multiple solutions I found on SO, but couldn't find any for partially transparent button.</p>