One of the SwiftUI APIs that always kept confusing me is matchedGeometryEffect. I often thought I could use it but couldn’t figure out exactly how to make it work, always getting weird effects. I tried to distill the problematic code down to the essence: struct ContentView: View … | Continue reading
We spent a lot of last week moving our stuff, culminating on Friday where we had to actually leave our old place. This was pretty stressful with two kids running around, and the oldest getting pretty sick at the beginning of the week. But we managed, all of our stuff is in the ba … | Continue reading
Last weekend, we spent the entire sunny weekend around our new house, and with my 5-yo daughter we tackled a whole bunch of small projects: building some walls, sorting out wood, and building and planting our first raised bed. We recorded a few Swift Talk episodes on Monday, and … | Continue reading
This week we managed to send over all our remaining chapters except for the introduction to technical review. At the last minute, we added a section about coordinate spaces and anchors. In thinking about this, we realized that anchors are purely convenience, it really seems to be … | Continue reading
This week we tried to “ship” a bunch of Thinking in SwiftUI chapters to Ole, who’s doing the technical review. We managed to get the chapters on view layout, view trees and environment over to him. We went through all of these chapters once again, and also added a bunch of diagra … | Continue reading
For the Mac app we use during our workshops, we also have a web server with an API. The server handles user registration and some other minor things. We just added support for sending one-way messages (from the instructors to the attendees). This involved the following steps: … | Continue reading
This week we continued writing our book. I wrote the first draft of the last chapter that wasn’t written yet (Environment). We both spent a lot of time editing and finetuning the other chapters. I think the animations chapter and the section on alignment will be extremely helpful … | Continue reading
This week we mostly spent on writing the update of Thinking in SwiftUI. I think by now we rewrote every chapter from scratch, and also added a new chapter about view trees. The ideas are still the same, but due to us diving deeper and definitely due to all the workshops we’ve hos … | Continue reading
This week I mostly spent coordinating the house renovation, and doing lots of odd jobs. We had to take down a very old ceiling (not sure if it was the original ceiling from when the house was built) consisting of plaster, reed matting, and boards, ending up with just the ceiling … | Continue reading
We got our internet access working at the new house. We also won’t move before the end of March, probably later, but at least that part is working. We had a bit of a setback this week, as we found out that the plastering will take quite a bit longer than calculated. It’s a big ch … | Continue reading
In SwiftUI, most colors are semantic colors that get resolved at runtime. For example, here are a few colors (rendered on macOS) in both light mode and dark mode. It’s a little hard to see, but even colors like .blue and .red are slighly different: Note that the above colo … | Continue reading
In our SwiftUI workshop we always include an exercise where you learn about how the environment works. Often, we build some kind of stylesheet that gets passed down the environment, from the root view. The stylesheet could look like this: struct Stylesheet { var buttonColor: Co … | Continue reading
During the first three days of this week we ran a workshop in PST. This was actually a two-day workshop, split into three days because of the timezone difference. I’m an early riser by nature, and staying up until midnight isn’t really my strength. While it’s pretty easy during t … | Continue reading
While Florian was away the first few days this week to hold a workshop, I prepared some more things for next week’s workshop. During the workshop, we use an internal Mac app to present things to the attendees. For example, we show layout trees, render trees and have an interactiv … | Continue reading
This week’s post about how the SwiftUI view protocol really represents lists stirred a bit of controversy on Mastodon. But I think we all learned a bit from the discussion that followed (I definitely did). To deal with these lists of views (e.g. during layout) we can use the und … | Continue reading
When you write SwiftUI, all your views conform to the View protocol. The name of this protocol is a bit misleading: I it could be called Views or ViewList, or something else that suggests plurals. For example, consider the following view: struct MyView: View { var body: some V … | Continue reading
After a super busy week last week, I took things a bit easier, especially on the house renovation part. Lots of family time instead! Work-wise, I started the week by improving the README for our attributed string builder project, and also added support for custom environment key … | Continue reading
At the end of last week, we recorded some Swift Talk episodes that build up our new attributed string builder library. This project allows you to build up an attributed string using result builders, from a number of different sources. For example, you can write Markdown, plain st … | Continue reading
I’d like to write more this year, so here’s an attempt at a proven format that’s new to me: a weekly log of the stuff I’ve worked on. New year, new format! I started the week continuing to work on the update to our book Thinking in SwiftUI. We’ve basically rewritten it from scra … | Continue reading
This post is a look inside how (a small part of) SwiftUI works. I'm mainly writing this as part of my extended memory, so that I can go back to it and read about how it works. We're currently in the process of updating our book Thinking in SwiftUI and figuring out some … | Continue reading