'ASCellNode setting height

I want my cell's height to fit completely with the height from my ASTableNode, Follow what I found that I need to implement this one

override func layoutSpecThatFits(_: ASSizeRange) -> ASLayoutSpec {
}

I tried many ways but don't know how to do it properly

Maybe a dumb question but really need some helps

Thank you



Solution 1:[1]

Try this in didLoad() method.

node.style.preferredSize = UIScreen.main.bounds.size

Solution 2:[2]

You can do it using ASTableDelegate. Set the delegate of your ASTableNode and then:

extension ViewController: ASTableDelegate {
    func tableNode(_: ASTableNode, constrainedSizeForRowAt _: IndexPath) -> ASSizeRange {
        let width = UIScreen.main.bounds.size.width
        let heigth = UIScreen.main.bounds.size.height
        let size = CGSize(width: width, height: heigth)
        return ASSizeRangeMake(size, size)
    }
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Teju Amirthi
Solution 2 Levan Karanadze