Swift Translation Guide

I was lucky enough to not only get selected to buy a ticket for the Apple Worldwide Developer Conference (WWDC) this year, but my employer graciously sponsored my trip to San Francisco. I felt extremely privileged to be present for the announcement of Swift; a new programming language created by Apple for the development of applications for OS X and iOS.

While in San Francisco, I took the opportunity to meet in person, for the first time, with Cliff Colby. Cliff is a publisher at Peachpit Press and I was lucky enough to work with him while co-writing the Mastering Xcode book. While at lunch he broached the subject of writing another book, this time about the newly announced Swift language. At first I was a bit daunted: writing a book about Xcode was one thing, but to write about an entire programming language (never mind a brand new language) was another.

We continued to bat the idea back and forth and eventually came to the conclusion that an extensive language guide was not to be our goal – after all, Apple had released the definitive book, for free, at WWDC – so we settled on the idea of producing a book that comprehensively takes existing Objective-C developers from an awareness of Swift to leveraging their existing UIKit and AppKit experience in the new language. The Swift Translation Guide for Objective-C Developers was born.

From August to November I wrote in what spare time my family and employers could grant me, and produced a book that I’m really proud of. It makes me very happy to say that it is now available to purchase and if you decide to do so, then I hope you enjoy it. For more information, purchase links, and sample code, please go to the official site for the book: swift-translation.guide.

In Defence of Mental Illness

So… Apple paid U2 a lot of money to give away a copy of their latest album. The reasoning behind this has been discussed at length across the Internet and I could only speculate as to why either party did it. So I won’t.

The bigger controversy is the fact that Apple put a copy of the album into the purchase history of every iTunes customer, which resulted in an automatic download of the album for many people. This also has been debated at length, and nobody really needs me to add another voice to the mix. So I won’t.

I was going to pass on this topic until I saw the following tweet written by Peter Cohen – a writer and managing editor at iMore, an Apple-centric news web site.

I personally objected to Peter using the term “mentally ill” in this context. I thought about how I should send a scathing response, which is hard to do effectively in 140 characters or less, criticising Peter for equating general “rage” with mental illness, but I figured it was just a poorly worded, throwaway comment that wasn’t worth getting annoyed about. So I didn’t.

Then I saw his article about the subject on iMore, “NSFW: Apple, U2 and looking a gift horse in the mouth”. While I don’t necessarily agree with his position on the whole subject, I once again was dismayed to see a reference to mental illness:

But the inordinate amount of actual anger directed at Apple and U2 over this is so disproportional to the actual event, I’ve started to wonder about the mental state of some of those complaining. It’s really been off the charts.

I’ve tried looking at it from Peter’s point of view, and I get that he has seen some people take this issue way too seriously. As with any broad cross-section of people, you can expect a wide spectrum of reactions, possibly ranging from ecstatic pleasure at receiving a free album by their favourite band of all time, to people who are – rightly or wrongly – angry, or raging, at what they see as a violation of their privacy.

Peter doesn’t get why people would be so angry. That’s fine. He wants to write about it. That’s fine also.

What’s not fine is conflating Internet rage (however extreme it may seem) with mental illness. It’s a cheap shot. It’s also quite disappointing given how much the tech industry has been pushing towards greater awareness of mental illness, and striving to reduce the stigma that has made it hard for people to seek help. Using a perception of mental instability to deride people you disagree with is not the way to bring mental health issues to the fore.

As someone who suffers from mental health issues, I felt I should say something about this, and do my part to not let people think it’s okay to equate rage with mental health problems. So I did.

Deluxe Upgrades in iTunes

This week, The Presets – one of my favourite bands – announced the imminent UK availability of the “Deluxe/Expanded” edition of their Pacifica album.

As a fan, one of the most infuriating aspects of the music industry is the Deluxe Version. Some deluxe editions are re-releases many years later and contain “features” such as remastered tracks, expanded liner notes, and extra material. Other special editions are re-releases that come mere months after the original, usually offering a bunch of extra tracks and little else. In the case of Pacifica, the deluxe edition comes twelve months after the initial release with a bunch of remixes.

