Hello,
I might be overlooking something but cant figure out how to do proportional width / height constraints. I.e. view1 height is 50% of view2 height. Is this supported by Snap?
Of course, you can use dividedBy
or multipliedBy
which are not documented. You can find those here: Constraint.swift
view1.snp_makeConstraints { make in
make.height.equalTo(view2).multipliedBy(0.5)
}
..or..
view1.snp_makeConstraints { make in
make.height.equalTo(view2).dividedBy(2)
}
Excellent! Thanks!
Glad it helped :)
Most helpful comment
Of course, you can use
dividedBy
ormultipliedBy
which are not documented. You can find those here: Constraint.swift..or..