SnapKit:
v.snp_makeConstraints{ (make)in
由于Swift和oc语法不一样 equalTo(self.view)是传入参数
make.top.equalTo(self.view).offset(@H_502_50@100)
make.left.equalTo(self.view).offset(@H_502_50@100)
make.right.equalTo(self.view).offset(-@H_502_50@100)
make.bottom.equalTo(self.view).offset(-@H_502_50@100)
}
Masonry:
由于swift和oc语法不一样 equalTo()是先调用get方法
v.mas_makeConstraints{ (make)in
make.top.equalTo()(self.view).setOffset(@H_502_50@100)
make.left.equalTo()(self.view).setOffset(@H_502_50@100)
make.right.equalTo()(self.view).setOffset(@H_502_50@100)
make.bottom.equalTo()(self.view).setOffset(@H_502_50@100)
}