Skip to content

3.0 Migration Guide

George Kye edited this page Sep 30, 2018 · 2 revisions

ComplimentaryGradientView 3.0 Migration Guide

As a major release, following Semantic Versioning conventions, 3.0 introduces API-breaking changes.

This guide is provided in order to ease the transition of existing applications to the latest APIs, as well as explain the design and structure of new and updated functionality.

Requirements

  • iOS 9.0+tvOS 9.0+ and watchOS 2.0+
  • Xcode 8.1+
  • Swift 3.0+

Breaking API Changes

Creating a gradient

All previous GradientType options have compact into:

public enum GradientVariant: String {
  case primary
  case secondary
  case background
  case detail
 }

GradientVariant can be used to create a more flexiable gradient when using .colors(start: GradientVariant, end: GradientVariant) option.

Set Gradient via Storyboard

The Gradient type property can be set via storyboard by contanating two GradientVariant with a dot delimeter

Example

primary.secondary

Examples

     graidentView.gradientType = .colors(start: .background, end: .secondary)
     graidentView.gradientStartPoint = .topRight

Set gradient using all colors

     compGraidentView.gradientType = .all