I’m a compulsive music buyer, and I love to buy music by my favourite bands on the day they get released. An unfortunate side-effect of being a dedicated fan is that loyalty is not rewarded by the release of a deluxe edition. The dedicated fan gets what amounts to an inferior product, and an “opportunity” to buy much of the same material again. When it came to physical discs, buying the original CD again just to get a few extra tracks was simply not an option. So in the past, I just grumbled to myself and got on with it.

A Digital Upgrade

These days I buy music from iTunes, where tracks can be bought individually and albums can theoretically be upgraded. Re-releasing an album as a deluxe edition could be a case of adding a bunch of tracks to the existing album, and allowing previous purchasers to add the new material at an additional (but discounted!) cost. I’m not saying we should just get them for free, I just feel that we should get an opportunity to get the same tracklisting as a new purchaser, without having to pay double (or potentially more than double).

This is completely feasible in this day and age. In fact, when I view the new deluxe edition of Pacifica on iTunes it actually shows that I have purchased the original album tracks.

Pacifica Deluxe Edition on iTunes showing previously Purchased tracks

Unfortunately I can’t simply buy the additional material – the entire Deluxe Edition is marked as Album Only. Even if they could be purchased separately it would actually cost more to buy the additional 12 tracks at 79p each than to buy the Deluxe Edition as a whole.

What I Want

I’d like to make it clear that I don’t blame The Presets, and am only mentioning them specifically as they were an example that triggered this post. It happens with deluxe editions from many artists, and in my opinion this falls squarely at the feet of the record companies and Apple/iTunes.

The record companies like to put out deluxe editions to bolster sales and extract more money from previous purchasers. They did it with physical discs and they are continuing the practice into the digital download age as well.

Apple/iTunes should be making more of an effort to allow “upgrading” to a deluxe edition. iTunes already has the facility to allow a customer to buy a few individual tracks from an album, then “upgrade” to the full album for the difference in price. A deluxe upgrade price could be set and purchasers of the original album could be offered a nominal upgrade price rather than being fleeced for the entire album again.

If iTunes provided this facility, and/or record companies treated the fans with a little less contempt, then it’s likely to be a win for everyone. Superfans don’t feel like they are being fleeced, bands can release deluxe editions without feeling like they are taking advantage of their fans, and the music industry could probably make more money from many “upgrades” than from the lower number of fans who would re-buy the entire album.

Don’t Try to Diagnose Yourself

I’ve seen a lot of positive discussion in the developer community recently about depression and mental illness. People are standing up to say they have suffered from depression and that it is nothing to be ashamed of. This is good.

My only concern is that developers (being developers) have a tendency to try to fix things themselves. A developer spots a bug, spends a bit of time trying to root cause it, and then applies a fix. This is also good, in a development setting, but it’s not so good when dealing with what’s going on inside your own head.

If you’re feeling the symptoms of depression, then for your own sake talk to a friend or, better yet, go and see a professional. You might be a great developer but you are an amateur when it comes to understanding how your own brain works. If you try to internalize it you are more likely to do yourself more harm than good.

Mastering Xcode

After many months in the making, I’m pleased to be able to announce that the 2nd edition of Mastering Xcode is now available to purchase, and even more pleased to announce my involvement in the book as co-author.

Joshua Nozzi’s 1st edition was an invaluable reference for me as I started the process of transitioning to developing iOS and Mac software. The prospect of a 2nd edition was made even more exciting when Josh asked me to get involved in the production process. I initially came on as technical editor, but due to Josh’s other commitments I was fortunate to be asked to come on-board as a writer.

I’d done some technical writing in the past for UK magazines PC Plus and Linux Format, but this was the first time I’d ever been involved in the production of a book. The experience was challenging, and often time consuming, but ultimately very rewarding.

About the Book

Mastering Xcode is a guide to using Xcode from a first introduction to what I like to think of an “advanced intermediate” level. The first section is a gentle introduction to the environment. The second section is a ramp up to using the editor, workspaces, interface builder, the debugger and core data modeler to produce a simple “suite” of applications. The third section dives into more advanced topics such as the build system, debugging and profiling, as well as more detailed examinations of Xcode’s command line tools and SCM integrations.

While we couldn’t cover every facet of Xcode we have endeavoured to touch on as much as possible. We’re also acutely aware of the fact that this book is focussed on Xcode 4.6, which will likely be superseded by Xcode 5 later this year. We feel that much of the information in the book will still be relevant (even if it looks a little different). We’re also planning some “delta” material that will document what is new and what is changing – keep an eye on the book website for more information on that.

Saying Thank You

From a personal perspective, I’d like to thank Josh for giving me the opportunity to work on this book with him. He, and publisher Cliff Colby at Peachpit, let a cheeky individual finaigle his way into the process, and decided to take a chance on him. For that I’m exceptionally grateful.

I couldn’t have devoted the time needed to complete this project without the support of my wife and family. Whether it was giving up our evenings together, or taking the kids away to give me “writing weekends”, the efforts that they went to in order to help the process along was invaluable.

In the production process itself, our production editor Robyn Thomas was amazing. She guided us every step of the way, and gave re-assuring feedback when confidence was waning. From a technical perspective we have Mark Goody to thank. His eye for detail kept us on track and made sure we weren’t misleading the reader too much.

Getting the Book

If you are interested in getting a copy then please consider using one of the affiliate links below:

Peachpit Press: Print edition - Ebook edition

Amazon UK: Print edition - Kindle edition

Amazon US: Print edition - Kindle edition


Vesper is a new note-taking app from Q Branch, a company comprised of the engineering talents of Brent Simmons, the design talents of Dave Wiskus, and the directorial talents of John Gruber.

So far opinion seems to be divided – many Apple bloggers are hailing it as the greatest thing since sliced bread, whereas many of the regular developers that I know or follow on some form of social media are of the opinion that it is over-priced and under-featured in an already saturated market segment.

Much of my own opinion on the matter can be summarised by Dr. Drang’s take: “Form and Function”

Here’s a thought experiment: Imagine a new note-taking app written by an unknown developer. It’s has a nice, clean look and is easy to use, but it has no syncing, no TextExpander support, and no URL scheme. Assuming the app got any attention at all, how much effort would Apple bloggers put into defending that design choice? How often would the phrase “data silo” be used?

Personally, I’m a little jealous of the guys behind Q Branch. There, I’ve said it. As an iOS developer it smarts a little to see them get such acclaim for what is, by modern standards, a well designed but feature lacking app.

But what irks most is that this is symptomatic of much of what goes on in the Apple community these days. We have promoted certain individuals to the status of idols. We hang off their every word, we repeat their opinions in a parrot-like fashion, and we judge their work without the same level of criticism that we would apply to mere mortals.

We as a community need to stop this, otherwise we’re just the ‘fanbois’ we’ve always been derided for being.

iTunes (Not for) U

I can’t figure out how to play local iTunes U content on my iPhone - it just doesn’t appear on my device.

I like to download tutorial and training material (from sites like Railscasts, iDeveloper TV, PeepCode and Mijingo) and I’m one of these people who likes to hold onto the material just in case I ever need to watch it again. For convenience I dump it into iTunes on my Mac Mini that serves up content to a number of Apple TV and iOS devices. Because I’ve got a thing for organization, I like to mark the videos as being iTunes U material so that I can get to it easily through the Apple TV menus.

Sometimes I’m not using the Apple TV and I want to watch a quick tutorial on my iPhone. This happened the other night when I decided to watch a Railscast. So I opened up the iTunes U app on the iPhone. It gives me the option to get official material from the catalog, but doesn’t let me browse my local Home Sharing machine.

So I tried the Videos app - it does let you choose Shared libraries, but only displays the categories Movies, TV Shows, and Music Videos. No sign of iTunes U content.

In desperation I tried the Music (formerly iPod) app but it didn’t include the option for iTunes U content (and hasn’t since iTunes U was split off into its own app a while back).

This seemed weird - I couldn’t find a way to play iTunes U material stored on my local server. Strangely, when I picked up my iPad mini the Videos app there has a section for iTunes U material (and I was able to watch the Railscast absolutely fine - “panic” over).

Seems like quite an oversight that there is no way to carry out this (admittedly edge) use-case on an iPhone. Time for a Radar…

Mail.app and Power Nap

