I used find()
to reference two arrays of Floats in Swift 1, but cannot find the equivalent for Swift 3. I've tried indexOf
and array.first
with no luck. I've been unable to find any other alternatives. Can someone provide some guidance here? I'm not a professional programmer and I wrote this app to help design eye prosthetics. It worked perfectly until I updated Xcode and have had to fix about 50 issues... Never again. Any help would be greatly appreciated.
@IBAction func unitsPressed(_ sender: UIButton) {
let unitsAlertView = UIAlertController(title: "Units Selector", message: nil, preferredStyle: UIAlertControllerStyle.alert)
let mmAction = UIAlertAction(title: "millimeters", style: UIAlertActionStyle.default){
(ACTION) in
self.dioptorsOn = false
self.diagnosticLensPicker.reloadAllComponents()
if var baseCurveIndex = find(self.baseCurveArrayMM, self.chosenBaseCurveSphereMM) { // issue is here - use of unresolved identifier "find"
self.diagnosticLensPicker.selectRow(baseCurveIndex, inComponent: 0, animated: true)
}
self.unitsLabel.text = "units: mm"
}