-
Please suggest a Random number Generation library for iPhone
over 8 years ago
-
almost 8 years ago
You can use arc4random() function or arc4random_uniform() function to generate random number usign Swift 3.0.
For eg:
To generate a random number between 1 to 200 use the function as belowlet number = 1 + arc4random_uniform(200)
let number = 1 + ( arc4random() % 200 ) -
-
about 7 years ago
For Random Number use this " arc4random() " function or " arc4random_uniform()" function to generate random number using Swift 3.0
For eg:
To generate a random number between 0 to Range(Like: 10,100,1000) use the function as belowlet number = 1 + arc4random_uniform(Range)
-
-
almost 8 years ago
You can use arc4random() function or arc4random_uniform() function to generate random number usign Swift 3.0.
For eg:
To generate a random number between 1 to 200 use the function as belowlet number = 1 + arc4random_uniform(200)
let number = 1 + ( arc4random() % 200 ) -
3 Answer(s)