How can I do programmatically gradient border color UIButton with Swift [closed]
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . How can I design programmatically UIButton like this gradient border color? ] Thanks for help 回答1: let gradient = CAGradientLayer() gradient.frame = CGRect(origin: CGPointZero, size: self.myButton.frame.size) gradient.colors = [UIColor.blueColor().CGColor, UIColor.greenColor()