Cast UInt32 to Int Swift 3

时间:2017-05-16 09:23:52

标签: swift random int

I have tried this option after having searched but it does not work, the app falls

let randInt:Int = Int(arc4random())

Help me please. Thanks in advance

1 个答案:

答案 0 :(得分:0)

Finally was easy.

let randInt:Int = Int(arc4random_uniform(UInt32(inputArray.count)))