Archive for October 9, 2014

Thursday, October 9, 2014

To Swift and Back Again

Christoffer Lernö:

This article could have been about how we converted our current project to Swift, then eventually had to convert 15k lines of Swift back to Objective-C again. But it’s not going tell that story. – The main reasons are outlined in this article anyway: by Swift 1.0, compile times for a project like ours was exceeding a minute and for editing, Xcode 6.0 was thoroughly broken. With no known date when this would be fixed there wasn’t really much of a choice.

No, this article is going to talk the experience of taking the project to Swift and then back to Objective-C – what was better in Swift and what improved going back to Objective-C.


The worst part was working with dynamic data structures. This was simply not practical to do in Swift. The best way here turned out to be converting all the dynamic data to classes and structs.


Aside from that issue, Swift has traditionally been very inconsistent in how and when to inline code. Tiny changes can sometimes grant magnitudes of faster code in a quite unpredictable manner. Swift runtime performance is really a mixed bag. From C performance to something speeds that even Java 1.0.2 would be deeply ashamed of.

It’s not the speed itself that’s the problem, but rather the unpredictability. And yes, this will improve – but when will it be solid enough to rely on? Objective-C is not fastest, but it’s guaranteed to perform exactly the same no matter how the other library is linked.

iOS 8 “Reset All Settings” Bug Erases iCloud Drive Documents

Juli Clover:

The “Reset All Settings” option explicitly says that “No data or media will be deleted,” and it is meant to reset all user preferences to the default out-of-the-box settings. That the option is deleting iCloud Drive documents appears to be a serious bug, though it may be limited to Apple’s own iWork apps like Pages, Keynote, and Numbers. One user had all of his iWork documents wiped by using “Reset All Settings,” while other app information remained in iCloud.

In our own testing, using “Reset All Settings” deleted all iWork documents stored in iCloud Drive on the iPhone and on After allowing time for syncing to a Mac running OS X Yosemite, all of the documents disappeared from that machine as well. Preview and TextEdit documents, which cannot be accessed on the iPhone, remained untouched on the Mac.

iOS 8 Location Permissions and Notifications

Tim Schmitz:

Apps can only ask for one level of access, and can only ask once. Developers have to choose how much access to request. Once you’ve asked for “when in use” authorization, for example, you can’t ask again for “always” permissions. You also can’t display a dialog asking the user to choose between “Always,” “When in use,” or “Never.”


Apple’s solution to this problem is to let developers send users to the Settings app so that they can change the location permissions for your app. This feels like a classic “sweet solution.” It’s not a good experience to boot users out into the Settings app, even if it’s directly to the settings for your app’s location permissions. It breaks the user out of your UI, and there’s no obvious way to get back to your app after they’ve changed settings.

John Gales:

By far the most annoying change is a giant blue banner on the top of the screen when an app is using your location in the background. This banner can’t be dismissed and there isn’t a setting to have it not show. This sounds OK on paper (we want to prevent apps from tracking you without your knowledge), but in practice is insane. I know perfectly well that Google Maps is using my location, if it were not using my location I would be very interested as I will get lost as a result. It’s fine if you want to let me know this, but please give me a way to dismiss it.


The final sin is that this turd also appears when you’re not actually using another app at the same time as navigating. Simply closing Google Maps is enough to have the blue banner show up for about half a second. Even if you hadn’t navigated anywhere. This flash is enough to infuriate me.

Schrödinger’s Shift Key

Allen Pike:

When the shift key is on, it blends in with the letter keys. When it’s off, it blends in with the function keys. Neither state sticks out enough to read as active, especially in a split second.

This would only be moderately annoying, except that iOS suddenly engages the shift key in certain circumstances. It’s usually convenient, but if you need to type apike is my username, I am from B.C. and live in Vancouver it’s crazy-making and requires good feedback about what’s happening.

John Gruber:

Single most surprising thing about iOS 8 to me is that Apple didn’t fix this.

I concur.