Int

struct Int : FixedWidthInteger, SignedInteger
  • Getting the minutes value in Integer format and rest of the seconds

    Declaration

    Swift

    func minutesFrom(seconds: Int, completion: @escaping ( _ minutes: Int, _ seconds: Int)->())

    Parameters

    seconds

    Check closure

    Return Value

    closure with minutes and seconds

  • Converts to string

    Declaration

    Swift

    public var toString: String
  • Converts to string with Roman number representation

    Declaration

    Swift

    public var toRomanString: String

    Return Value

    Roman value of year

  • Checks if the integer is even.

    Declaration

    Swift

    public var isEven: Bool
  • Checks if the integer is odd.

    Declaration

    Swift

    public var isOdd: Bool
  • Checks if the integer is positive.

    Declaration

    Swift

    public var isPositive: Bool
  • Checks if the integer is negative.

    Declaration

    Swift

    public var isNegative: Bool
  • Converts integer value to Double.

    Declaration

    Swift

    public var toDouble: Double
  • Converts integer value to Float.

    Declaration

    Swift

    public var toFloat: Float
  • Converts integer value to CGFloat.

    Declaration

    Swift

    public var toCGFloat: CGFloat
  • Converts integer value to UInt.

    Declaration

    Swift

    public var toUInt: UInt
  • Converts integer value to Int32.

    Declaration

    Swift

    public var toInt32: Int32
  • Converts integer value to a 0..<Int range. Useful in for loops.

    Declaration

    Swift

    public var range: CountableRange<Int>
  • Returns number of digits in the integer.

    Declaration

    Swift

    public var digits: Int
  • The digits of an integer represented in an array(from most significant to least). This method ignores leading zeros and sign

    Declaration

    Swift

    public var digitArray: [Int]
  • Returns a random integer number in the range min…max, inclusive.

    Declaration

    Swift

    public static func random(within: Range<Int>) -> Int