UIButton label not showing
<p>I have the following code</p>

<pre><code>let width = UIScreen.mainScreen().bounds.width    
let linkLabel = UILabel(frame: CGRect(x: 8, y: contentHeight, width: 100, height: labelHeight))
    let linkButton = UIButton(frame: CGRect(x: 108, y: contentHeight, width: width - 108, height: labelHeight))
    mainScrollView.addSubview(linkLabel)
    mainScrollView.addSubview(linkButton)
    linkLabel.text = "Link:"
    linkButton.addTarget(self, action: #selector(linkButtonPressed), forControlEvents: .TouchUpInside)
    linkButton.setTitle("http://example.com", forState: .Normal)
    linkButton.layer.borderWidth = 1.0

    mainScrollView.contentSize = CGSize(width: view.frame.width, height: contentHeight)
</code></pre>

<p>And when view loads i see the following picture (Note that button is black rectangle):
<a href="https://i.stack.imgur.com/Pknro.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Pknro.png" alt="enter image description here"></a></p>

<p>So title is not visible but when i click on the button i can fetch its title property</p>

<pre><code>func linkButtonPressed(sender: UIButton) {
    print("button title = \(sender.titleLabel?.text)")
}
</code></pre>

<p>And i get the <code>button title = Optional("http://example.com")</code> but anyway button title is not visible. Any suggestions?</p>