EXTENSION
public extension Int
var isOdd: Bool
Whether self is an odd number
var isEven: Bool
Whether self is an even number
var nilIfZero: Int?
Treats 0 as nil
var string: String
Make the number to string
var range: CountableRange<Int>
Make a range from zero to self
var hours: Int
var minutes: Int
var days: Int
var months: Int
var years: Int
func instances<T>(of creation: @autoclosure () throws -> T) rethrows -> [T]
Return a number of instances
- Parameter creation: The initialization of the object
- Returns: An array containing the objects
Name | Description |
---|---|
creation | The initialization of the object |
func inRange(_ range: Range<Int>) -> Bool
Return if self
is in the given range.
- Parameter range: Target range.
- Returns:
true
if self is in the range, otherwisefalse
.
Name | Description |
---|---|
range | Target range. |
func times(block: () -> Void)
Calls the given block n number of times.