ViewGradient
public struct ViewGradient
Represents a gradient that can be applied to a view. It can have many colors distributed in many ways and directions.
Note
There can only be one gradient at a time in a view.-
Direction of the gradient.
Declaration
Swift
public let direction: GradientDirection -
GradientColors involved in the order involved.
Declaration
Swift
public let colors: [GradientColor] -
Initializes an inmutable ViewGradient.
Declaration
Swift
public init(colors: [GradientColor], direction: GradientDirection)Parameters
colorsArray of GradientColors to be used.
directionDirection in which the gradient should develop.
-
Initializes an inmutable ViewGradient.
Declaration
Swift
public init(colors: [UIColor], direction: GradientDirection)Parameters
colorsArray of UIColors in the order in which to place them. They will be evenly separated.
directionDirection in which the gradient should develop.
ViewGradient Structure Reference