Git Hub
коротко
1 заметка с тегом

SnapKit

SnapKit

14 июня 2017, 2:03

https://medium.com/cocoaacademymag/how-to-write-auto-layout-constraints-with-snapkit-in-ios-c5f95c7c695d

func setupConstraints(){
        uiLogo.snp.makeConstraints{ set in
            set.width.equalTo(AppStyles.About.logoSize)
            set.height.equalTo(AppStyles.About.logoSize)
            set.top.equalToSuperview().offset(AppStyles.About.offsetTop)
            set.centerX.equalToSuperview()
        }
        
        uiVersion.snp.makeConstraints{set in
            set.top.equalTo(uiLogo.snp.bottom).offset(AppStyles.About.offetBottom)
            set.centerX.equalToSuperview()
        }
        
        uiBack.snp.makeConstraints{make in
            make.width.equalTo(AppStyles.About.backSize)
            make.height.equalTo(AppStyles.About.backSize)
            make.centerX.equalToSuperview()
            make.bottom.equalToSuperview().offset(-AppStyles.About.offetBottom)
        }
    }
SnapKit   Swift