Looping over similarly named UI elements - maybe by getting a variable from its name?

前端 未结 3 539
野趣味
野趣味 2021-01-17 02:58

I\'ve added a number of labels to a view using Interface Builder. I\'ve also got an array of values I want to display.

Is there a better way to set the labels than u

3条回答
  •  深忆病人
    2021-01-17 03:43

    You can use self.view.subviews array to go through all subviews and check if it is UILabel, do your things.

提交回复
热议问题