I want to "randomly" select from a collection in Swift but have certain instances be selected at different frequencies. Currently I am using.
let collection: [Int] = [1,2,2,3,3,3,4,4,4,4,5,5,5,5,5]
let random: Int = Int(arc4random_uniform(UInt32(collection.count)))
let selection: Int = collection[random]
I need the code to be compliant with Swift 2.0+.