The solution is to use .compositingGroup() on the SwiftUI Menu π
Thanks to @saschagordner.de who pointed me to a StackOverflow answer about the exact same issue: stackoverflow.com/a/79884587
Documentation about compositingGroup: shorturl.at/btdM6
Posts by Axel Le Pennec
Oh Iβll try! Thank you!
In what console have you seen the warning? Xcode when running the code?
Any idea how to fix this Liquid Glass visual bug?
In my app, I have a #SwiftUI Menu that presents an overlay over the whole view. But the Menu stays visible for a short period of time until it goes below the overlay π«€
Works fine on iOS 17/18.
Code: gist.github.com/alpennec/31e...
Looking great Shawn! Thanks for sharing. Good luck for the launch π
Curious to see whatβll ship!
New app analytics are finally live in App Store Connect! Time to explore π₯³
Next: dark mode? π
Expected behaviour, not a regression nor a bug π«‘
Thanks Apple and the SwiftUI team for being reactive!
Dear SwiftUI, can you please fix the regressions you introduced on iOS 26? FB22043999
In my View, I read the dismiss value from the Environment.
Whenever a Menu or Picker is opened, the View body is re evaluated π€·π»ββοΈ
This unexpected behaviour doesn't happen on iOS 18.5 π
Lately, Iβve often had to approve transactions in my banking app when making in-app purchases (even free trial). It asks for approval even if I approved another purchase just a few minutes earlier.
I wonder whether this added friction hurts conversion rates π«€
Have you experienced this as well?
TIL SwiftUI has a pixelLength environment value.
It's a shortcut to dividing 1 by the displayScale environment value as I did before π
Documentation: developer.apple.com/documentatio...
By observing the top content inset of the scroll view, I notice it gets updated from 0 to top safeAreaInset value when the view appears, and then when I reach the threshold that adds the title view above (which pushes the scroll view down and stop extending below safe area).
I use .frame(in: .scrollView) to read a scroll view offset and show/hide a title.
But I observe a jump in the offset if the content extends below the safe area (when there's no View above).
Does adding the title change the frame I read? Should it?
Code: gist.github.com/alpennec/388...
Also, Iβve the feeling people donβt care anymore about the technical aspects of things now that they heavily rely on AI to write the code and do the work for them. In my experience, asking a technical question is more and more like speaking into the void nowadays.
I often find myself wanting to log the same message when previewing my app in the Xcode canvas and when running it on a Simulator or a physical device.
How would you handle using print() for preview and the unified logging system (Logger) at the same time without repeating?
You can still preview the profile.
x.com/nickgdwn
Conversion rate of what? Trial start or first dollar made by a customer (direct sale or trial conversion)?
Interesting approach. Because my current test has overlap between countries where prices between localized and not are more or less the same (tier 1). So this pollute the results for sure!
Who A/B tested if localized prices actually bring more money or not at the end? I know it depends on the app but curious if it's worth checking.
What test methodology have you used and what volume of data required to conclude?
Do @revenuecat.com or @superwall.bsky.social have some insights? π
After the Swift SDK for Android, Swift in the browser with ElementaryUI π€©
The best time to learn Swift was eleven years ago. The second best is now π
elementary.codes
Have you experienced this issue with your app accentColor not being respected, even without using Mixpanel?
If I just and only access UIScreen.main.bounds in my App init, the accentColor is ignored.
This page on SO gives other reasons like modifying UIAppearance: stackoverflow.com/questions/71...
TLDR about performances with Xcode Previews β¬οΈ
When you update:
- an βinlineβ value: π
- a stored property: π
- a computed property: π
So if you centralize your design constants at the top of a View for example, computed variables are the way to go ππ»
I dug a bit more in this issue where my accentColor is ignored by my SwiftUI apps when I initialize Mixpanel in my App init (early but required).
I noticed it's due to the SDK accessing UIScreen.main.bounds.size...
My fix is to comment this line β¬οΈ
More: github.com/mixpanel/mix...
Confirmed by Apple π«‘
If there are some Apple engineers around: FB21355562
One tip to speed up your SwiftUI previews π€©
I wanted to centralize constants like opacity, spacing, or sizes used by my View to speed up prototyping.
Stored properties: slow π as Xcode recompiles the file every time I tweak a value.
Computed properties: instant updates ποΈ
SwiftUI AnyShapeStyle, yay or nay? π€
I've been using two foregroundStyle for my shaped view backgrounds: one with a Color (often a UIKit one: secondarySystemBackground) + another one with a HierarchicalShapeStyle.
But we can get the same with AnyShapeStyle + BackgroundStyle.
Thanks Craig! π
Apple, don't be surprised if developers don't file feedback anymore in Feedback Assistant.
I take the time to file detailed feedback with steps, device details + screen recording to help improve things for everyone.
Please, donβt reply to ask for things Iβve already provided...
A solution suggested by @fatbobman.com is to "duplicate" the top/bottom content: one hidden in the safeAreaInset of each page + one visible/interactive in an overlay of the parent/container View (ZStack).
Of course it depends on the onboarding design.
Gist: gist.github.com/alpennec/2a3...
Thanks for the help!