I have designed a UIStackView in a StoryBoard and I have added 2 UIbutton with a height contraint set at 70. My stackview is set to vertical fill and has some constraints set on the storyboard to fit in the Controller's View.
I have added an outlet from the stackView and from the UIbutton. I am trying to add a third UIButton programatically in the stack View
@IBOutlet weak var Btn1: UIButton!
@IBOutlet weak var myStackView: UIStackView!
var accounts = [Account]()
override func viewDidLoad() {
super.viewDidLoad()
Btn1.setTitle("Name", for: .normal)
let Btn3 = UIButton(frame: CGRect(x: 0, y: 110, width: 100, height: 50))
Btn3.setTitle("Btn3", for: .normal)
Btn3.heightAnchor.constraint(equalToConstant: 70).isActive = true
myStackView.addArrangedSubview(Btn3)
But Btn3 never appears