Errata

iOS 13 Programming Fundamentals with Swift

Errata for iOS 13 Programming Fundamentals with Swift

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
Printed
Page 64
The paragraph after the first code snippet

In the first sentence "..., and we are configuring it by calling addTarget(action:for:), ...",
addTarget(action:for:)
should be
addTarget(_:action:for:)

Note from the Author or Editor:
Quite right.

Wayne  Sep 30, 2020 
Printed
Page 90
The paragraph after the second code snippet

"... and over is an enum reporting that overflow occurred."
should be
"... and over is a Bool reporting whether overflow occurred."

Within Swift, the Bool object type is a Struct, not an Enum.

Note from the Author or Editor:
I don't know where the "enum" wording came from. He's wrong about Bool being a struct - it's an enum. But I might as well say Bool.

Wayne  Oct 01, 2020 
Printed
Page 99
The paragraph after the fourth code snippet

In "Alternatively, contains(_:) can take a function ...",
contains(_:) should be contains(where:).


Note from the Author or Editor:
Agreed, I'll reword in the manuscript

Wayne  Sep 30, 2020 
Printed
Page 100
The paragraph after the third code snippet

In "split(_:) breaks a string up into an array, ...",
split(_:) should be split(whereSeparator:).

Note from the Author or Editor:
I really would rather not show the name of the parameter here, so I'll put `split` plain and simple.

Wayne  Sep 30, 2020 
Printed
Page 101
The last code snippet

The last line of the code snippet:
s.insertContentsOf("ey, h", at: ix)
should be
s.insert(contentsOf: "ey, h", at: ix)

Note from the Author or Editor:
Absolutely correct, changing the code in the manuscript.

Wayne  Sep 30, 2020 
Printed
Page 115
The text next to the tip image

The fourth line of this paragraph,
"`String!"
should be
"String!", the backtick(`) is unwanted, and this is just a typo.


Note from the Author or Editor:
Good catch; actually we are missing a backtick.

Wayne  Oct 01, 2020 
317
Sample code after "...initialization with a minimum and maximum to clamp to:"

"initial" should be "wrappedValue" to match parameter name in the Clamped initializer. Use of "initial" causes compile error. Please see inline comment below.

@propertyWrapper struct Clamped<T:Comparable> {
private var _i : T
private let min : T
private let max : T
init(wrappedValue: T, min:T, max:T) {
self._i = initial // <-- Parameter name should be "wrappedValue".
self.min = min
self.max = max
}
var wrappedValue : T {
get {
self._i
}
set {
self._i = Swift.max(Swift.min(newValue,self.max),self.min)
}
}
}

Note from the Author or Editor:
This erratum is absolutely right, corrected as stated in next revision.

Erik Young  Apr 15, 2020  Jun 05, 2020