Skip to content
Discussion options

You must be logged in to vote

Hi @zeroskylian, thanks for trying QuickLayout. There are multiple way of achieving what you need:

  1. Define the body and call body.applyFrame in the viewDidLayoutSubviews.
class ViewController: UIViewController {

  let cellView = MyCellView()

  override func viewDidLoad() {
    super.viewDidLoad()
    view.addSubview(cellView)
  }

  var body: Layout {
    ZStack {
      cellView
    }
  }

  override func viewDidLayoutSubviews() {
    super.viewDidLayoutSubviews()
    body.applyFrame(view.bounds.inset(by: view.safeAreaInsets))
  }
}

You also can achieve that without QuickLayout as well just call the sizeThatFits and set the returned size on cellView.

class ViewController: UIViewController

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@zeroskylian
Comment options

Answer selected by constantine-fry
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #7 on December 01, 2025 13:34.