Hi. I’m a long-time RayWenderlich reader and I have read many of their books and tutorials since 2011, which is when I got into iOS development. The content is usually pretty high quality, so I’d like to voice my concerns regarding Chapter 7 of SwiftUI by Tutorials.
My intention is not to attack the book in any way. Up to Chapter 6 it is very good (despite some flaws that I will point out in the Errata at a later time), but it kind of breaks on Chapter 7. My intention with this thread is to mention the flaws on Chapter 7 of the book and to offer a way to fix them.
In short, this chapter is not really well done. It is extremely “wordy”, and the way it handles the examples is not good to learn the contents of the chapter. In the previous chapter (Chapter 6), we started the “Kuchi” app and all we wrote was the welcome screen. In Chapter 7 we suddenly have a much bigger Kuchi app provided by the started project with a bunch of code already written for us. While I am used to this format from previous books, I feel that the way Chapter 7 handled it is too much. Starter projects should only have small improvements based on the finished products from the finished project in a previous chapter, and not offer a full-fledged app built on top of the technology the book trying to teach us.
The chapter makes you open and modify a bunch of files in the starter project, but it’s hard to learn anything because you never wrote any of the original code. While the book tries to explain you why using a property wrapper over another one may be better for a use case, it’s never going to stick with you unless you can see the benefits and understand the purpose of the original code to begin with.
The way Chapter 7 is written right now feels like it’s in a very weird position in which it’s both very long and extremely short at the same time. It’s in a state in which it tries to teach you something, cramming everything it can into a single chapter, but along the way it feels like it’s omitting important details, the little code it provides and asks you to modify doesn’t have much context to understand what’s actually happening and how it compares to the original code.
Data flow in SwiftUI is extremely important to have Chapter 7 in the current state it is in.
My proposed solution is to dedicate an entire section to JUST data flow, and to keep building the “Kuchi” app step by step throughout 4 or 5 chapters in that section. The section could have a dedicated chapter for each property wrapper related to data flow. A chapter for
@State, a chapter for
@ObservedObject, a chapter for
@EnvironmentObject, and so on. In each chapter we would build components of the app using the involved property wrapper, and as we work throughout the section, we would modify existing code to use other property wrappers when relevant. This way, we will be building the Kuchi app, and the content we will learn will stick with us for longer. We will also understand why a given property wrapper is better over another one when the time comes for a given case scenario.
Once again, my intention is not to attack the book in any way. I really like RW books and tutorials, and I really want SwiftUI By Tutorials to be on the same level as the other RW content I’ve read. SwiftUI and Combine are two technologies I was particularly excited for this year, so I bought the Fall bundle that included both as soon as it was announced.
I’m sorry if this is not the right place to say this. I will happily post it elsewhere if that’s the case.