IOS stackview addArrangedSubview add at specific index

Elton Garcia de Santana picture Elton Garcia de Santana · Dec 23, 2015 · Viewed 13k times · Source

How is it possible to add a arranged subview in a particular index in a UIStackView?

something like:

stackView.addArrangedSubview(nibView, atIndex: index)

Answer

Wain picture Wain · Dec 23, 2015

You mean you want to insert, not add:

func insertArrangedSubview(_ view: UIView, atIndex stackIndex: Int)