I am coding on a project were the user presses a button and a in the textview(named textoutput) under the button the program randomly takes a link from a array i have named textinfo. When running the project the first time you press the the button and presses the link the right link opens up in safari but the second time the button is pressed and a new randomly selected link is shown and when pressing the link it opens the first link and not the one pressed. This continues every time when pressing the button that just the first link is open when pressing a new link.
@IBAction func Frukostaction(sender: UIButton) {
let random = Int(arc4random_uniform(19))
textoutput.text = textinfo[random]
}
How do a fix this? Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire