Rule

public struct Rule : ProxyElement

A solid line, parallel to the x or y axis, with a fixed thickness but unconstrained in length, suitable for use as a separator.

  • Represents whether the rule is parallel to the x or y axis.

    See more

    Declaration

    Swift

    public enum Orientation
  • Represents the thickness of a rule in the direction perpendicular to its orientation.

    See more

    Declaration

    Swift

    public enum Thickness
  • Whether this rule is horizontal or vertical.

    Declaration

    Swift

    public var orientation: Orientation
  • The thickness of this rule in the direction perpendicular to its orientation.

    Declaration

    Swift

    public var thickness: Thickness
  • The color that the rule should be drawn.

    Declaration

    Swift

    public var color: UIColor
  • Initializes a Rule with the given properties.

    Declaration

    Swift

    public init(orientation: Orientation, color: UIColor, thickness: Thickness = .hairline)

    Parameters

    orientation

    Whether the rule is horizontal or vertical.

    color

    The color that the rule should be drawn.

    thickness

    The thickness of the rule in the direction perpendicular to its orientation. Defaults to a hairline thickness, meaning the thinnest possible line that can be drawn.

  • Declaration

    Swift

    public var elementRepresentation: Element { get }