Swift: expected declaration error setting “Label” to a string variable
I am managing different languages, in a small single pane app, using a different string array for each comment, indexed by an integer variable "userLang", then setting label.text = array[index]. The basic code is: import UIKit class ViewController: UIViewController { var userLang = 0 var arrayOne = ["hi", "hola"] var arrayTwo = ["Bye", "Adios"] @IBOutlet weak var msgArrayOne: UILabel! @IBOutlet weak var msgArrayTwo: UILabel! msgArrayOne.text = arrayOne[userLang] //Error here: !Expected declaration msgArrayTwo.text = arrayTwo[userLang] //odd, but this line gets no error until I //remove the