Are you seeing a weird change in text and image styles when you dismiss a SwiftUI popover?

Another one from the “building Captionista” files, I noticed that on iPad any Text inside a popover that has no explicit font will change weight/size when the popover is dismissed, also affecting the layout. You only see it briefly when you tap away from the popover, but it looks bad!

Note that the same problem applies to imageScale so it looks like there is something in the environment that changes when the popover dismiss begins.

Workaround: Add .font(.body) or similar on the elements so you’re not relying on any defaults in the View hierarchy.

About

Marc Palmer (@marcpalmerdev) is a consultant and software engineer specialising in Apple platforms. He currently works on the iOS team of Concepts sketching app, as well as his own apps like Captionista. He created the Flint open source framework. He can also do a pretty good job of designing app products. Don't ask him to draw anything, because that's really embarrassing. You can find out more here.

Comments are closed.