(no title)
peterkos | 1 year ago
I find these kinds of problems the most fun and the most educational! I tried building a grid layout system from scratch in SwiftUI, and it was similarly tricky to map out:
- what the "ideal" behavior one expects is,
- what edge cases exist,
- how to handle the edge cases,
- maintaining ideal behavior while handling edge cases.
(It was tricky b/c SwiftUI lays out its children, then its parent -- so the parent needs to ask its children for its view size, and iterate and set rows/columns that way.)
Maybe because the problem seem simple, it is that much more fun to dig into. Some good ol' time with a whiteboard.
No comments yet.