Mountain Lion has been with us for several months now and has been a pretty solid release with some nice new features. One of those features is Power Nap - the ability for a certain Macs to sleep with one eye open. It allows for the updating of data (fetching mail, contact updates, etc) and the performing of housekeeping tasks (carrying out backups and downloading software updates) while your Mac give sthe impression of being asleep.

I have a nice shiny 2012 MacBook Air so I’ve been getting these Power Nap features for free since upgrading to Mountain Lion. Generally I don’t notice it much - I have notifications from Messages already onscreen when I open my machine in the morning, software updates are quick to apply because they have already been downloaded and, most usefully, I can see new entries in my mailbox that arrived overnight.

So far, so good. There’s just one gripe with the way the mail messages arrive. I have an IMAP account that gets updated with new messages. But if I have viewed those messages on my iPhone/iPad or on another Mac, they don’t get marked as read via Power Nap. This seems like a minor inconvenience as the next refresh of the IMAP account should update their read/unread status.

Nope. Checking for new mail in all accounts doesn’t change the status. In fact, basic testing has shown that once woken from Power Nap I can’t even pick up new items in the IMAP mailbox. A restart of Mail.app is required before any updates to that mailbox are detected. It just seems to be the one IMAP account though - I have 3 other mail accounts (2 GMail and 1 iCloud) that update fine.

I guess it’s time to file a bug.

Netbot - the App.net Saviour?

On the latest episode of The Talk Show, host John Gruber commented with regard to App.net and the release of Netbot:

“It’s been a great little science experiment since Netbot came out about the importance of apps versus web clients”

Gruber, and his guest Brent Simmons, said a lot of sensible things in this discussion, but the implication here is that App.net was treading water prior to the release of Netbot because there were no native clients.

Many App.net users will be well aware that Netbot was not the first native iOS client to be unleashed. There were numerous native clients for iOS available prior to this (I personally used AppApp, Felix, Rhino and Rivr) so the native client requisite for success was already satisfied. The real reason why App.net usage took off after the release of Netbot was more likely due to a large volume of subscribers (existing and potential) who were too timid to truly embrace the platform until a big-name client was launched.

I’m glad that the release of Netbot for iOS gave a much needed boost to the App.net population and I hope we see a similar boost when Netbot for Mac is released. I’d also like to see some acknowledgement given to the original native clients who put in the hard yards in the early days. After all it was they who helped cultivate the existing population that made it viable for a bigger developer like Tapbots to invest in the platform.

Working With Drafts in Octopress

Having recently moved to an Octopress blog I’ve been revelling in the geekery of managing my posts from the command line. I was previously using MarsEdit to manage my posting to Tumblr, but that’s not as viable an option any more. This is a shame because I like MarsEdit and I especially liked the ability to work with local draft posts, something that Octopress (and the underlying Jekyll framework) does not natively provide.

Judging by a quick Google search on the subject I’m not the only person who has been thinking about this. Even the mighty Brett Terpstra recently posted to App.net saying that he’d implemented a rake draft option (among other goodies) that stores drafts to a _drafts folder. This seems to be an avenue that other people are going down but I’m not sure about the need for this separation.

Jekyll already offers the facility to mark a post as published using an attribute in the YAML front matter. When published: false is specified the post will not be output to the public folder as part of the rake generate task. It therefore will not be included in a deploy operation, which is exactly as we would expect, but makes it harder to see the draft posts in the context of the blog.

Interestingly though when using the rake watch or rake preview tasks, posts with an attribute of published: false are included in the generation of posts. When you point your browser to localhost:4000 (or via a Pow configuration) then you’ll see your unpublished posts included as though they were published. For me, this negates the need to create a dedicated drafts folder.

There are still failings with this approach: drafts are mixed in with published posts requiring file inspection to manually separate them, and the date given to the post (crucially updating both the YAML front matter and the filename) will be the creation date rather than the publishing date.

To facilitate this workflow I updated the Rakefile to include a few more default YAML attributes for a new post (defaulting published to false). Most importantly it includes a Rake task called publish_draft that lists all the posts with a published status of false and allows the user to select a post. The post can then be published using the current date (updating the YAML and the filename) or it can simply be published with the original date. You can find this Rake task in the Gist below - please take care as it has not been made 100% foolproof that this stage.