GradientButton

@IBDesignable
class GradientButton : UIButton

Button with a gradient background

  • Gradient starting color

    Declaration

    Swift

    @IBInspectable
    var startColor: UIColor { get set }
  • Gradient ending color

    Declaration

    Swift

    @IBInspectable
    var endColor: UIColor { get set }
  • Gradient orientation

    Declaration

    Swift

    @IBInspectable
    var orientation: Int { get set }
  • Factory for gradient buttons triggering URL navigation

    Declaration

    Swift

    static func urlButton(title: String,
                          link: String) -> GradientButton

    Parameters

    title

    Button title

    link

    Triggered link

    Return Value

    Created button

  • Procedural intializer

    Declaration

    Swift

    override init(frame: CGRect)

    Parameters

    frame

    Display frame

  • Update screen rendering

    Declaration

    Swift

    override func layoutSublayers(of layer: CALayer)

    Parameters

    layer

    Our layer