Skip to content

Instantly share code, notes, and snippets.

@josh-marasigan
Last active June 13, 2020 05:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josh-marasigan/c6da1f77e3846b4f93184ce5d549c4b4 to your computer and use it in GitHub Desktop.
Save josh-marasigan/c6da1f77e3846b4f93184ce5d549c4b4 to your computer and use it in GitHub Desktop.
let view1 = UIView()
view1.backgroundColor = UIColor.systemIndigo
view.addSubview(view1)
view1.snp.makeConstraints { make in
make.top.equalToSuperview().offset(250)
make.leading.equalToSuperview().offset(20)
make.width.height.equalTo(view.snp.width)
.dividedBy(2).offset(-30)
}
let view2 = UIView()
view2.backgroundColor = UIColor.systemPink
view.addSubview(view2)
view2.snp.makeConstraints { make in
make.centerY.equalTo(view1)
make.leading.equalTo(view1.snp.trailing).offset(20)
make.width.height.equalTo(view1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment