Author Topic: Chapter 21 - The Power of extensions  (Read 4617 times)

viper827

  • Newbie
  • *
  • Posts: 9
    • View Profile
Chapter 21 - The Power of extensions
« on: March 22, 2016, 02:12:25 PM »
My project file for the first hands on was already completed.

For the 2nd hands on file (Extensions.playground), I'm getting errors right from the start using Xcode7.3 public release.

kjmcneish

  • Administrator
  • *****
  • Posts: 719
    • View Profile
Re: Chapter 21 - The Power of extensions
« Reply #1 on: March 22, 2016, 10:46:48 PM »
My fault! The code in the book is correct, but somehow an older version of the sample was on our site. I've uploaded the updated code sample which you can download again at this link:

http://iOSAppsForNonProgrammers.com/SamplesSwift2.html

Sorry for the confusion!
Kevin McNeish

viper827

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Chapter 21 - The Power of extensions
« Reply #2 on: March 23, 2016, 07:13:08 AM »
Thanks for the super fast response  8)

viper827

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Chapter 21 - The Power of extensions
« Reply #3 on: March 23, 2016, 08:09:07 AM »
Next issue:

The UILabel extension exercise isn't displaying a label in playground. Did something change in Xcode? If i create a UILabel without using the extension, it will display.

Code: [Select]
var myLabel = UILabel(frame:CGRectMake(0, 0, 150, 25))
myLabel.text = "Text"

Thanks

viper827

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Chapter 21 - The Power of extensions
« Reply #4 on: March 23, 2016, 08:50:44 AM »
Adding Nested Types - DateExtensions.swift:

Xcode has broken this code too it seems. When running the test, it seems to never set the Month.