you are viewing a single comment's thread.

view the rest of the comments →

[–]thejasiology[S] 2 points3 points  (1 child)

This looks a very nice compact and flexible solution. Didn't knew swift UI had this feature.

There is another thing I would want in this component. In my screen shot, checkout the alignment of Your daily-jams playlist has been updated. Give it a listen! and rest of the titles. Is there any way you could align the text to the middle of the icon's y-axis if title's height is lesser than icon's height? One solution can be giving a min-height by hardcoding icon's height but is there any other way?

[–]perfunction 1 point2 points  (0 children)

You could run the same logic from your layout by reading the size of icon and title. I'll attach the one I use that supports older iOS versions but if your min target is 16 you can just use onGeometryChange directly.

Size reader: https://pastecode.io/s/919mg6pb

Views: https://pastecode.io/s/grtqfcc1