From the UIStackView Class Reference
In removeArrangedSubview:
To prevent the view from appearing on screen after calling the stack’s removeArrang
You're right, just the call to removeFromSuperview
is sufficient to have the view fully removed.
I suspect the reason for people putting both is because they run across the removeArrangedSubview
documentation which seems to say both are needed. (And indeed, they are, if you call removeArrangedSubview
and want the view really gone.)
The additional doc in arrangedSubviews
is not seen by so many, so they don't realize removeArrangedSubview
is, in this case, optional.