0

Have updated to Xcode 7, which has Swift 2. I am creating an app. I need to generate random numbers. In Swift, there used to be arc4random(). But in Swift 2, arc4random() is not there. Instead, I am getting:

 arc4random_addrandom(<#T##UnsafeMutablePointer<UInt8>#>, <#T##Int32#>)
 arc4random_stir()
 arc4random_buf(<#T##UnsafeMutablePointer<Void>#>, <#T##Int#>)

How do I now generate random numbers? Any help would be appreciated a lot.

ojassethi
  • 379
  • 1
  • 5
  • 16

1 Answers1

3

arc4random() and arc4random_uniform(_:) are actually there, they're just not autocompleting for some reason. You can still use them!

jtbandes
  • 115,675
  • 35
  • 233
  • 266