CGFloat

public extension CGFloat
  • Returns string representation rounded to tenth

    Declaration

    Swift

    var asCeilString: String { get }
  • Returns string representation rounded to tenth

    Declaration

    Swift

    var asTenthString: String { get }
  • Returns string representation rounded to hundredth

    Declaration

    Swift

    var asHundredthString: String { get }
  • Returns string representation rounded to thousands

    Declaration

    Swift

    var asThousandsString: String { get }
  • Returns self as String

    Declaration

    Swift

    var asString: String { get }

As

  • Returns self as Int if possible

    Declaration

    Swift

    var asInt: Int? { get }
  • Returns self as Double

    Declaration

    Swift

    var asDouble: Double { get }

Other

  • Returns true if self is ceil. Returns false otherwise.

    Declaration

    Swift

    var isCeil: Bool { get }

Pixel Operations

  • Checks whether two CGFloat values corresponds to the same pixel.

    Declaration

    Swift

    static func .== (lhs: CGFloat, rhs: CGFloat) -> Bool
  • Checks whether two CGFloat values doesn’t correspond to the same pixel.

    Declaration

    Swift

    static func .!= (lhs: CGFloat, rhs: CGFloat) -> Bool
  • Checks whether two CGFloat values doesn’t correspond to the same pixel and the left one is smaller.

    Declaration

    Swift

    static func .< (lhs: CGFloat, rhs: CGFloat) -> Bool
  • Checks whether two CGFloat values doesn’t correspond to the same pixel and the left one is bigger.

    Declaration

    Swift

    static func .> (lhs: CGFloat, rhs: CGFloat) -> Bool
  • Checks whether two CGFloat values corresponds to the same pixel or the left one is smaller.

    Declaration

    Swift

    static func .<= (lhs: CGFloat, rhs: CGFloat) -> Bool
  • Checks whether two CGFloat values corresponds to the same pixel or the left one is bigger.

    Declaration

    Swift

    static func .>= (lhs: CGFloat, rhs: CGFloat) -> Bool
  • Returns value raunded to a nearest pixel

    Declaration

    Swift

    var roundedToPixel: CGFloat { get }
  • Returns value raunded to a nearest up pixel

    Declaration

    Swift

    var roundedUpToPixel: CGFloat { get }