import Cocoa
class BackUpFirstSetVC: NSViewController {
@IBOutlet weak var topView: NSBox!
override func viewDidLoad() {
super.viewDidLoad()
// Do view setup here.
let gradLayer = CAGradientLayer.init()
gradLayer.startPoint = CGPoint.init(x: 0.5, y: 0.68)
gradLayer.endPoint = CGPoint.init(x: 0.5, y: 0.11)
gradLayer.colors = [NSColor.init(hexColorString: "D8D8D8").cgColor,NSColor.init(hexColorString: "EEEEEE").cgColor]
gradLayer.locations = [0,1]
topView.wantsLayer = true
topView.layer = gradLayer
view.wantsLayer = true
view.layer?.backgroundColor = NSColor.white.cgColor
}
}
网友评论