Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

swift uiview gradient

let view = UIView(frame: CGRect(x: 0, y: 0, width: 320, height: 50))
let gradient = CAGradientLayer()

gradient.frame = view.bounds
gradient.colors = [UIColor.white.cgColor, UIColor.black.cgColor]

view.layer.insertSublayer(gradient, at: 0)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #swift #uiview #gradient
ADD COMMENT
Topic
Name
3+6 =