How to change properties of dynamically created labels

Viewed 45

I have created from an array several labels. In certain steps I have to change the x and y coordinate of the label, but don't know how to address the labels:

for zone in zoneArray {

        let zoneLabel = UILabel(frame: CGRect(x: locationX, y: locationY, width: 150, height: 75))

        zoneLabel.backgroundColor = UIColor.lightGray
        zoneLabel.layer.masksToBounds = true
        zoneLabel.layer.cornerRadius = 10
        zoneLabel.text = zone}

would be very happy if someone could help me.

3 Answers
Related