Expected behaviour, not a regression nor a bug π«‘
Thanks Apple and the SwiftUI team for being reactive!
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!
I'm building a custom #SwiftUI navigation flow for an app onboarding but I'm having layout issues when moving from steps with/without safeAreaInset content to steps without/with safeAreaInset content. See blue frame.
Any idea how to fix this?
Gist: gist.github.com/alpennec/e9c...
@fatbobman.com
SwiftUI has been released more than 6 years ago but you still have to use UIDatePicker.appearance() to set a minuteInterval other than the default 1 minute to a date picker π€¦π»ββοΈ
Maybe mesh gradients are more used π€·π»ββοΈ
TIL that we can create custom attributes for AttributedString π€©
It's very useful for styling text while respecting localization, especially when the styled segments change per language.
I specify each attributed segment directly in my string catalog translation, and voilΓ ! β¨
Always like that at the start of a PPO from my experience.
Oops!β¦I Did It Again π¬
I renewed my Apple Developer Program membership!
Hereβs to another year of learning, building, shipping, failing, sharing, succeeding and doing it all over again.
Letβs go! π€ͺ
Ah ok. Youβre referring to that. Iβm still on 18.7 π