Missing constraint in interface builder

2

I'm trying to understand why xCode says I'm missing a constraint for the position and, if I already have a constraint:

View.Top = Top Layout Guide.Bottom * 1 + 0

    
asked by MatiEzelQ 16.06.2016 в 14:41
source

1 answer

1

The same thing can help you use this library, it helps to make it easier to use constraints. It's called snapkit, link It's on github too, link Here is an example of how it is used:

let box = UIView()
superview.addSubview(box)

box.snp_makeConstraints { (make) -> Void in
    make.top.equalTo(superview).offset(20)
    make.left.equalTo(superview).offset(20)
    make.bottom.equalTo(superview).offset(-20)
    make.right.equalTo(superview).offset(-20)
}
    
answered by 16.06.2016 в 14:44