3 ms·
OP here. SwiftUI has it too. Ideal to implement the results. But they're not great for finding the solution as they are magnitudes slower than spreadsheet manip
by msephton 1y ago
OP here. SwiftUI has it too. Ideal to implement the results. But they're not great for finding the solution as they are magnitudes slower than spreadsheet manipulation.
- bayindirh 1y agoHi! Nice article, tbh. I draw my UIs on paper and just calculate the cells and merges, then code it. I'm a pen and paper addict when designing software (ideas, algorithms, UI). It's not the fastest, but the most focused mode for me.
- msephton 1y agoThat gives me an idea, maybe I can code a spreadsheet to gridcode tool. :)
- wonger_ 1y agoCould you elaborate on the part about calculating cells and merges?
- bayindirh 1y agoAs you know, grid and grid-like layouts work with cells. The height and width of these cells are integers. So, when you have something like this: +-----+-------+ | | Lorem | | |-------| | | Ipsum | | |-------| | foo | Dolor | | |-------| | | Sit | | |-------| | | Amet | +-----+-------+ You have basically six cells. Five of them (lorem, ipsum, dolor, sit, amet) are 1x1, and the other one (foo) is 1x5. What I do is, I draw the UI I imagine on a paper, add a grid where the smallest UI elements (labels, buttons, fields) their own, suitable $WIDTHx1 cells. Some cells like "foo" needs to span mutliple cells (like this 1x5) to look and place correctly. At the end, you have a "spreadsheet like view" with some cells "merged and centered" in spreadsheet software parlance. As the last step, I note the dimensions of the cells I need to realize the UI on the paper, and write the code reflecting that.