I'm a kind new to Xcode/swift, I am trying to build a game where 5 pics need to selected randomly, my code looks something like that :
var options = ["1.png","2.png","3.png","4.png","4.png"]
@IBAction func option1(sender: AnyObject) {
var randomNumber = Int(arc4random_uniform(5))
**iphoneChoise.image(options[randomNumber])** /*This line is not correct*/
}
Please help!
Make an
@IBOutlet
for your image view.Then, assuming your images are saved in Images.xcassets: