I am trying to add a few NSTextFields to a horizontal stack view programmatically but the StackView only ever has one field visible and the field is not arranged correctly.
for item in ArrayOfStrings {
let view = NSTextField()
view.stringValue = item
stackView.addView(view, in: .leading)
}
I have tried the following with the same result
stackView.addArrangedSubview(view)
It seems to work fine in Interface Builder - adding additional subviews results in it automatically showing them and adjusting their size.