Developers: Learn a New Programming Language or App Development with Deitel LiveLessons Videos!
Login  |  Register  |  Media Kit  |  Press  |  Contact Us  |   Twitter Become a Deitel Fan on Facebook  
Custom Search
Swift for Programmers book cover

ISBN-10: 0-13-402136-3
© 2015, pp. ~400

Ordering info:


Code Examples
and Other
Premium Content
Swift for Programmers Errata and UpdatesMinimize


  • The Swift Standard Library function countElements was renamed count in Swift 1.2. In each program that uses it, simply click the error indicator at the left of the code line, then double click the Fix-It that pops up to make the change. 

Chapter 4:

  • Fig. 4.6, line 6: As of Xcode 6.3/Swift 1.2, Apple renamed the countElements function as count

Chapter 10:

  • Invoice.swift: Due to a change in Swift 1.2 with regard to how constants are initialized, lines 21-22 in the initializer--which set the constant properties--must be moved above the if statement that starts at line 15. Constants can no longer be assigned to multiple times before the initializer completes execution. As a result of this change, it's no longer necessary for the partNumber and partDescription to be declared as implicitly unwrapped optionals. So you can also change String! on lines 6 and 7 to just String.

Safari Trial Subscriptuon

Update :: November 19, 2019