AK
Size: a a a
AK
_
class ViewController: UIViewController {
var label1 : UILabel!
var label2 : UILabel!
var label3 : UILabel!
@IBOutlet weak var stack: UIStackView!
override func viewDidLoad() {
super.viewDidLoad()
label1 = UILabel(frame: CGRect(x: 16, y: 279, width: 130, height: 120))
label1.backgroundColor = .green
label2 = UILabel(frame: CGRect(x: 95, y: 279, width: 130, height: 120))
label2.backgroundColor = .blue
label3 = UILabel(frame: CGRect(x: 145, y: 279, width: 130, height: 120))
label3.backgroundColor = .red
let collection = [label1, label2, label3]
for x in 0..<collection.count {
let current = collection.count - x - 1
stack.insertSubview(collection[current]!, at: x)
}
}
}
VO
АС
DV
АС
АС
АС
MM
АС
S
DV
A