07. December 2016
Random Bool
This extension produces true
or false
on a random basis. Perfect for throwing a coin.
import Foundation
extension Bool {
static var random: Bool {
return arc4random_uniform(10000) < arc4random_uniform(10000)
}
}