Archive for September 20, 2017

Wednesday, September 20, 2017

Swift 4.0 Released

Ted Kremenek:

Swift 4 is now officially released! Swift 4 builds on the strengths of Swift 3, delivering greater robustness and stability, providing source code compatibility with Swift 3, making improvements to the standard library, and adding features like archival and serialization.


One advantage of these language modes is that you can start using the new Swift 4 compiler and migrate fully to Swift 4 at your own pace, taking advantage of new Swift 4 features, one module at a time.

I ended up updating all of my code at once, and it took less than an hour. This is by far the smoothest major Swift update so far.

Unfortunately, the tooling is still rough. Some of the new standard library methods don’t appear in the documentation (even searching with Dash), and Xcode’s “Jump to Definition” feature is inoperable much of the time, so the only way to actually see some of the new methods is via code completion. At least with Objective-C there is an actual header file I can open or search.

Mike Ash:

We’re not getting a radical rework of the syntax like we did last year, nor are we getting a breathtaking pile of new features like we did for Swift 2, but there are some nice additions you can use to improve your code. Let’s take a look!

Ole Begemann:

An Xcode playground showcasing the new features in Swift 4.0.

Chris Eidhof:

Swift 4 really helps to clean up many examples in Advanced Swift[…]

Previously: Swift.Codable, Swift 4: Key-Value Observation, Swift’s Error Handling Implementation, Swift 4: Bridging Peephole for “as” Casts, Swift 4: Synthesizing Equatable and Hashable Conformance, Swift 4: JSON With Encoder and Encodable, Swift 4 String Manifesto, Provide Custom Collections for Dictionary Keys and Values.

Update (2017-09-25): See also: Updating Strings For Swift 4.

Update (2017-10-04): Nate Cook:

In the latest release of Swift, dictionaries and sets gain a number of new methods and initializers that make common tasks easier than ever. Operations like grouping, filtering, and transforming values can now be performed in a single step, letting you write more expressive and efficient code.

This post explores these new transformations, using some grocery data for a market as an example.

Safari 11

Ricky Mondello:

Safari 11 on macOS blocks videos across the web from auto-playing. It gives you control over what sites are allowed to auto-play.

You can automatically use Safari Reader on some or all websites in Safari 11. Hold-tap or right click on the Reader button to turn this on.

Beyond auto-play and Reader, Safari 11 lets you customize other settings on a per-site basis, like use of content blockers and zoom level.

You can pick and choose which Reading List items are saved for offline reading in Safari 11 by swiping sideways on a Reading List item.

Safari on iOS 11 rationalizes the scrolling behavior between Safari, subframes in Safari, and apps. It feels really great.

iOS 11 revamps Safari View Controller with an appearance that looks more like an in-app browser. It feels more like an extension of an app.

Safari View Controller on iOS 11 also won’t surprise you by opening in Private Browsing while Safari is in Private Browsing. (Yay!)

Safari on iOS 11 will share the canonical link for a page, which can improve the experience of sharing a “mobile” website.

Safari 11 fixes an extensions memory handling issue that will make some websites (e.g. Google Docs) use much less memory.

iOS 11’s Password AutoFill for Apps makes it easier to log into apps using passwords saved in your iCloud Keychain.

If you need to look up a saved password on iOS 11, you can in the new Accounts & Passwords section of Settings. Or just search Settings.

Lots of good stuff here. I didn’t think Apple would ever embrace site-specific preferences, which I enjoyed many years ago in OmniWeb.

Unfortunately, since updating to Safari 11 I’m seeing a bug where opening links from other apps always switches to the Safari window in the leftmost space even if there’s one that’s open in the current space.

Previously: Safari’s Intelligent Tracking Prevention.

Update (2017-09-21): Jim Dalrymple:

Apple introduced a new technology to intelligently block browser cookies in Safari, which brought criticism from a number of advertising organizations. Apple believes in privacy with every product it makes, and the advertising groups want to track everything we do so they can sell ads.

Apple responded to that criticism this afternoon by fully explaining what they are doing for the consumer and standing up for themselves.

Ben Lovejoy:

What ITP means for consumers is that Safari will effectively forget which sites you’ve visited after a day. Net result: you’ll see fewer targeted ads, and more generic ones.


