Skip to content

Instantly share code, notes, and snippets.

@Anik0808
Last active September 24, 2022 19:10
Show Gist options
  • Save Anik0808/19d59bad8f0571ed4f87d65b65c9b81d to your computer and use it in GitHub Desktop.
Save Anik0808/19d59bad8f0571ed4f87d65b65c9b81d to your computer and use it in GitHub Desktop.
func setupView(){
view.backgroundColor = .black
//setup the scrollView
view.addSubview(parentScrollView)
parentScrollView.fillSuperview()
parentScrollView.contentSize = CGSize(width: DeviceSize.width,
height: DeviceSize.height*2)
//setup the content view
parentScrollView.addSubview(contentView)
contentView.anchorView(top: parentScrollView.topAnchor,
left: parentScrollView.leftAnchor,
width: parentScrollView.contentSize.width,
height: parentScrollView.contentSize.height)
//setup the header view
contentView.addSubview(headerView)
headerView.anchorView(top: contentView.topAnchor,
left: contentView.leftAnchor,
right: contentView.rightAnchor,
height: 450)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment