2// Extenstions+IBDesignable.swift
5// Created by cstore on 16/11/2019.
6// Copyright © 2019 Daria Rednikina. All rights reserved.
11@IBDesignable class RadialGradientView: UIView {
13 @IBInspectable var outsideColor: UIColor = UIColor.red
14 @IBInspectable var insideColor: UIColor = UIColor.clear.withAlphaComponent(0)
16 override func draw(_ rect: CGRect) {
17 let colors = [insideColor.cgColor, outsideColor.cgColor] as CFArray
18 let endRadius = sqrt(pow(frame.width/2, 2) + pow(frame.height/2, 2))
19 let center = CGPoint(x: bounds.size.width / 2, y: bounds.size.height / 2)
20 let gradient = CGGradient(colorsSpace: nil, colors: colors, locations: nil)
21 let context = UIGraphicsGetCurrentContext()
23 context?.drawRadialGradient(gradient!, startCenter: center, startRadius: 0.0, endCenter: center, endRadius: endRadius, options: CGGradientDrawingOptions.drawsBeforeStartLocation)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list