I created a UIView with red background color, and a white border of 1pt width with following code.:
let myView = UIView(frame: CGRect(x: 100, y: 100, width: 20, height: 20))
self.view.addSubview(myView)
myView.backgroundColor = UIColor.red
myView.layer.borderColor = UIColor.white.cgColor
myView.layer.borderWidth = 1
myView.layer.cornerRadius = 10
But the myView rendered with a red outline, how to get rid of it? A enlarged screenshot is attached.