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



Minimize
iOS 8 for Programmers book cover


ISBN: coming soon
© 2015, pp. ~600 for Volume 1

Book Ordering info:

Video Ordering info:

 

Download Code
Examples and
Other Premium
Content for
Registered Users
Additional Resources
Xcode 6.3 UpdatesMinimize

Apple released Xcode 6.3 and iOS 8.3 the week of April 6th. Xcode 6.3 includes Swift 1.2, which introduces several breaking changes to Swift that prevent certain of our apps from compiling. If you prefer to follow the examples as they were originally written and have already upgraded to Xcode 6.3, you can get Xcode 6.2 from https://developer.apple.com/downloads/index.action?name=Xcode.

Some of the code that requires changes was autogenerated by Xcode when creating each app's project. In those cases, Xode's project templates have been updated. If you're building the app's from scratch you won't encounter the compilation errors in the autogenerated code. 

For each breaking change, Xcode will report an error message. When you click the error in the Issues navigator, Xcode will display a FixIt that corrects the issue. Please note that when we tried to use the FixIts, Xcode often inserted the fix incorrectly--you might want to look at the suggested fix and apply it manually. Xcode 6.3 also provides a new menu option Edit > Convert > To New Swift Syntax. However, we found that this too did not apply the fixes correctly. 

For Xcode 6.3+ users, we made the fixes to our source code and posted a new set of examples. Here is an overview of the changes.

  • In Chapter 4's Twitter Searches app, there are a number of uses of the operator "as" for downcasting, which now require the "as!" operator instead. Some of these are in the autogenerated source code and some are in our app-specific source code. If you're building the app from scratch, the ones in the autogenerated source code will be fixed for you automatically. If Xcode reports an error on any use of the "as" operator in this app, changing it to "as!" will correct the problem.
  • In Chapter 5's Flag Quiz app, there are a few of uses of the operator "as" for downcasting, which now require the "as!" operator instead. In addition, the Swift Standard Library function countElements (line 102 of QuizViewController) has been renamed count.
  • In Chapter 6's Cannon App, there are a few of uses of the operator "as" for downcasting, which now require the "as!" operator instead. In addition, NSSet now has a Swift generic counterpart named Set. The uses of NSSet in classes GameScene and GameOverScene must be replaced with Set<NSObject>. When iterating through UITouches in GameScene line 170, the following line
       for touch in touches.allObjects as [UITouch] {
    must now be
       for touch in touches as! Set<UITouch> {
    This occurs three times.
  • In Chapter 7's Doodlz App, there are a few of uses of the operator "as" for downcasting, which now require the "as!" operator instead. In addition, NSSet now has a Swift generic counterpart named Set. All uses of NSSet in class DoodleView must be replaced with Set<NSObject>. When iterating through UITouches in that class, the following line
       for touch in touches.allObjects as [UITouch] {
    must now be
       for touch in touches as! Set<UITouch> {
    This occurs three times.
  • In Chapter 8's Address Book App, in addition to the many uses of the operator "as" for downcasting, which now require the "as!" operator, there is also an additional cast required in the app's auto generated code. 
Xcode 6.0-6.2: Errata and Updates for iOS® 8 for Programmers: An App-Driven Approach with Swift

Swift Bug(s) 

  • [Note: The following bug appears to be fixed in Xcode 6.3]
    There is a Swift bug that was introduced with iOS 8.1.x/Xcode 6.1.1 in which attempting to modify a Dictionary to add, update or remove key-value pairs results in an EXEC_BAD_ACCESS error when testing your app on a device.
         A hack was reported by several developers online that "fixes" the problem and we've asked a friend inside of Apple to look into it too. The error does not seem to occur in the iOS 8.3 beta that's currently available, so perhaps this has been fixed moving forward.
         The hack is to assign the Dictionary to a constant in the statement before you attempt to modify the Dictionary. So you'd add a statement like

         let temporaryConstantDictionary = nameOfYourVariableDictionary

    in the line before performing the modification statement.

Chapter 3

  • Page 80, Section 3.2.7, after the bullet list, the 4th line in the paragraph, at the beginning of the line the second word is:

         exits

    and it should be
       
         exists

Chapter 4

  • Page 111, Chapter Objectives, second to last bullet: "UIActivityViewControllers" should be "UIAlertControllers".
  • Page 142, Fig. 4.25, line 7: ", UIGestureRecognizerDelegate" can be removed as this protocol is not actually used in this example. We instead use a UILongPressGestureRecognizer later in the chapter to handle long-press events. 

Chapter 5

  • Fig 5.16, line 34: Remove the second parameter to init.  
  • Fig 5.30, line 47: model.regions.values.filter should be model.regions.values.array.filter

Chapter 8

  • Any mention of AddEditViewController should be AddEditTableViewController—there are several throughout the chapter. 
  • In Section 8.5.1, we are missing the step to change the Prototype Cell's format to Subtitle. To do so, select Main.storyboard in the Project navigator. In the storyboard, ensure that the Document Outline is displayed, then expand Master Scene > Master > Table View and select the Cell node. In the Attributes inspector, set the Style attribute to Subtitle.

 

c

 

Discounts on SafariBooksOnline.com subscriptions

foot
Update :: August 19, 2017