0

I'm getting this error in XCode with Swift. I've tried a lot of other solutions I've seen on this site, but none seem to work.

    @IBAction func generateClick(_ sender: Any) {
        let int1 = Int(number1.text!)!
        let int2 = Int(number2.text!)!
        let random = arc4random_uniform(UInt32((int2 - int1) + int1))
        numberText = "\(random)"

The goal is the pick a random number when they click the generate button. (Between the 2 numbers they specify, being number1 and number2)

Sakir Sherasiya
  • 1,562
  • 1
  • 17
  • 31
Michael Hermes
  • 21
  • 1
  • 1
  • 1

1 Answers1

4

I suppose numberText is you UILabel reference.

You want assign to it's text Attribute like this:

numberText.text = "\(random)"
FranzKnut
  • 86
  • 6