You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 18, 2024. It is now read-only.
Snapkit으로 개발되어 있는 레이아웃을, PinLayout + FlexLayout으로 리팩토링
이후 개발되는 화면은 모두 PinLayout + FlexLayout으로 개발
Existing
// TODO: [OMLK-17] PinLayout + FlexLayout으로 리팩토링
func configureConstraints(for view:UIView){
carouselCollectionView.snp.makeConstraints{ make in
make.top.equalTo(view.safeAreaLayoutGuide.snp.top).offset(85)
make.leading.trailing.equalToSuperview()}
pageControl.snp.makeConstraints{ make in
make.top.lessThanOrEqualTo(carouselCollectionView.snp.bottom).offset(40)
make.centerX.equalToSuperview()
make.bottom.equalTo(bottomButton.snp.top).offset(-56)}
bottomButton.snp.makeConstraints{ make in
make.leading.trailing.equalToSuperview().inset(16)
make.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom).inset(12)
make.height.equalTo(55)}}
// TODO: [OMLK-17] PinLayout + FlexLayout으로 리팩토링
privatefunc setUpLayout(){self.addSubview(imageView)
imageView.snp.makeConstraints{ make in
make.top.equalToSuperview()
make.leading.trailing.equalToSuperview().inset(24)
make.height.lessThanOrEqualTo(333)}letlabelStack=UIStackView().then{ stackView in
stackView.axis =.vertical
stackView.alignment =.center
stackView.spacing =8}self.addSubview(labelStack)
labelStack.snp.makeConstraints{ make in
make.top.equalTo(imageView.snp.bottom).offset(46)
make.leading.trailing.equalToSuperview()
make.bottom.lessThanOrEqualToSuperview()}[titleLabel, descriptionLabel].forEach{ label in
labelStack.addArrangedSubview(label)}}
Describe
Snapkit
으로 개발되어 있는 레이아웃을,PinLayout + FlexLayout
으로 리팩토링PinLayout + FlexLayout
으로 개발Existing
Benefits
Reference
PinLayout
PinLayout 사용해보기 - ZeddiOS - 티스토리
FlexLayout
FlexLayout 사용해보기 - ZeddiOS - 티스토리
Related
The text was updated successfully, but these errors were encountered: