
self.view.addSubviews([scrollView])
self.scrollView.addSubview(contentView)
self.contentView.addSubviews([infoTitleLabel, profileInfoView, tagTitleLabel, tagCollectionView, emailTitleLabel, emailButton])
self.scrollView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
self.contentView.snp.makeConstraints { make in
make.width.equalToSuperview()
make.centerX.top.bottom.equalToSuperview()
}

1๏ธโฃ scrollView๋ top, bottom, leading(left), trailing(right)๋ฅผ ๋ชจ๋ ์คํฌ๋กค ๋ ์์ญ ์ฌ์ด์ฆ์ ๋ง์ถ๋ค. (๋ณดํต equalToSuperView ์ฌ์ฉ)
self.scrollView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
2๏ธโฃ scrollView ์์ ๋ค์ด๊ฐ๋ contentView๋ top, bottom, leading(left), trailing(right)๋ ๋ชจ๋ equalToSuperView๋ฅผ ์ฌ์ฉํ์ฌ scrollView ์์ญ๊ณผ ๋์ผํ๊ฒ ๋ง์ถ๊ณ , ์ธ๋ก ์คํฌ๋กค์ ์ํ๋ฉด width๋ฅผ equalToSuperView, ๊ฐ๋ก ์คํฌ๋กค์ ์ํ๋ฉด height๋ฅผ equalToSuperView ํ๋ค.
self.contentView.snp.makeConstraints { make in
make.edges.width.equalToSuperview() // ์ธ๋ก ์คํฌ๋กค
}
4๏ธโฃ contentView์ height๋ ํญ์ ์ ํด์ ธ ์์ด์ผ ํ๋ฉฐ, height ๊ฐ์ ์ง์ ๋ฃ์ ์๋ ์๊ณ , contentView์ ํ์ UI ์ปดํฌ๋ํธ๋ค์ ํตํด height์ ์ค์ ํด๋ ๋๋ค. (ํ์ UI ์ปดํฌ๋ํธ๋ฅผ ํตํด contentView์ ์ฌ์ด์ฆ๊ฐ ๊ฒฐ์ ๋๋ฏ๋ก,,, (์ธ๋ก ์คํฌ๋กค์ด๋ฉด height๊ฐ ๊ฒฐ์ ๋จ) ํ์ ์ปดํฌ๋ํธ๋ค์ ์ ์ฝ ์กฐ๊ฑด์ ์ ๋ฃ์๋์ง ํ์ธํ๋ค!
self.infoTitleLabel.snp.makeConstraints { make in
make.top.equalToSuperview().inset(26) // top ์ค์ !
make.horizontalEdges.equalToSuperview().inset(20)
make.height.equalTo(27) // height 1
}
self.profileInfoView.snp.makeConstraints { make in
make.top.equalTo(self.infoTitleLabel.snp.bottom).offset(10)
make.horizontalEdges.equalToSuperview().inset(20)
make.height.equalTo(194) // height 2
make.bottom.equalToSuperView().inset(40) // bottom ์ค์ !
}

self.view.addSubviews([scrollView])
self.scrollView.addSubview(contentView)
self.contentView.addSubviews([infoTitleLabel, profileInfoView])
self.scrollView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
self.contentView.snp.makeConstraints { make in
make.edges.width.equalToSuperview()
}
self.infoTitleLabel.snp.makeConstraints { make in
make.top.equalToSuperview().inset(26) // top ์ค์ !
make.horizontalEdges.equalToSuperview().inset(20)
make.height.equalTo(27) // height 1
}
self.profileInfoView.snp.makeConstraints { make in
make.top.equalTo(self.infoTitleLabel.snp.bottom).offset(10)
make.horizontalEdges.equalToSuperview().inset(20)
make.height.equalTo(194) // height 2
make.bottom.equalToSuperView().inset(40) // bottom ์ค์ !
}