Question
Append variables to an array using swift I have 100 variables of type UITextField that are named as such box00, box01, box02 ........ box99 I
Append variables to an array using swift
I have 100 variables of type UITextField that are named as such
box00, box01, box02 ........ box99
I would like to assign to each of these boxes something, however I am stuck. I tried to programmatically stuff them all in an array but I am stuck with that as well.
When using a counter in the variable name my compiler doesn't recognize the variable. I tried making a nested for loop.
for i in 0...9{ for j in 0...9{ boxArray.append(box\(i)\(j)) } }
Any ideas what I do now that I'm in this situation? I want all of my 100 UITextField variables appended in an array without explicitly naming each one by one.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started