Replies: 7 comments 30 replies
-
Yeah, I'm really excited to try out SwiftData. If you only need a struct to conform to Codable to be able to persist and do queries, that would be awesome. The whole macro thing seems to open up really great ways to simplify and make things more ergonomic. I was smiling when they had a macro to create a URL from a string without having to put an '!' at the end 😀. I also wonder if macros can make TCA even more ergonomic, for example when it comes to scoping, it would be nice to just have to specify the child feature datatype, but not sure if that's possible to do with a macro. I really like that they have an 'Observable' annotation now. The view can use any of the properties from such class and the change notification will only come for those properties that the view is actually consuming. I wonder if TCA can use this to get rid of the 'observe' param you need to specify. I already sold my kidney yesterday before I say the availabliity date 🤣 |
Beta Was this translation helpful? Give feedback.
-
How do you distinguish between persistent state and navigation state? I've got that issue already with having a feed of items (persisted) that I have to scope into using 3 levels of SwitchStore. Would that work better using Data? |
Beta Was this translation helpful? Give feedback.
-
The Tuesday sessions are available, including what's new in Swift, Swift UI and sessions for macros and swift data: |
Beta Was this translation helpful? Give feedback.
-
I'm not sure if Swift Data will be compatible with TCA out of the box. After watching Apple's videos it seems like using
This automatically does things like publish all the variables and handles changes being propagated to views. My understanding of TCA isn't very good so I might be getting this wrong. This chart from their video on observation shows how data can be used with observable: |
Beta Was this translation helpful? Give feedback.
-
I personally think that a closer look at the Swift Macros announcement could easily create a good way to write Shared State. The current TCA CaseStudies include a Shared State that handwrites getter and setter. This is a straightforward approach but quickly becomes intolerable boilerplate. This is exactly where Macros comes in! |
Beta Was this translation helpful? Give feedback.
-
The latest session on creating an App with Swift Data is available: An another looking into schema: I am so torn right now. I've been spending a few months learning TCA. I have one App on the app store already built with Swift and then updated for Swift UI. I have ideas for another 4 apps but they will all rely on using iCloud for data storage. I think macro libraries will be open to work on so it might be possible to have a TCA implementation of Swift Data that uses the backend parts without the observable parts. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone, sorry for the delay in response. We were busy this week recording new episodes. We’ve spent a little bit of time exploring some of the new tools, but it is far too early to make any concrete statements. There are a lot of exciting things to consider. For one, macros are certainly going to help out the case path situation for us, though we still do hope someday Swift has first class support for the concept. Macros are also going to be applicable to dependency design and dependency management, parsing, and a whole bunch more. And then of course we want to be able to support things like So, we hope everyone can be patient as we digest things and explore, and we also hope everyone shares their own explorations to see what is possible. For what it’s worth, this is pretty similar how things went last WWDC (20222) when I’m sure there are going to be a lot of explorations, a lot of false starts, and a lot of re-thinking of things. At the end of the day TCA is all about writing applications in a consistent manner with modularity, effects management, testing, and ergonomics in mind. These are the principles we want to always build upon, and let the library evolve however it needs to live up to those ideals and play nicely in Apple’s ecosystem. |
Beta Was this translation helpful? Give feedback.
-
Just wondering how everyone feels about the huge announcements at WWDC?
I laughed a lot to see them use macros which left just environment and state. Obviously these are brand new so nobody's had a chance to do much with them but I think they could be a huge boost to implementing systems like TCA.
Making use of Macros is Swift Data, the promise of simple data storage for Swift UI apps without getting your hands dirty with core data and cloudkit. This is handled by a macro so hopefully if there are any parts of it which aren't compatible with TCA it'll be possible to change the macro to suit.
What does everyone think? I'm just off to sell a kidney ready for the launch of Vision Pro in the UK some time in 2025. 😂
P.S. We'll be getting more info on both of these at sessions today:
Beta Was this translation helpful? Give feedback.
All reactions