Archive for June 29, 2020

Monday, June 29, 2020

as, as?, and as! in Swift

Ole Begemann:

as? and as! perform downcasting at runtime.


as? and as! are the same operation, the only difference being that as! force-unwraps its result.


In contrast, as coerces a value to a type at compile time.


A syntactic nuance: when using as in pattern matching contexts, the check is performed at runtime (it has to be).


Git Tower 5

Julian Rothkamp:

Tower now lets you show or hide whitespace changes with a single click.


Tower not only displays diffs of new/untracked files, it even allows you to stage/unstage/discard parts of their changes - even though they are still untracked!


In our endless quest of making you more productive, the highlighting of inline changes will make it super convenient for you to spot changes at first glance.

Good stuff!


Developer Transition Kit Benchmarks

Mike Wuerthele (also: MacRumors):

This Mac mini is outfitted with Apple’s A12Z processor which was originally designed for the 2018 iPad Pro and then reused with the 2020 iPad Pro.


To get more specific on performance, let’s take a look at Geekbench 5 results. Right now, with Rosetta 2 translation of the benchmark suite, the developer kit with the A12Z Bionic pulls down a score of about 845 for the single-core benchmark and around 2960 for the multi-core tests.

To compare, in the Core i3 Mac mini, we saw Geekbench results of 949 for single-core tests and 3,197 for multi-core test. Benchmarks for the same A12Z Bionic in the iPad Pro put it at 1,118 points for single-core tests, and 4,625 for multi-core.

The DTK is probably a lower bound for the performance we’re likely to see with actual Apple Silicon Macs, so it’s encouraging that running x86 apps in Rosetta is faster than a 2012 iMac or Surface Pro X running native code.

Apple has, in recent years, allowed screenshots and discussions of prerelease OS versions, but the Universal App Quick Start agreement specifically says not to:

(d) display, demonstrate, video, photograph, make any drawings or renderings of, or take any images or measurements of or run any benchmark tests on the Developer Transition Kit (or allow anyone else to do any of the foregoing), unless separately authorized in writing by Apple;

(e) discuss, publicly write about, or post any reactions to or about the Developer Transition Kit (or Your use of the Developer Transition Kit), whether online, in print, in person, or on social media, unless separately authorized in writing by Apple;

My DTK is now in transit, so I’m planning not to write further on this topic.


The New York Times Pulls Out of Apple News

Kellen Browning and Jack Nicas (via MacRumors, 9to5Mac):

The Times is one of the first media organizations to pull out of Apple News. The Times, which has made adding new subscribers a key business goal, said Apple had given it little in the way of direct relationships with readers and little control over the business. It said it hoped to instead drive readers directly to its own website and mobile app so that it could “fund quality journalism.”

“Core to a healthy model between The Times and the platforms is a direct path for sending those readers back into our environments, where we control the presentation of our report, the relationships with our readers and the nature of our business rules,” Meredith Kopit Levien, chief operating officer, wrote in a memo to employees. “Our relationship with Apple News does not fit within these parameters.”

An Apple spokesman said that The Times “only offered Apple News a few stories a day,” […]

They never joined Apple News+, and their subscription business seems to be doing well.


Update (2020-07-03): Dave Winer:

Colin Nederkoorn reminds us that the NY Times, even though they’ve opted out of Apple News still has a full complement of RSS feeds. The feeds are perfect. A headline, a synopsis and a link to the paywall’d article.

How to Remove YouTube Tracking

Dries Buytaert (via John Gruber):

I learned that when I embed a YouTube video in my blog posts, Google sends an HTTP cookie to track my site’s visitors.


After some research, I discovered that YouTube offers a privacy-enhanced way of embedding videos. Instead of linking to, link to, and no data-collecting HTTP cookie will be sent. This is Google’s way of providing GDPR-compliant YouTube videos.

It makes his site faster, too. I always liked how the iCab browser would report whether a site was using valid HTML, but I’m not sure how influential it was because of the relatively low marketshare. Safari’s new Privacy Report will hopefully have a big impact.