I am trying to randomize the arrayList and then pull the URL to an IBAction that would then open the page.
override func viewDidLoad() {
let ArrayList = [
["A", "A2", "http://a.com"],
["B", "B2", "http://b.com"],
["C", "C2", "http://c.com"],
]
let pickArrayList = ArrayList[Int(arc4random_uniform(UInt32(ArrayList.count)))]
label1.text = pickArrayList[0]
label2.text = pickArrayList[1]
}
Below is the IBAction but I receive an error saying that pickArrayList[2] is an unresolved Identifier.
@IBAction func didTapButton(sender: AnyObject) {
UIApplication.shared.open(URL(pickArrayList[2])!)
}
Thanks in advance, Swift Noobie