How can I add right border on an UIView on Swift 3?
<p>I have an <code>UIView</code> on the top of my screen and I want to add a right border of 1 pixel to it.</p>

<p>Here is the code that I have by the moment:</p>

<pre><code>var border = CALayer()
border.backgroundColor = UIColor(red: 241, green: 10, blue: 9, alpha: 1).cgColor
border.frame = CGRect(x: topView.frame.width + 1, y: 0, width: 1, height: topView.frame.height)
topView.layer.addSublayer(border)
</code></pre>

<p>but I am not able to get it work.</p>

<p>What can I do to add a right border to my <code>UIView</code>?</p>

<p>Thanks in advance!</p>