This is the code for corners.
self.newView.layer.cornerRadius = 5.0
self.newView.layer.clipsToBound = true
Please help me with the shadow code as well
This is the code for corners.
self.newView.layer.cornerRadius = 5.0
self.newView.layer.clipsToBound = true
Please help me with the shadow code as well
You do add a shadow layer in a similar way:
newView.layer.cornerRadius = 5
newView.backgroundColor = .blue
newView.clipsToBounds = true
// shadow
newView.layer.shadowColor = UIColor.black.cgColor
newView.layer.shadowOpacity = 0.5
newView.layer.shadowOffset = CGSize(width: 10, height: 10)
newView.layer.shadowRadius = 10
newView.layer.masksToBounds = false