Permalink
Fetching contributors…
Cannot retrieve contributors at this time
35 lines (29 sloc) 645 Bytes
//
// BoolExtensions.swift
// SwifterSwift
//
// Created by Omar Albeik on 07/12/2016.
// Copyright © 2016 SwifterSwift
//
#if canImport(Foundation)
import Foundation
#endif
// MARK: - Properties
public extension Bool {
/// SwifterSwift: Return 1 if true, or 0 if false.
///
/// false.int -> 0
/// true.int -> 1
///
public var int: Int {
return self ? 1 : 0
}
/// SwifterSwift: Return "true" if true, or "false" if false.
///
/// false.string -> "false"
/// true.string -> "true"
///
public var string: String {
return description
}
}