Objective-C
[textView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(UIEdgeInsetsZero).priorityLow();
make.top.mas_equalTo(imageView.mas_bottom).offset(20);
}];
I want change swift code. please help me?? thanks.
These code make work
btn.mas_makeConstraints { (make:MASConstraintMaker?) in
make?.top.equalTo()(view.mas_top)?.with().offset()(0)
make?.left.equalTo()(view.mas_left)?.with().offset()(0)
make?.right.equalTo()(view.mas_right)?.with().offset()(0)
make?.bottom.equalTo()(view.mas_bottom)?.with().offset()(0)
return()
}
The shortest way to do it (if you want to mirror edges
of parent view is)
self.xibView .mas_makeConstraints( { make in
_ = make?.edges.equalTo()(self)
})
This assignment _ =
also will silence the warning about un-assignment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With