In my swift code below the goal is to pass a dictionary item as a parameter. It seems like this would work if it was a string but because I am trying to pass a item from a dictionary it does not work. I am passing from view did load to another function.
var girlsName = ["a": "Jessica Biel", "b": "Gwen Stefani","c":"Jessica Alba" ]
override func viewDidLoad() {
super.viewDidLoad()
let index: Int = Int(arc4random_uniform(UInt32(girlsName.count)))
let randomVal = Array(girlsName.values)[index]
let randomVal2 = Array(girlsName.keys)[index]
}
@objc func submite( randomVal){
print(randomVal)
}