Weeknotes № 46-47

Here are the combined weeknotes for the last two weeks. I visited my friend in London and met up with a bunch of friends. The NSLondon folks were nice enough to organize a drinks night, was great to see many old and new friends. London feels almost like the opposite of where we … | Continue reading


@chris.eidhof.nl | 1 day ago

Weeknotes № 44

The first half of last week I was still away, so nothing much happened. The second half of the week we started preparing two more workshops. We prepare each workshop specifically for the company we teach, so it’s always quite a bit of work. We believe it’s useful for the company … | Continue reading


@chris.eidhof.nl | 22 days ago

Weeknotes № 45

On Monday I was excited to finally have a regular week of work again without any travel or other big things. Little did I know. On Monday we all got really sick. It knocked the whole family out for multiple days. In the end, I did get a few days of solid work in last week. After … | Continue reading


@chris.eidhof.nl | 22 days ago

Weeknotes № 43

I think a lot of Apple’s documentation could be improved. For example, I think SwiftUI’s layout system could be explained in a much better way. We try to do so in our workshops and books, but I think interactive explanations on a public website would be even better. A few years a … | Continue reading


@chris.eidhof.nl | 29 days ago

Weeknotes № 42

Still on my time off. We’re away in a holiday park, so I’m keeping the laptop mostly shut. I’ve done a tiny bit of work at the beginning of the week, hopefully I can share some of that soon. Mainly writing this post as to not break the streak. | Continue reading


@chris.eidhof.nl | 1 month ago

Weeknotes № 41

As a short break from my time off, we ran a workshop last week. I also took the opportunity to finally (after we moved in a few months ago) get my desk set up. I switched the saw horses for my standing desk base, added cable management and brought out all the gear I use when runn … | Continue reading


@chris.eidhof.nl | 1 month ago

Weeknotes № 40

I’m taking some time off this month to focus on the family and get the final home improvement bits done before winter is here. I am working on some small side-projects and we will run a workshop this week. One of the things I experimented with is a generic programming library. T … | Continue reading


@chris.eidhof.nl | 1 month ago

Weeknotes № 39

We shipped Thinking in SwiftUI last week! It’s now available in PDF and print. We’re very happy with the result (and open for suggestions, of course). One thing that’s currently missing which we might add (depending on how hard it is) is an ePub version. Without having implement … | Continue reading


@chris.eidhof.nl | 1 month ago

Weeknotes № 38

Last week we recorded a bunch of episodes around building a small marquee component. We wanted to make it interactive (similar to a scroll view) which makes the underlying implementation a bit different from how you would normally write SwiftUI components. The animations are driv … | Continue reading


@chris.eidhof.nl | 2 months ago

Weeknotes № 37

Last week we finalized the layout for Thinking in SwiftUI. Now we need to check the (print) proof copy and verify everything is okay before we can finally release it! I also spent some more time on my typing recorder app, it’s really starting to take shape. Hopefully I can demo i … | Continue reading


@chris.eidhof.nl | 2 months ago

Working With UIViewRepresentable

When we work with SwiftUI, we can always drop down to UIKit level by using UIViewRepresentable, NSViewRepresentable or UIViewControllerRepresentable. The documentation around these protocols is still pretty sparse, and it can be hard to get them to work exactly the way we want. I … | Continue reading


@chris.eidhof.nl | 2 months ago

Weeknotes № 36

It feels like last week was the last warm week of summer, and so as a family, we took advantage of that every afternoon and went swimming in one of the lakes nearby. Our new house is a short walk to one of those lakes, and one of my dreams since we moved here half a year ago was … | Continue reading


@chris.eidhof.nl | 2 months ago

Weeknotes № 35

We finally recorded the final bits of our keyframe reimplementation, including a Catmull-Rom implementation that turned out to be extremely simple and matches exactly what SwiftUI does. I’ve used our reimplementation in a macOS 13 app successfully. We also went over the entire b … | Continue reading


@chris.eidhof.nl | 2 months ago

Running Code When Your View Appears

When you’re writing SwiftUI views, you definitely don’t want to run expensive tasks in the view’s initializer, as it might get called very often. Also, since the view doesn’t have structural identity yet at that point, you can’t reliably store data. Instead, you want to load data … | Continue reading


@chris.eidhof.nl | 2 months ago

How To Visualize The Safe Area

When we draw a SwiftUI view on screen, it only fills the safe area by default. For example, here we can see a yellow rectangle that fills the safe area, but leaves white space at the top and bottom of the screen. Rectangle() .fill(Color.yellow) We can change this behavior … | Continue reading


@chris.eidhof.nl | 3 months ago

Weeknotes № 34

Last week we prepared and recorded more episodes about our SwiftUI keyframe reimplementation effort. I also worked on getting closer to the Catmull-Rom version that SwiftUI has implemented, but I’m not quite there yet. It’s close enough to be unnoticable, but I always feel like p … | Continue reading


@chris.eidhof.nl | 3 months ago

Weeknotes № 33

