0

I haven't found a clear answer on this question. If it is a duplicate, send the question to me. Here is my problem...

I have a label resultPercentage, and programmatically I have been able to change the label if it was a String(). How can I do the same, except use an Int()?

Here is some example code...

var resultLabel = 45

@IBOutlet var resultPercentage: [UILabel]!

  override func viewDidLoad() {
    super.viewDidLoad()

    resultPercentage.text = resultLabel
}

I always get an error. Please help! Thanks in advance :)

Raven
  • 33
  • 4
  • `resultPercentage.text = "\(someInt)"` . However.. it seems `resultPercentage` is an ARRAY of UILabel in your declaration.. Are you sure that's correct? – Brandon May 16 '18 at 01:41
  • I edited it, there is a variable which holds the number 45. My question is: how can I put 45 in the UILabel? – Raven May 16 '18 at 12:05

0 Answers0