Archive for the ‘Books’ Category

Finishing up Swift From Two to Three


I’m getting close to wrapping up my latest little self-published Swift book. Like Playground Secrets and Documentation Markup, the book will be available on iTunes and LeanPub. It’s written for anyone who has stayed in Swift 2.3 so they could keep shipping code but who now is looking to move towards Swift 3.

Here are some sample pages to give you a feel for what’s coming up.

As always, if you have any feedback or requests, please let me know. Does this sound like a book you might purchase? I’d love to hear from you.

Thanks again for all the support you give me, my blog, and my books. It’s appreciated beyond measure.

Review: Man, I hate Cursive by Jim Benton

Screen Shot 2016-08-21 at 7scaled.58.09 PM

If you like good, stupid, subversive humor (and who among us does not?), consider pre-ordering Jim Benton‘s “Man, I Hate Cursive”.

Due out this October, this cartoon collection for “People and Advanced Bears” is silly, witty, and laugh-out-loud fun. It offers a collection of Benton’s more popular strips from Reddit, “shining a light on talking animals, relationships, fart jokes, and death” according to the book’s promo copy.

I liked it a lot. Admittedly, some of the humor leans off-color: it’s the kind of book you gift a friend, a fellow programmer, a geek, but not maybe your mom unless your mom is a friendly programmer geek, in which case, she’ll enjoy the laughs.

You’ll probably like it too, in which case, it’s excellent for leaving around on coffee tables if you’re a little uptight or in bathrooms, where its humor might be more appreciated during those deeply  philosophical times when you forget your iPad and don’t subscribe to the Ikea catalog.

Screen Shot 2016-08-21 at 7.57.05 PM

At just under a hundred pages, the book ended way too soon for me.  “Man, I Hate Cursive” is available for pre-order on Amazon ($11.07 paperback, $9.99) and will be published on October 18, 2016.

NetGalley provided me with a free copy of the book for this review.

Swift Developer’s Cookbook Content Update #1 is live

I’m pleased to announce that the Swift Developer’s Cookbook content update has gone live. My editor writes:

Hi Erica,
The Web Edition has been updated and is live (I just registered my book and checked it). To access the Web Edition, anyone who purchases the book can just register it at After doing so, the Web Edition will show up on the Account page.
You can feel free to post a blog entry, tweet, et cetera that the first update is live.

Pearson’s Content Update Program is brand new. It has experienced significant challenges over the past months: floods in Chennai followed by a massive downsizing at Pearson, which caught the CUP point people in the layoffs. With luck, further updates will not take so long. It’s a very weird time to be in the technical writing business.

If you’ve purchased a copy of the book from any vendor, you should be able to register it with InformIT and receive access to the refreshed material. If you have any difficulties, ping @InformIT on Twitter.

Book Review: Post this Book


Sometimes there is such a thing as too many memes and kitten gifs. David Sinden and Nikalas Catlow breathe fresh air into social media feeds with #Post This Book  (Sourcebooks, $9.99, complete with built-in hashtag). This sweet inspirational book is suitable for tweens, teens, and even college students. It offers 150+ pages of ideas for tweeting, tumbling, facebooking, vine filming, and instagramming.

It’s not a book you read. Each page offers one or two ideas along with quick descriptions. You turn pages, you get inspired, you go out and express yourself using those ideas. Everything is simple, but well tweaked to connect with an audience and inspire a conversation.

Screen Shot 2016-06-26 at 7.56.15 PM

With kids and social media, there’s always tension between privacy and free expression, appropriateness and creativity. I’m pleased to say that in the time I spent flicking through pages in this book and showing examples to my kids, that I didn’t find anything objectionable or problematic.

The ideas in this book allow kids involve themselves in public fora (using anonymous nicks and handles, of course, because, you know, reality). At the same time they’re exploring their imaginations, they’re not crossing inappropriate lines that are so prevalent on Tumblr and beyond.

Screen Shot 2016-06-26 at 8.17.05 PM

This book’s projects offer positive ways to test the waters of social media. Whether brainstorming how to “zombify something unlikely”, videoing time lapsed “tidying up”, or creating “a tabletop obstacle course”, all the projects I read through were inspirational and fun.

#Post This Book goes on sale on July 1st from Sourcebooks. It’s a perfect “gift” book — for just 10 bucks, you can probably buy a small tin of colored pencils or markers to pair with it without breaking the bank.

I was given early access to the manuscript for this review courtesy of NetGalley and Sourcebooks.

Playgrounds Part III

Screen Shot 2016-06-14 at 2.49.47 PM

I have to call it a day, but I’m really happy with what I’ve learned about authoring Playground Books for iOS today. (I’m less happy learning about how to completely reset Xcode — either reboot your system or hop into terminal, do a ps -ax and grep for Xcode and then kill anything with the name in it.) I thought I’d share a few lessons.

If you are going to author for iOS, start with a new playground created from scratch in Xcode 8 rather than modifying an existing one. If you cannot import PlaygroundSupport, reboot your computer. If it doesn’t show up and you’re still using XCPlayground (now deprecated), you’re doing it wrong.

Understand that the Swift snapshot on iOS 10 is older than the Swift snapshot in Xcode so don’t expect to use really recent evolution implementations:

Screen Shot 2016-06-14 at 2.37.05 PM

I ended up implementing my own sequence functions to make my code work.

The easiest way to get started is just to AirDrop a normal playground.

Screen Shot 2016-06-14 at 3.09.40 PM

