onmyway133 / blog

🍁 What you don't know is what you haven't learned
https://onmyway133.com/
MIT License
677 stars 33 forks source link

How to embed UIStackView inside UIScrollView in iOS #324

Open onmyway133 opened 5 years ago

onmyway133 commented 5 years ago
view.addSubview(scrollView)
scrollView.addSubview(stackView)

NSLayoutConstraint.on([
    scrollView.pinEdges(view: view),
    stackView.pinEdges(view: scrollView)
])

NSLayoutConstraint.on([
    stackView.widthAnchor.constraint(equalTo: scrollView.widthAnchor, multiplier: 1.0)
])
subbota-a commented 4 years ago

What is the syntax NSLayoutConstraint.on ?