Working on a refreshed grid animation for a small widget. Quite happy with the result so far considering that widgets don't have any of the new fancy animation APIs like PhaseAnimator, Keyframes, etc., takes some hoops jumping to make it look half-decent... @_Davidsmith would probably know some tricks 😅 #SwiftUI
I think for that you don’t want structural identity because the structure will eventually change.
But assigning global identity (like a DOM id) conflicts with componentization. There has to be something in the middle, a path builder that is not tied to the exact structure. #WebObjects #SwiftUI
It’s not usually an issue in SwiftUI because an app upgrade implies a restart, but I wonder whether such things leak in for stuff like state restoration #WebObjects #SwiftUI
Do you remember those #WebObjects links like “http://Dodge.woa/wo/2.3.2.4.1.1.1.1.2.3.4.5”? Those (usually numeric paths) are essentially a representation of the thing that is called “structural identity” in #SwiftUI.
I.e. the button in the pic would produce a link like `.woa/wo/2.2` to represent a click on the second item in the `ForEach`.
It's problematic on the web, because links can be long-living, but the server may upgrade and have a different structure.
Refactoring #SwiftUI Views, Generics and Is This Really Better?: https://pmcconnell.micro.blog/2025/02/06/refactoring-swiftui-views-generics-and.html
Ran across a potentially confusing SwiftUI situation today: "any View" versus "AnyView" (not to mention "some View"). I managed to refactor my way away from the problem, but here's a good exploration of AnyView.
https://www.swiftbysundell.com/articles/avoiding-anyview-in-swiftui/
To show a Swift enum in a SwiftUI picker, you must do two things.
1. Make the enum conform to CaseIterable.
2. Wrap the picker in ForEach, supplying an array of the enum’s values.
More details in the following article:
https://swiftdevjournal.com/showing-a-swift-enums-values-in-a-swiftui-picker/
If it's not obvious, I post most of my #Swift #SwiftUI #Xcode tips here mostly for myself.
I can rarely remember a solution a day or two after I've figured it out and they are always needed again at some point.
If these are helpful for others that's great but they are almost always helpful for me later.
It's like "AI" if "AI" stood for actual verifiable intelligence.
An attempt to resurrect #Hotline for modern #Apple systems (#iOS & #macOS etc) by completely recreating it in #Swift and #SwiftUI https://github.com/mierau/hotline
If you're diving into SwiftUI, this resource is your secret weapon. It's a must-have for any developer! 😉 #swiftui #indiedev
https://fuckingformatstyle.com/numeric-styles/
@swiftui @swift Exciting News! 🎉 Just dropped Part 4 of my "Let's Build Pinterest clone Using SwiftUI and “firebase” playlist! 📺🛠️ Dive deeper into Swift development as we take our app to the next level. 🚀 Check it out now and let's code together! 🔗 https://www.youtube.com/watch?v=Y1Oj-DoFO9k #swiftui #swift #iosdev
Piatto - Dining Log v2 is finally out! This version is a complete redesign transitioning away from a list and showing a Map instead. What a ✨ glow up ✨. Get 1 week free:
Yearly: https://apps.apple.com/redeem?ctx=offercodes&id=6670235994&code=v2launch2
Yearly Family Sharing: https://apps.apple.com/redeem?ctx=offercodes&id=6670235994&code=v2launch
Offer is not here for long so get it while you can!
#indiedev #indie #swift #swiftui #iosdev #Apple