| Info | Value |
| --- | --- |
| Platform | e.g. ios/osx/tvos |
| Platform Version | 8.0 |
| SnapKit Version | 3.0.1 |
| Integration Method | CocoaPods |
I used to have some code that did
titleLabel.snp.makeConstraints() { make in
make.top.left.right.equalTo(self).offset(UIEdgeInsets(top: self.padding, left: self.padding, bottom: 0, right: -self.padding))
}
But now I am getting an error because offset
takes ConstraintOffsetTarget
, which UIEdgeInsets
and CGPoint
no longer conform to.
It looks like the NSLayoutAttribute.snp_constantForValue
function got migrated into ConstraintConstantTarget.constraintConstantTargetValueFor(layoutAttribute:)
, so I'm guessing it might not be too hard to add in?
I haven't looked too hard into the implementation, so if I'm missing something, let me know! I just noticed that this was no longer building after upgrading 馃槄
@cjwirth you're probably going to want to use equalTo(self).inset(UIEdgeInsets)
and you no longer need to invert the right
or bottom
values as SnapKit does this by default.
you're probably going to want to use equalTo(self).inset(UIEdgeInsets)
aah, if this is all it was, then it's definitely my fault, sorry about that!
What's the difference between inset
and offset
in the context of SnapKit?
And what about CGPoint? That's still not conforming to either constraint inset
or offset
target protocols.
you no longer need to invert the right or bottom values as SnapKit does this by default.
Aah, so I don't have to do right: -self.padding
, I can just do right: self.padding
these days? Cool!
@cjwirth CGPoint was removed because it's ambiguous for things like make.top.bottom.equalTo(CGPoint)
you have to use constants and separate them out now if they are supposed to be different values.
Oh I guess that makes sense. It appears to be working 馃憤