Snapkit PART 3 - How to use Snapkit in iOS - SnapKit Tutorial for Autolayout Constraints
Snapkit PART 4 - How to use Snapkit in iOS - SnapKit Tutorial for Autolayout Constraints
private func applyConstraints() {
imageView.snp.makeConstraints { make in
make.top.leading.trailing.equalToSuperview()
make.bottom.equalToSuperview().offset(-60)
}
titleLabel.snp.makeConstraints { make in
make.leading.equalToSuperview().offset(20)
make.top.equalTo(imageView.snp.bottom).offset(4)
make.trailing.equalTo(likeButton.snp.leading).offset(-8)
}
likeButton.snp.makeConstraints { make in
make.height.equalTo(40)
make.width.equalTo(80)
make.top.equalTo(imageView.snp.bottom).offset(4)
make.trailing.equalToSuperview().offset(-20)
}
descriptionLabel.snp.makeConstraints { make in
make.leading.equalToSuperview().offset(20)
make.top.equalTo(titleLabel.snp.bottom).offset(4)
make.trailing.equalTo(likeButton.snp.leading).offset(-8)
}
}
사실 스냅킷을 다룰 때 기대했던 것은
make
와update
의 차이, 또는 오리지널로 잡았을 때와 비교했의 장단점을 공부하는 것이었는데... 일단 공부했으니.