How to show border around button control or label control

How do I make the label control or the button control show a border around the edges?

If you look into the inheritance of objects like UILabel you see all UIViews have a CALayer. The layer object can do a lot for you but what you want is something like

button.layer.borderWidth = 2.0
button.layer.borderColor = UIColor.cyan.cgColor

(Swift 3)
try it out and see how you go.