Errata for SwiftUI Apprentice 1st Edition

Creating this topic to catch any typos and bugs in the 1st Edition of SwiftUI Apprentice!

In Swift Tip box in 1. Checking Your Tools, it should read:

Swift Tip: Swift convention is to name types (like struct) with PascalCase and properties and methods with camelCase.

(right now, those are both identified as camelCase)

3 Likes

thanks Susannah! I figured not everyone would know that term so I just capitalized camelCase and CamelCase suitably. Iโ€™ve updated that note to use lowerCamelCase and UpperCamelCase, which are also valid terms.

3 Likes

Easier to understand than my suggestion too :] Thanks for a fast fix, am loving this book so far!

3 Likes

Chapter 20 UIX Page 526.
The text, as is, will cause a compile error on
.resizableView( transform: bindingTransform(for: element), viewScale: calculateScale(size))
as viewScale is not recognised.

The solution is to add viewScale to the ViewExtensions, as below, and this should be added to page 526.
extension View {
func resizableView(
transform: Binding,
viewScale: CGFloat = 1
) โ†’ some View {
modifier(
ResizableView(
transform: transform,
viewScale: viewScale))
}
}

1 Like

Hi @mazen_kilani! Did you use the starter project as the starter project does already have that code in ViewExtensions.swift?

However, I do see that this change is missed in the description of whatโ€™s changed in the starter app at the beginning of the chapter. Thank you for pointing it out.

This topic was automatically closed after 57 minutes. New replies are no longer allowed.