Search code examples
iosswiftsnapkit

How to increase height of view by value in SnapKit?


I want to increase height by 100 in SnapKit, but I don't know how to do it. It suppose to be something like this, but it's not working

mainView.snp.makeConstraints { make in
    make.center.equalToSuperview()
    make.height.equalTo(otherView.snp.height + 100) // problem here
}

Solution

  • You can use inset or offset:

    make.height.equalTo(otherView.snp.height).offset(100)