How can I make the border color of a UIView gradient?
I have declared a UIView from my storyboard and I know how to make the border color solid. But I can't find out how to make the border gradient.
@IBOutlet weak var view: UIView!
override func awakeFromNib() {
super.awakeFromNib()
let gradient = CAGradientLayer()
gradient.colors = [UIColor.white.cgColor, UIColor.black.cgColor]
view.backgroundColor = nil
view.layer.cornerRadius = view.bounds.width / 2
view.layer.borderWidth = 3
view.layer.borderColor = colorOutline.cgColor
nah.textColor = colorCircleBlue
}