IOS stackview addArrangedSubview add at specific index

Solution 1:

You mean you want to insert, not add:

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