Archive for October 19, 2015

Monday, October 19, 2015 [Tweets] [Favorites]

Options Dictionaries vs. Sets of Enums

Erica Sadun:

In Swift, you can re-architect this key-based system into a simple enumeration, specifying the valid type associated with each key case. Here’s what this looks like for the five cases listed above. The associated types are pulled from the existing pixel buffer attribute key docs.

enum CVPixelBufferOptions {
 case CGImageCompatibility(Bool)
 case CGBitmapContextCompatibility(Bool)
 case ExtendedPixelsRight(Int)
 case ExtendedPixelsBottom(Int)
 case PixelFormatTypes([PixelFormatType])
 // ... etc ...
}

Re-designing options this way produces an extensible enumeration with strict value typing for each possible case. This approach offers you a major type safety victory compared to weak dictionary typing.

However, a limitation is that currently you have to use an array of options rather than a set (unless you want to make the options hashable yourself).

Big iWork Update

Juli Clover:

There are also new Force Touch gestures in each of the apps, which work with the new Force Touch Magic Trackpad and the trackpad in the Retina MacBook Pro and the 12-inch MacBook. In all three of the apps, a Force click on an image will allow them to be edited, and this Force gesture has built-in haptic feedback.

Keynote and Pages have gained support for opening presentations and documents from 2006 and 2008 versions of the software, while Numbers is now able to open Numbers ’08 spreadsheets.

Zac Hall has a list of the features and other changes. Apple has an even more extensive list, although I don’t expect the URL to last long.

David Sparks:

Some of these updates are simple fixes for new features in the hardware and operating systems, like the ability to use split screen mode on the Mac or 3-D Touch on the new iPhone, but other bits show continuing development. For instance, Pages for the Mac got some improved AppleScript tools and added several new Apple designed templates.

John Gruber:

Pages for Mac is thus once again as OpenType-capable as Pages ’08 was. Or, you know, TextEdit.

Nick Heer:

It remains impossible to add mirrored page numbers, though.

I wonder whether anyone is keeping track of where the apps are relative to the ’09 versions. Are all the missing features back? If not, it might be best to keep the old versions of the apps installed, despite the improved support for the old file formats.

Update (2015-10-20): Bill Cheeseman notes via e-mail that the Bookmarks feature for making internal links within a document isn’t back yet. If I open a document with bookmarks in Pages 5.6, it presents a Warnings window that says “This Pages document may look different.”

Tesla’s OS 7 Interface Update

Luke Wroblewski:

Tesla goes flat.

Corbin Dunn:

However, even more important are the analog gauges indicating your speed and power. At a quick glance you can instantly see your speed by looking at the blue line on the left. You can quickly see if you are speeding; the blue line turns to a white line once you past the known speed limit. The known speed limit is a beautifully thought out small white line. Now, with the new user interface you are forced to read the digital speed number, and mentally interpret it. You then have read the digital speed limit sign, and think if you are higher or lower than this number to know if you are speeding. The old interface was even step better; it would flip the battery meter over and show you the speed limit at you once you pass through it. This subtle animation draws your eyes attention to it subtly alerting you to the fact that you are speeding.

[…]

The new [power] gauge is much more difficult to read, and I’m not looking forward to my next long distance trip. And where are the yellow dashed limiters that we used to see on cold days?

The layout of the dashboard and controls is one of the most important parts of a car. The idea that this would change—regress—after purchase is frightening.

El Capitan License in Plain English

Robb Shecter:

I thought it’d be a “fun” project to see what the “El Capitan License” actually says. Cool idea, huh? Kind of like spelunking through a cave that everyone says they’ve been through, but maybe no one really has. What will I find wedged in a wall or lurking in the dark around the next turn?

  1. I can’t use the Capitan with illegal copies of anyone’s stuff.
  2. Apple didn’t sell me this software. They still own it, in fact. I’m just borrowing it.
  3. If I install more Apple software, those are on loan as well.
  4. I can use the Capitan in two virtual Machines, and on one computer.
  5. But these VM’s cannot be used for business. The only exception is for software developers […]

Update (2015-10-26): Cory Doctorow:

The Justice Department lawyers argue that because Apple licenses its software -- as opposed to selling it outright -- that it is appropriate for the government to demand that Apple provide assistance in its legal cases.

Adding “Save PDF to iBooks” Support

David Gelphman:

The only substantive change needed to make the sample app use the share sheet is to take out the use of the UIPrintInteractionController from the sample and replaced it with the use of a UIActivityViewController. This controller takes an array of “Activity Items” as part of its initialization. When the controller is presented it determines what activities (or actions) can be taken on those activity items and allows the user to choose from those actions.

[…]

If you’ve already got printing working in your app, now’s the time to update to using the Share Sheet method instead of the older method. Without a lot of extra work on your part, users get a great new option to save your application’s content in a print ready format. And if you’ve not added printing to your application to date, the “Save PDF to iBooks” feature provides yet another reason to do so.