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 | 1 year 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 | 1 year 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 | 1 year 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 | 1 year 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 | 1 year 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 | 1 year 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 | 1 year 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 | 1 year 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 | 1 year 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 | 1 year 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 | 1 year 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 | 1 year 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 | 1 year 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 | 1 year 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 | 1 year ago

SwiftUI Views are Lists

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


@chris.eidhof.nl | 1 year ago

Weeknotes #3

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


@chris.eidhof.nl | 1 year ago

Weeknotes #2

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


@chris.eidhof.nl | 1 year ago

Weeknotes #1

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


@chris.eidhof.nl | 1 year ago

Lifetime of State Properties in SwiftUI

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


@chris.eidhof.nl | 2 years ago

2021

Continue reading


@chris.eidhof.nl | 2 years ago

Dependencies

Continue reading


@chris.eidhof.nl | 3 years ago

2019

Continue reading


@chris.eidhof.nl | 4 years ago

2019

Continue reading


@chris.eidhof.nl | 4 years ago

Race Report: Berlin Marathon

Continue reading


@chris.eidhof.nl | 5 years ago

Race Report: Berlin Marathon

Continue reading


@chris.eidhof.nl | 5 years ago

Swift Analytics

Continue reading


@chris.eidhof.nl | 6 years ago

Swift Analytics

Continue reading


@chris.eidhof.nl | 6 years ago

A Micro Auto Layout DSL

Continue reading


@chris.eidhof.nl | 7 years ago

A Micro Auto Layout DSL

Continue reading


@chris.eidhof.nl | 7 years ago

Struct References

Continue reading


@chris.eidhof.nl | 7 years ago

Struct References

Continue reading


@chris.eidhof.nl | 7 years ago

Reducers

Continue reading


@chris.eidhof.nl | 7 years ago

Reducers

Continue reading


@chris.eidhof.nl | 7 years ago

Classes That Conform To Protocols

Continue reading


@chris.eidhof.nl | 7 years ago

Classes That Conform To Protocols

Continue reading


@chris.eidhof.nl | 7 years ago

Types vs TDD

Continue reading


@chris.eidhof.nl | 7 years ago

Types vs TDD

Continue reading


@chris.eidhof.nl | 7 years ago

Protocol Oriented Programming is Not a Silver Bullet

Continue reading


@chris.eidhof.nl | 8 years ago

Protocol Oriented Programming is Not a Silver Bullet

Continue reading


@chris.eidhof.nl | 8 years ago

On Burnout

Continue reading


@chris.eidhof.nl | 8 years ago

On Burnout

Continue reading


@chris.eidhof.nl | 8 years ago

Type Erasers in Swift

Continue reading


@chris.eidhof.nl | 8 years ago

Type Erasers in Swift

Continue reading


@chris.eidhof.nl | 8 years ago

Sort Descriptors in Swift

Continue reading


@chris.eidhof.nl | 8 years ago

Sort Descriptors in Swift

Continue reading


@chris.eidhof.nl | 8 years ago

Structs and mutation in Swift

Continue reading


@chris.eidhof.nl | 8 years ago

Structs and mutation in Swift

Continue reading


@chris.eidhof.nl | 8 years ago