So personally, I want to allow third-party cookies to persist for the normal 30 days. But High Sierra won’t allow it. So despite strongly supporting the vast majority of Apple’s privacy initiatives, in this particular case, I think Apple has got it wrong.

See also: Hacker News.

Update (2017-09-22): Ricky Mondello:

Don’t know how I forgot this one! iOS 11: if a link opens in a new tab, you can swipe back to close it.

Update (2017-09-26): Juli Clover:

With the release of macOS High Sierra, Apple is now collecting data from the Safari browser using differential privacy technology, reports TechCrunch. Apple is aiming to gain information about browsing habits to help identify problematic websites that use excessive power or too much memory.

Update (2017-10-26): Kirk McElhearn:

A useful new feature in the latest version of Safari for macOS High Sierra is the ability to set permanent zoom for any website. If a site has fonts that are too small, or too large, you can change them, and ensure that every time you visit the site, the change will be remembered. Safari does this automatically, but you can control the zoom from the app’s preferences.

iOS 11: Control Center No Longer Turns Off Bluetooth and Wi-Fi

Joe Rossignol:

When you deep press on the system toggles pane, for example, a larger pane pops open with previously hidden AirDrop and Personal Hotspot controls.

On iOS 11, users can add, remove, and organize controls in Control Center through the Settings app.

Apple (via Joe Rossignol):

In iOS 11 and later, when you toggle the Wi-Fi or Bluetooth buttons in Control Center, your device will immediately disconnect from Wi-Fi and Bluetooth accessories. Both Wi-Fi and Bluetooth will continue to be available, so you can use these important features[…]


If you want to completely disable Wi-Fi and Bluetooth for all networks and devices, follow these steps:

  • To turn off Wi-Fi, go to Settings > Wi-Fi and turn off Wi-Fi.
  • To turn off Bluetooth, go to Settings > Bluetooth and turn off Bluetooth.

On the other hand, if you don’t turn them fully off they will eventually turn fully back on according to some non-obvious rules.

Nick Heer:

I kind of get why this change was made: a frequent barrier in my use of AirDrop “just working” is that a friend’s Bluetooth connection has been toggled off. I don’t think that most people would be fully aware that both networking services must be switched on for many of Apple’s “continuity” features to keep working.

The new behavior kind of makes sense, but it’s not very intuitive.

Update (2017-09-21): In some circumstances, you can use Airplane Mode as a substitute.

John Gruber:

Off the top of my head, I would suggest making them three-way switches: on and connected, on but disconnected, and off. I don’t have an idea for how to present that visually though. Or make on/off buttons available in the expanded menu you get when you 3D touch on these controls. UPDATE: DF reader Matthew Smith emailed to point out that these buttons already have three states: “In Control Center, when you tap the Wi-Fi or Bluetooth icon, it goes from blue to grey. If you tap the Airplane mode icon, both icons go grey, but also gain another indicator: A diagonal line through their icons. This is a good way to tell the difference between disconnected and off. So with the currently available indicators, these could easily become a 3-way switch.”

3-way switches were my first thought as well, but I presume Apple rejected this idea because most people would then actually turn Wi-Fi and Bluetooth off, thus undermining the point of the change.

See also: Hacker News.

Mike Ash:

I think the functionality makes a lot of sense. But it sure would have been nice to indicate what’s going on in the UI somehow. Maybe not reuse the familiar icons to indicate a new thing?

Update (2017-09-22): Rod Christiansen:

I really like the new behaviour. Most of the time I’m just am trying to get out of a shitty WiFi but I still want it turned on.

Another Control Center oddity: the Remote widget doesn’t work with the Apple TV 3, even though the AirPlay widget (and the full Remote app) do.

Update (2017-09-26): Glenn Fleishman:

Representing three states with an On/Off switch in Settings and Control Center’s multi-state button is not the crispest way to help users achieve their goals. Apple should redesign both areas[…]

Update (2017-11-21): Juli Clover:

In the new iOS 11.2 beta released this morning, Apple has added new informational pop-ups to let users know exactly how these toggles work. The new pop-ups explain that Bluetooth and Wi-Fi will be disabled temporarily rather than permanently.

Update (2018-05-19): Greg Hurrell:

Damn Apple. The whole “Turning Wi-Fi off until tomorrow” thing is a rotten lie. I turned it off at 7:30 AM this morning and I look now at 9 AM to see it’s back on again. Happens frequently.

Update (2019-04-28): Deb Chachra:

I an on a packed Acela, and despite having Bluetooth turned off, my phone keeps asking me if I want to connect people’s AirPods.

iPhone 8 Charging Speed

John Gruber:

I’ll go so far as to call the rinky-dink 5-watt charger the new 16 GB storage tier — a nickel-and-dime move whose time was up a few years ago. Oh, and one more nickel-and-dime move: Apple only includes a USB-A-to-Lightning cable in the box. The Google Pixel I bought last year included two cables, USB-A and USB-C. And Apple is the company selling laptops that only include USB-C ports.


The bottom line: it’s faster, yes, but not that much faster. I ran the iPhone 8 battery down until it powered off. I plugged it into the 29-watt charger, and got the following results: after 15 minutes it was back to 27 percent, at 30 minutes it was at 54 percent, and at 45 minutes it was at 72 percent. But then I did the same thing with my year-old iPhone 7. After 30 minutes it was at 43 percent, and at 45 minutes it was at 65 percent. (I didn’t pay attention to where it was at after 15 minutes.) The iPhone 8 does charge faster than an iPhone 7, but not by much.

Nilay Patel (via John Gruber):

Apple gave me one of the Mophie charging pads it’ll be selling in stores, and we tried it out on Qi pads from Samsung as well, and it all just worked.

Qi is pretty slow, though — Apple’s goal is to match the charging speed of its own 5W pack-in charger, but I only saw about 15 percent more charge on the 8 Plus every 30 minutes with the Mophie, which is especially pokey when you consider that you can’t pick up and use your phone during that time. A future iOS update will let the iPhone 8 draw more power out of the Mophie and Belkin pads Apple sells in stores, so hopefully things speed up when that happens.

Update (2017-10-10): John Gruber:

One conclusion from this is that Apple is cheaping out and should put a 10-watt iPad-style charger in the box with each iPhone. Another — suggested on Twitter by David Barnard — is that Apple ships the 5-watt charger with iPhones because it’s so much smaller, and although slower, is fast enough.

Face ID

Matthew Panzarino:

If there are 5 failed attempts to Face ID, it will default back to passcode. (Federighi has confirmed that this is what happened in the demo onstage when he was asked for a passcode — it tried to read the people setting the phones up on the podium.)

Developers do not have access to raw sensor data from the Face ID array. Instead, they’re given a depth map they can use for applications like the Snap face filters shown onstage. This can also be used in ARKit applications.


Face ID requires that it be able to see your eyes, nose and mouth. This means there are scenarios where it just won’t work.

“If you’re a surgeon or someone who wears a garment that covers your face, it’s not going to work,” says Federighi. “But if you’re wearing a helmet or scarf, it works quite well.”

David Sparks:

I think my favorite part was the disclosure that if you pick up your iPhone X and swipe from the bottom to the home screen, the iPhone will start the animation while it is simultaneously verifying your face and unlocking the device. There shouldn’t be any delay, which is exactly the behavior I would expect.

Before this, I was concerned that you would have to unlock before swiping into your home screen, which would drive me nuts every time I turn the phone on.

Bruce Schneier:

I am confident that Apple is not collecting a photo database, but not optimistic that it can’t be hacked with fake faces.

Troy Hunt:

There’s literally a saying that’s "one in a million" which symbolises the extremely remote likelihood of something happening! The 20x figure over Touch ID is significant but it doesn’t seem like the right number to be focusing on. The right number would be the one that illustrates not the likelihood of random people gaining access, but rather the likelihood of an adversary tricking the biometrics via artificial means such as the gummi bears and PCBs. But that’s not the sort of thing we’re going to know until people start attempting just that.

See also: The Talk Show.

Previously: iPhone X.

Update (2017-09-20): Jeff Nouwen:

Federighi: “But if you’re wearing a … scarf, it works quite well.” Might be my Great White North bias, but wearing a scarf means this[…]

Update (2017-09-28): See also: Apple’s Face ID Security Guide (Hacker News).