tomvanzummeren / TZStackView

UIStackView replica for iOS 7.x and iOS 8.x
MIT License
1.15k stars 128 forks source link

Inserting a view #71

Closed nico75005 closed 8 years ago

nico75005 commented 8 years ago

I didn't really have time to check but from what I've seen, the method

public func insertArrangedSubview(view: UIView, atIndex stackIndex: Int) {
    view.translatesAutoresizingMaskIntoConstraints = false
    addSubview(view)
    arrangedSubviews.insert(view, atIndex: stackIndex)
}

shouldn't be

public func insertArrangedSubview(view: UIView, atIndex stackIndex: Int) {
    view.translatesAutoresizingMaskIntoConstraints = false
    insertSubview(view, atIndex: stackIndex)
    //      addSubview(view)
    arrangedSubviews.insert(view, atIndex: stackIndex)
}

?

CosynPa commented 8 years ago

The order of the subviews and the arranged subviews are not the same thing.

nico75005 commented 8 years ago

You're right. Sorry about that.