Int

struct Int : SignedInteger, Comparable, Equatable
  • Executes a block multiple times

    Example:

       3.times {
           print("Hello...")
           print("...you")
       }
    

    Declaration

    Swift

    public func times (_ function: () -> ())
  • Converts to String

    Returns

    the Int as a String

    Declaration

    Swift

    public func toString() -> String

    Return Value

    the Int as a String

  • Returns a random number within a ClosedRange<Int> (like 1...10)

    Returns

    random Int

    Declaration

    Swift

    public static func randomNumber(range: ClosedRange<Int> = 1...6) -> Int

    Return Value

    random Int