标签: ios swift
我正试图在swift 4中为我的纳米学位课程建立一个基本的摇滚/纸/剪刀应用程序。我已经查看了我购买的Udemy课程中的一些课程,但无法找到正确的方法来随机化我想要在用户选择时选择的图像/结果。任何帮助将不胜感激
here is what I have to go off when a user makes their choice but obviously its the same outcome every time
答案 0 :(得分:0)
在您的switch语句之前,您可以添加一行,例如:
selection = arc4random_uniform(3) //Randomly give you integer between 0-2