Is there some way to assign labels to buttons without writing each button names programmatically.
Let's say you have an array:
and you have four buttons, ButtonOne, ButtonTwo, ButtonThree, ButtonFour
is there someway to assign each value of an array to each of the four buttons without actually typing out
et cetera
through a control loop?
Let's say you have an array:
Code:
array: [String] = ["cat", "dog", "mouse", "beaver"]
and you have four buttons, ButtonOne, ButtonTwo, ButtonThree, ButtonFour
is there someway to assign each value of an array to each of the four buttons without actually typing out
Code:
ButtonOne.setTitle(array[0])
ButtonTwo.setTitle(array[1])
et cetera
through a control loop?