It will open automagically in Playgrounds for you. When you transfer books, you have to choose “open in Playgrounds” from the AirDrop menu.

If you want to author a Playgrounds Book before tomorrow’s session, just customize a blank document (download at your own risk). My blank book is a one-pager, and you can tweak the Contents.swift file in Blank.playgroundbook/Contents/Chapters/Document1.playgroundchapter/Pages/Blank.playgroundpage. There are manifests at every point along the way, try not to mess them up otherwise the book won’t open.

When authoring pages, either in a normal playground or playground book, you can annotate them to omit details that would otherwise clutter the interaction space or should not be visible to the reader. In my Spirograph playground (download at your own risk), I use special mix of normal playground markup (I have a couple of books that cover this markup format: my Doc Markup book and my Playgrounds book) and these new keywords:

  • Use #-hidden-code and #-end-hidden-code to exclude code from the reader’s view.
  • Mark editable areas with #-editable-code and #-end-editable-code, and if you like you can add a note to the opening tag.
  • To simplify code completion, you can globally omit code completion #-code-completion(everything, hide) and then choose which selectors to present, as I do in the following sample. You see this in the above screenshot, which offers one-tap access to just three customization points for my spirograph.
 **Spirograph:** Play around.
 - Note: The default values are:
 * minor: -3.0
 * offset: 130.0
 * color: .black()
import UIKit
import PlaygroundSupport

public var color =
public var minor = -2.0
public var offset = 130.0

public func setMinor(_ value: Double) { minor = value }
public func setColor(_ value: UIColor) { color = value }
public func setOffset(_ value: Double) { offset = value }
//#-code-completion(everything, hide)
//#-code-completion(identifier, show, setColor(_:), setMinor(_:), setOffset(_:))
//#-editable-code Tap to enter code

let liveView = UIImageView(600, 600, backgroundColor: .white())
PlaygroundPage.current.liveView = liveView
liveView.image = spiroImage(
 size: CGSize(width: 600.0, height: 600.0),
 samples: 4096, minor: minor, offset: offset, color: color)

WWDC sale: Gourmet Cookbook, Swift Cookbook, and more!

ShowCover-1.aspx  ShowCover.aspx  ShowCover-2.aspx

Happy WWDC! My Gourmet Cookbook is InformIT’s eBook Deal of the Week this week (from 6/12 to 6/18), selling at a 53% discount. You can also snag a cool 37% discount off any of my other Pearson books by using the code IOSDEV37. Hop by my InformIT author page to grab a deal.

Update: @InformIT sent me a corrected discount code Monday morning. I apologize if you had any trouble yesterday or today with an invalid code.

Would you buy this book? Swift from 2 to 3


If you thought Swift 2.2 was a big change, just wait until Swift 3 hits Xcode. I’m considering writing a quick reference to help you migrate your code, going beyond the automated tools, so you can start using Swift 3’s kickass new features.

Here are few samples pages from my proof of concept. The screenshots come from the already fleshed out 2 to 2.2 section rather than from the later 2.2 to 3 section, which I’m working on now. The format should remain the same more or less: what is the language change, why was it added, how do you use this and/or refactor, what are some examples of use, and where can you learn more about the change:

(Sorry about the voting on the sample pages. Apparently I can turn on gallery voting for everything or nothing but can’t mix and match what’s votable and not votable.)

Does this look like something you’d pay for?

And would it be okay to release it incomplete, updating it regularly over the year until Swift 3 hits this winter?

Thanks in advance for your feedback and comments.

Swift Documentation Markup update


I just uploaded version 1.2 to both iTunes and Leanpub. They should go live fairly soon.

This release takes advantage of my dumpster diving through Swift’s sources, updating details of Xcode’s CommonMark support and expanding information about the supported markup tags in Xcode 7.3.

I expanded the playground section to describe the new 7.3 markup tags and added coverage about embedding videos using playground markup.

Thanks again to everyone who continues to support my independent book projects. I am also hard at work on the Swift 2.2 content update for the cookbook and my indie Swift Style project.

Playground Secrets 3rd Edition


I just pushed the 3rd edition to the store. If you’ve already purchased a copy, the update should appear tomorrow or over the weekend. Check for available downloads. As always, if you find any mistakes or if I overlooked any content with the new updates, please do let me know!

New purchasers, the 3rd edition will be available on iTunes and LeanPub as soon as it is approved and processed.

From the release notes:

Massive revision for Xcode 7.3, Swift 2.2 changes. Highlights include new examples for Swift 2.2, new doc rendering styles (much prettier, but also much larger so the screenshots suffer from being able to present less material at once). Removed (most) coverage of the now deprecated value capture feature, added strike-through for one section just in case a replacement shows up, added notes in the section about arranging assistants. Added coverage of new build configuration tests, enhanced the playground rich text markup section, added info about literals and embedded videos. Chapter 7 lost content because of the introduction of live interaction. Sadly, live input also disabled things like drag-and-drop windows and pop-ups, so a lot of the cute utilities that playgrounds could do in Xcode 7.2 no longer work. Sandboxing means that many really useful OS X utilities (although not all) are now history.

Pearson Updates

As many of you know, I had been planning a Webcast series starting in a few weeks. Pearson’s downsizing has forced those to be cancelled.

Chris “Best Development Editor Ever” Zahn, my point person for the Content Update Program (CUP), has left Pearson as well to my great sadness. I’m assured that CUP isn’t going away and I’ll be meeting next week to try to push forward with it.