TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

Issues with the second chapter of SwiftUI By Example

Forums > Books

Hi,

I feel ungracious complaining at all about this book as I have been around long enough to know that I got this for free after WWDC four years ago, but as I see that you are now selling this book and it would be a logical point for some people to start with SwiftUI, I thought you would like to put your best foot forward.

The additional helper code downloaded for the iDine project does not build when you add it to your project because UIKit is imported into one of the files. I know this is probably a recent change and that you have a lot of sample projects to update amongst all your various products.

On page 45 there are instructions to add code "listStyle(.grouped)" that does not work. Again, I believe several changes were made to the API this year, but it's somewhat difficult to figure out how to fix this. It's a small thing and I just wanted to make sure it didn't fall through the cracks.

There is some inconsistency with the text and the code on page 55. You give instructions to embed the text with the item name in the navigation link. The text is no longer a text, but an item row. There is a comment saying existing contents goes into the curly brackets but there are no existing contents because they have been encapsulated in the ItemRow structure. This is the point at which I checked out of this specific book because I don't know what the intention is here.

I scrolled back into the chapter to see if you included a link to the finished project and you did, but it is kind of a throw away suggestion to download it on page 34. I think it might be helpful to put all the code the user will need for the book into one zip/repository so that you get everything at the beginning as you are setting up before you begin explaining what SwiftUI is. If you ever get to a point where you don't feel it is worth it to update this specific book then the user at least has access to the code as it existed when the last update came out and they can debug it. If you don't have time to go through the entire 900 page book, it would be helpful to at least make sure this example chapter is solid as it is the entry point to the rest of the book.

Good luck with the Black Friday sale! Sorry to be pedantic!

Janie

3      

Hi Janie

.listStyle(.grouped) does work still in Xcode 15.0.1 the code used to be .listStyle(GroupedListStyle()), which was changed to .listStyle(.grouped). Make sure that you have put the . dot/point at the beginning, it will not error and will build and run okay.

If you search @twostraws' Github for iDine you will find it there.

Usually Paul put a Text() view on NavagationLinks before he builds the Destination View so maybe a bit of confusion about that.

There was a link in the set up to download the assets

There are quite a few assets provided for this project that you need to copy in before you start. These are all in the assets for this project, which you can download here: https://www.hackingwithswift.com/samples/idine.zip.

If you do find typos etc you best to email him direct then he can deal with the issue direct.

4      

Hacking with Swift is sponsored by RevenueCat.

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.