UIButton tint color not working for whole button? Set in storyboard?
<p>I have looked through other questions but can't find a definitive answer - I created my UIButton in my storyboard (not programmatically) and I am trying to tint the WHOLE button (not just text) on click. I have set my tint color to black and yet this does not affect the whole button.</p>

<p>I have tried setting my type to System as I heard that affects it but nothing has changed. Still no tint.</p>

<p>Furthermore I have to touch/click very "forcefully" (really press down if on device) to even trigger the tint color affecting the text on the button even though the button click registers. </p>

<p>The button's action func will be called so it does not affect functionality, but the text "highlighted state" seems to be only triggered if the user clicks really hard. </p>

<p>How can I tint the entire button? And why would the highlighted state only be triggered with really forced clicking?</p>

<p>Setting tint color - </p>

<p><a href="https://i.stack.imgur.com/aoQyq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aoQyq.png" alt="enter image description here"></a></p>

<p>Trying to implement with IBOutlet:</p>

<pre><code>@IBOutlet var postBtn: UIButton!
postBtn = customButton()
        postBtn.highlightedColor = UIColor.blueColor()
</code></pre>

<p>after creating custom class in new file:</p>

<pre><code>public class customButton: UIButton {
    public var highlightedColor = UIColor.blueColor()
    public var unhighlightedColor = UIColor.clearColor()
    override public var highlighted: Bool {
        didSet {
            if (highlighted) {
                self.backgroundColor = UIColor.blueColor()
            }
            else {
                self.backgroundColor = UIColor.clearColor()
            }

        }
    }

}
</code></pre>

<p>I either get a bad access error if I declare postBtn initially as a <code>customButton()</code> or I am told postBtn has no member called highlightedColor. What am I doing wrong?</p>