Int

struct Int : SignedIntegerType, Comparable, Equatable
  • Performs a closure the given number of times

    Parameter

    Parameter f: The closure

    Returns

    Void

    Declaration

    Swift

    public func times(f: () -> () )

    Parameters

    f

    The closure

    Return Value

    Void

  • Performs a closure on each int between self and n (counting up)

    Parameter

    Parameter n: The up to number

    Parameter

    Parameter f: The closure

    Returns

    Void

    Declaration

    Swift

    public func upto(n: Int, f: (Int) -> () )

    Parameters

    n

    The up to number

    f

    The closure

    Return Value

    Void

  • Performs a closure on each int between self and n (counting down)

    Parameter

    Parameter n: The up to number

    Parameter

    Parameter f: The closure

    Returns

    Void

    Declaration

    Swift

    public func downto(n: Int, f: (Int) -> () )

    Parameters

    n

    The up to number

    f

    The closure

    Return Value

    Void