6 ms·
Problems with pixel perfect layout were what made me give SwiftUI a 12 month “wait for maturity” last year. I hope this and the new SwiftUI custom layout capabi
by jws 4y ago
Problems with pixel perfect layout were what made me give SwiftUI a 12 month “wait for maturity” last year. I hope this and the new SwiftUI custom layout capabilities signal an interest in this at Apple.
I was making strip charts of data at fairly high density and wanted my minor grid lines to be one pixel wide. You must make them line up with a physical screen pixel or they turn into a blurry anti aliased mess. As of last year I never found a good way to connect a SwiftUI view to its physical screen pixel positions. I’ve done this for many years in UIKit, and while extra effort, it is at least possible.
I think this problem is partially why people used “magic marker” aesthetic on their digital charts rather than “engineering pad”.
I guess it’s time for another crack at it.
- solardev 4y agoHow do you do "one pixel wide" when there are so many devices, viewports, LCD/LED types, zoom sizes for accessibility, etc.? It's all virtualized these days, no? A single pixel on something like a watch or 4k 27" display might not even be visible to the average person...
- jws 4y agoWith UIKit you can query the device, it’s subpixel structure, and the alignment of your abstract window on the device and work it out from there. Mostly, it’s possible there is an abstracted display at a non-native resolution over something like an HDMI. But if you are running your display at a non-native resolution then you just don’t care about details and you deserve what you get.