标签:
1,下面是使用arc4random函数求一个1~100的随机数(包括1和100)
1
|
var temp:Int = Int(arc4random()% 100 )+ 1 |
2,下面是使用arc4random_uniform函数求一个1~100的随机数(包括1和100)
1
|
var temp:Int = Int(arc4random_uniform( 100 ))+ 1 |
Swift - 使用arc4random()、arc4random_uniform()取得随机数
标签:
原文地址:http://www.cnblogs.com/Free-Thinker/p/4838076.html