After last week’s conference in Toronto I went to NYC to get the most out of the transatlantic flight. The kind folks at iOSoho gave me a stage as well. After spending so long on preparing my talk (I didn’t track the time, but my guess is that it easily adds up to two weeks full- … | Continue reading


@chris.eidhof.nl | 3 months ago

Weeknotes № 29-32

The last weeks we’ve mostly enjoyed our holiday (visiting the Baltic sea), spent time in the garden, and generally took it easy. I finished the keyframe implementation, I think it’s almost the same as the native implementation but it works on older platforms. It’s not efficient … | Continue reading


@chris.eidhof.nl | 3 months ago

Weeknotes № 28

Last week we put the finishing touches to the animation chapter, and recorded a bunch of episodes to cover the summer break. I worked a bit on my talk as well. For our keyframe reimplementation, we also wanted to have cubic bezier timing curves. This was interesting to implement … | Continue reading


@chris.eidhof.nl | 4 months ago

Weeknotes № 27

We spent most of last week getting the animation chapter ready for our Thinking in SwiftUI prerelease. Of all the chapters in our book this had the most additions for iOS 17. Phase animations, keyframe animations, completion handlers, custom animation curves, new transition APIs … | Continue reading


@chris.eidhof.nl | 4 months ago

Weeknotes № 26

We were busy last week getting the layout chapter out, which is probably the chapter I’m most proud of. There’s still a lot more we could say about SwiftUI’s layout behavior, but I think it’s long enough already. We put a lot of effort into the explanations, I especially like the … | Continue reading


@chris.eidhof.nl | 4 months ago

Weeknotes № 25

Last week, we had the post-launch week of our book, which is always fun. It’s nice to see the first feedback, which has been good so far. We also released a new chapter on state and binding. This one already has a bunch of (hopefully) helpful custom diagrams in there that show ho … | Continue reading


@chris.eidhof.nl | 5 months ago

Weeknotes № 24

We went over the chapters of our book and tried to make an inventory of what we need to add. Most significantly, - the state chapter needs to describe the new way that object observing works, and the animations chapter needs a number of additions. We then prepared everything for … | Continue reading


@chris.eidhof.nl | 5 months ago

Weeknotes № 23

Last week was WWDC week. Hard to miss, the Vision Pro was announced. I’m excited and worried about that device. I especially didn’t like the dad wearing the goggles to take videos of his kids. I already worry about myself (and others) using their phones and other devices too much … | Continue reading


@chris.eidhof.nl | 5 months ago

Weeknotes № 22

I modified our attributed-string-builder to accept modifiers that can be applied to SwiftUI environment. For example, this lets us modify the environment for all embeds inside an AttributedStringConvertible. So far, the library has been really useful, and we’ve gotten really far … | Continue reading


@chris.eidhof.nl | 5 months ago

Weeknotes № 21

We prepared and recorded episodes that reimplement the core data structures of Git in Swift (without any third-party dependencies). The model of Git is really simple — I think it’s beautiful. In the episodes we recorded everything is read-only, but I managed to get writing to wor … | Continue reading


@chris.eidhof.nl | 6 months ago

Weeknotes № 20

We added a whole lot more diagrams to the book. One thing we struggled with is how to visually separate certain parts, and how to relate them to the text. One of the things we are now able to do is color our text inline (or apply any other attributes). Our Markdown renderer now u … | Continue reading


@chris.eidhof.nl | 6 months ago

Weeknotes № 19

We spent last week iterating on the book, mostly drawing diagrams. Because our understanding of SwiftUI has gotten much better since the previous release, we also have much better explanations and much better visuals. We also had to change some things in the underlying infrastruc … | Continue reading


@chris.eidhof.nl | 6 months ago

Weeknotes № 18

For our book, I added support to draw nicer diagrams (with overlays on the arrows placed in exactly the right spot). I also changed the syntax highlighting so that we can generate custom attributed strings for certain parts. You can see both parts in action in this post. We also … | Continue reading


@chris.eidhof.nl | 6 months ago

Weeknotes № 17

We spent a lot of time working on laying out our book, and are getting much closer now. Even though we were “80%” done already, getting all the details right takes a lot of time and tweaking: We added internal links to the book We added warnings for widows and orphans … | Continue reading


@chris.eidhof.nl | 7 months ago

Weeknotes № 16

At the start of the week, I worked on making our (private) SwiftUI library for drawing tree diagrams a bit simpler. It has code for both drawing the diagrams as well as parsing the type of a view and turning that into an interactive diagram. I separated that into two packages and … | Continue reading


@chris.eidhof.nl | 7 months ago

Weeknotes № 15

In Germany everyone gets time off for easter, and we spent time with friends and family. We also planted a bunch more things, really looking forward to summer where we’ll have a lot of fresh vegetables. We’re trying out a bunch of new things, so excited to see how well everything … | Continue reading


@chris.eidhof.nl | 7 months ago

Weeknotes № 14

I worked a bit on porting some “older” features we had in our test implementation of attributed string builder, and added them to our public repository. We’re planning to use that for publishing our book. We want back and forth a lot, but we believe it’s easier to work with our o … | Continue reading


@chris.eidhof.nl | 7 months ago

When Matched Geometry Effect Doesn't Work

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


@chris.eidhof.nl | 7 months ago

Weeknotes № 13

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


@chris.eidhof.nl | 8 months ago

Weeknotes № 12

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


@chris.eidhof.nl | 8 months ago

Weeknotes № 11

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


@chris.eidhof.nl | 8 months ago

Weeknotes № 10

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


@chris.eidhof.nl | 8 months ago

You Don't Need Routes

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


@chris.eidhof.nl | 9 months ago

Weeknotes № 9

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


@chris.eidhof.nl | 9 months ago

Weeknotes #8

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


@chris.eidhof.nl | 9 months ago

Weeknotes #7

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


@chris.eidhof.nl | 9 months ago

Weeknotes #6

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


@chris.eidhof.nl | 9 months ago

Semantic Colors and Styles

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


@chris.eidhof.nl | 9 months ago

SwiftUI Environment Tips

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


@chris.eidhof.nl | 9 months ago

Weeknotes #5

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


@chris.eidhof.nl | 9 months ago

Weeknotes #4

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


@chris.eidhof.nl | 10 months ago

Variadic Views

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


@chris.eidhof.nl | 10 months ago