Im stuck on this part of my code, I'm trying to get an average % from the numbers entered into my Textfields. I'm very new at this and would appreciate it if someone can help out and tell me where I'm going wrong and point me in the right direction.
class ingredientViewController: UIViewController, UITextFieldDelegate {
@IBOutlet var abvTextFields: [UITextField]!
@IBOutlet var AbvTotal: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
AbvTotal.layer.cornerRadius = 8.0
}
func abvList(abvTextFields:Int...) -> Float {
let abv1 = Float(abvTextFields.reduce(0,+))
let abv2 = Float(abvTextFields.count)
let abv3 = abv1 / abv2
return abv3
}