Xcode 7 & Swift 2.0

Today at WWDC Apple announced the first beta of Xcode 7, which includes Swift 2.0. Swift 2.0 brings a number of breaking changes that affect the exercises in the book. These changes largely involve the Swift language and not Cocoa. We strongly recommend that you continue to use Xcode 6.3 (or later Xcode 6.x versions) with the book for the time being.

As the Xcode 7 betas stabilize we plan to provide notes on the necessary changes in order to use Xcode 7/Swift 2.0 with the book. Stay tuned!

That would be awesome because I’m having trouble updating some of the books projects to Swift 2—RaiseMan is rather broken for example (that’s the furthest in the book I’ve read so far).

It’s a amazing book for learning by doing
Now i’m using Xcode 7/Swift 2.0 to build projects in the book

Here is the GitHub repo : https://github.com/GWesley/LearnOSX

[quote=“gwesley”]It’s a amazing book for learning by doing
[/quote]

I agree, I’ve always found the BNR books to be fantastic but over the past few years Apple have made so many changes (Garbage Collection, ARC, Swift, Swift 2.0, etc.) that but the time the books are released they are almost obsolete.

So far the biggest change I have noticed with Swift 2.0 is error handling. The changes to some functions as a result of that would probably warrant a new chapter early in Cocoa Programming for OS X (6th Edition). Besides that many of the changes are quite small. How about a topic under each chapter on the forum with the Swift 2.0/ Xcode 7 changes? That way the 6th edition will almost write itself.

The companion guide to ease transition to Xcode 7, Swift 2, and OS X 10.11 is now available!

github.com/bignerdranch/cocoa-p … /Swift2.md

The repository also features Swift 2 solutions to all the exercises: github.com/bignerdranch/cocoa-p … for-osx-5e

So this means that the book in the iBooks Store will not be updated to use Swift 2.0?

The Companion Guide is a big help to us readers of your book (well, at least to me!), and I really appreciate you folks taking the time to write it up and make it available. I just hope you’re keeping in mind those of us who have purchased the e-book book version of Cocoa Programming for OS X, which does not contain page number references in any way. For those of us who have the e-book version of Cocoa Programming for OS X, therefore, that makes all of the references to printed page numbers meaningless. In order to locate the text that the Companion is referencing, therefore, the reader has to try and map out (i.e., search) the content of the code snippets seen in the Companion Guide against the e-book. And for some material there is no text at all to search. For example, regarding changes needed to code found in chapter nine, the Companion Guide explains

If I had the printed book, I’d know to limit my search for ‘removal’ references to pages 159 and 160, but because I have no printed book — that is, no way to see paper-related page numbers in my copy of Cocoa Programming for OS X – I have to start at the beginning of chapter nine and hope I hit upon the correct block of text. It’s not impossible to follow such instructions, of course, thanks mainly to the Companion Guide’s subheadings that relate to Cocoa Programming’s chapters, but not being able to reply on the page numbers mentioned in the Companion Guide make that task harder than it should be.

I would urge you, therefore, to go to the trouble to insert references to the page numbers seen in the printed version of Cocoa Programming for OS X when you produce the e-Pub (er, ‘Amazon Kindle’) version of your book, for that will make these sorts of errata much more useable in the future, to say nothing of the help they will be when e-book-version readers wish to make reference to the contents of your books in their various forum posts. I would also urge you to think about offering buyers of your books documents that employ open standards, which you can easily (well, relatively easily) make available at a store other than (or in addition to) Amazon’s site. KF8 (Kindle Format version 8), which I presume is the format you supplied to Amazon, is not an open standard. In other words, make available an ePub and a PDF/A version of the book to persons who buy a given title. If you’re looking for models, you can see such behavior present at sites such as http://abookapart.com and https://www.packtpub.com.

Unfortunately, as of today, adding printed-page-number references to e-books sold at Amazon is not as easy as it should be thanks to their stubborn ways, but it is possible. If you’re not familiar with how to so so, you might start with these two resources and go from there:

http://wiki.mobileread.com/wiki/APNX
http://www.digitalbookworld.com/2015/how-to-add-a-page-list-to-an-epub/

One more reason why it would be nice to update the ebook versions.

I understand that it is difficult to keep up, but since Swift 2.0 was basically already in beta when the book came out the book was already mostly presenting obsolete syntax from the start.
Additionally it would be really sad to adhere to the rules of the pre-epub era where you had to buy a new book whenever something changes related to the content.
Electronic publication has so much more potential (like updating) and ignoring that is just like living in the past. (Not that I want to imply that the authors are doing that at all! I just want to make a point)

It would be great to get at least a comment from the authors of how they think they will handle this problem.

[quote=“tkrajacic”]One more reason why it would be nice to update the ebook versions.

I understand that it is difficult to keep up, but since Swift 2.0 was basically already in beta when the book came out the book was already mostly presenting obsolete syntax from the start.
Additionally it would be really sad to adhere to the rules of the pre-epub era where you had to buy a new book whenever something changes related to the content.
Electronic publication has so much more potential (like updating) and ignoring that is just like living in the past. (Not that I want to imply that the authors are doing that at all! I just want to make a point)

It would be great to get at least a comment from the authors of how they think they will handle this problem.[/quote]

I second that. Updated ebook versions would be hugely appreciated!

I second this as well. As a newbie struggling with the minutia of a new language this helps the learning experience enormously!

More importantly, while I would very much appreciate an updated to Swift 2.1 version of the book, I would be more than happy to pay for it. As a beginner, I find Apples documentation to be borderline useless - repeating the name of the function in a sentence that says, this is the xyz function, is not very helpful and accurately describes about 90% of the documentation. The other 10% is purely Objective C which I can translate (even though I have never programmed in it) but I really would prefer to simply pay for a good reference document that includes brief samples of code. Baring that, this book covers most of the patterns I used while writing my first app and I found it extremely helpful. Now that it is out of date I find I am going to it less and less.

Could I suggest a subscription model? Updates to the ebook periodically to keep it in sync? As I said, I know you are in business to make money, so I would be very happy to pay for this.

Frank