Sum of Multiple Stepper Functions with Label or Text Field

I would like to create a label that is the sum of multiple stepper functions.

I have 15 steppers in total to sum into a single label.

Looking for a solution. I am Ok with using each stepper into a label or each stepper into a text box, then creating sum of each.

Stepper1 --> TextBox1
Stepper2 --> Text Box2
Stepper3 --> Text Box3
....
Stepper15 --> Text Box15

LabelTotal = sum of textbox1 through textbox15

OR

Stepper1 --> Label1
Stepper2 --> Label2
Stepper3 --> Label3
....
Stepper15 --> Label15

LabelTotal = sum of label1 through label15

As each individual stepper is incremented or decremented the label should follow.

No stepper should be below 0. Max is 5.
Label should not go below 0. Max is 75.

Maybe an array for all stepper labels/textboxes?

Thanks
You should declare the steppers as IBOutlet collection
Code Block
     @IBOutlet var steppers: [UIStepper]!

Take care of the order of declaration when you connect stepper to the IBOutlet.
Do the same for labels.
Code Block
     @IBOutlet var labels: [UILabel]!

Doing so, you can loop through steppers and add steppers[i].value or Double(labels[i].text)

You can use reduce to do this:
Code Block
let total = labels.reduce(0.0) {sum, label in sum + (Double(label.text ?? "0") ?? 0.0) }
labelTotal.text = String(Int(total))

Sum of Multiple Stepper Functions with Label or Text Field
 
 
Q