Archive for September 20, 2016

Tuesday, September 20, 2016

Swift 3 Notes

Ted Kremenek (Hacker News):

Swift 3.0, the first major release of Swift since it was open-sourced, is now officially released! Swift 3 is a huge release containing major improvements and refinements to the core language and Standard Library, major additions to the Linux port of Swift, and the first official release of the Swift Package Manager.

It’s great that he links to all the enhancement proposals.

Ole Begemann:

This is an excerpt from the Strings chapter in Advanced Swift. Chris Eidhof and I are currently updating the book for Swift 3 (and improving it in the process). This section on strings was originally written by Airspeed Velocity for the first edition of the book, and Chris and myself updated it for the upcoming edition.

Ole Begemann:

Trick question: does a string in Swift 3 always contain its prefix?

Ole Begemann:

In Swift 2, ranges were closely connected to collections. A range’s element type had to be an index type, and ranges themselves were also collections. This model underwent significant changes in Swift 3 as part of the new collection indexing model. Because the old index protocols no longer exist, the only constraint on a range’s element type is now Comparable conformance. And since the range elements now can no longer advance themselves, it follows that Range can’t be a Collection anymore, at least not without additional constraints. As a matter of fact, the Range type in Swift 3 is closer in concept to what used to be called intervals in Swift 2.

Erica Sadun:

I am really happy with how SE-0094 turned out. I helped with the paperwork but it was all Kevin Ballard‘s brain child, putting together the two new sequence functions. If you haven’t been playing with these yet, they’re available in the latest developer snapshots (both the main trunk and the public branch) and they’re delightful.

Brent Simmons:

Note that the Objective-C name SomethingHappenedNotification becomes just .SomethingHappened in Swift, and it’s automatically a Notification.Name.

Nick O’Neill:

These are just some of the big items you’ll run into when looking at your diffs after running the Xcode automatic migration.

Matt Gallagher:

This article is my response to the question of the week: “how much work is involved in migrating to Swift 3?”


I really wish I could say anything in this article [Exponential time complexity in the Swift type checker] had changed but the compiler issues described all remain exactly as is.

Natasha Murashev:

So although the Swift 3.0 upgrade is very painful, it is also a good time to notice all those repetitive things in your code and refactor.

Erica Sadun:

Swift 3 is a major, breaking language change. Are you ready to make the jump? Let “Swift from Two to Three” help you along the way. From migrating your code, updating your style, and adopting new Swift features, this book ushers you into the newly refreshed language. Learn what changed, why it changed, and how you can update your code using this hands-on guide that covers all the major difference with plenty of examples and insight.

There’s a Reddit thread about people’s experiences updating.

Update (2016-09-28): Keith Harrison:

Swift 3 has brought us some interesting access control changes. The differences between open and public or private and fileprivate take some getting used to. Luckily unless you are writing a framework the new rules are simple. Here is what you need to know.


John Gruber:

The problem with Bluetooth isn’t Apple. The problem is Bluetooth. It sucks. There is no open standard for wireless audio that doesn’t suck. “Open” had its chance, and they blew it.

Josh Centers:

The proprietary W1 chip brings several advantages: up to 5 hours of battery life, support for various sensors, purportedly superior audio quality, and most important, easy connections. You’ll be able to pair a W1 device merely by placing it close to an iOS device. Once connected, settings are synced to an Apple Watch, if you have one, and over iCloud to any of your other Apple devices (although Apple didn’t mention the Apple TV). You can simultaneously connect to your iOS devices, Macs, and Apple Watches and, according to Apple, switch seamlessly between them.


TidBITS Security Editor Rich Mogull was on site at the Apple announcement and had a chance to try the new AirPods. He verified that they fit similarly to EarPods, so if you dislike that fit, don’t waste your money on the AirPods. However, Rich said that they’re overall more comfortable, because there’s no cable drag. Even so, he wasn’t sure that he would use them for running.

John Gruber:

Latency is noticeably better listening to say, keyboard clicks, than with my Beats Powerbeats 2. But it’s still noticeable.

Kirk McElhearn:

No, the real problem is the fact that they’ll be so easy to lose. I can’t understand why Apple would release a product like this.

John Gruber:

I don’t mind Apple’s wired ear buds, but the AirPods feel better and fit better.

Jason Snell:

I think they’re going to be an extremely successful product, and more than that, I think they’re going to create an avalanche of competitors that try to match or beat Apple at their game. This is a product that really does feel magical, in old-school Apple style. It’s a thoughtful application of a bunch of different technologies, largely learned by spending a decade building miniaturized components for smartphones. Apple wasn’t the first company to create this sort of product—Bragi has been there for a little while—but it’ll be the one to popularize them.


Without a cable, there’s no clicker to play or pause your music, but if you pull one of the AirPods out of your ear, the iPhone pauses automatically—a cue that you’re removing an earbud because you want to hear something in the real world, or are talking to someone. Pop the AirPod back in and the audio begins to play. Take both of the AirPods out and the iPhone switches its audio output back to its own speakers.

Riccardo Mori:

From a user interaction standpoint, I’m not sure that a double tap on the AirPods to activate Siri is such a good idea, unless they can register very light taps. To me, that’s just an invitation to make an earbud drop.

Christina Warren:

I do wish there was some gesture support on the devices for stuff like skip or pause because those are functions I use on my wired headphones ALL THE TIME. Talking is cool but sometimes you just want immediate feedback you can only get from physical contact. Also, it’s just weird to be the person in public who appears to be shouting orders to their imaginary friends.

AirPods aren’t noise canceling, but in my brief experience in a bustling scene, they did a nice job blocking out sound. On a similar note, the microphone is tuned so that when you’re talking, it filters outside noise and just hears your voice. I had no trouble talking to Siri, even in a crowd.


Let me put it this way: AirPods sound way better than wired EarPods. I know that isn’t saying much, but it’s worth noting when you consider that the design is very, very similar.

John Gruber:

I love AirPods. They’re so good, so clever, so well-designed, and such a pleasure to use that they deserve their own standalone review. They’re not cheap at $159, but they make the $199 Beats Powerbeats2 wireless headphones I bought last year look like a joke.

Ruffin Bailey:

No, the AirPods are an interface. They are your Star Trek communicators. You tap, you get Siri, you ask whatever [Apple] device is near you to do what you need. They’re commoditizing device access.


You, untethered from any one specific device, with a wealth of ways to access any of them. And as that interface gets less and less substantial, it will gradually fade until it converges with what we now think of as augmented reality. That’s what device integration (that is, having Apple provide all of your devices) buys us, and it’s impressive seeing how what, on their face, are such minor advances (“Hey, Apple’s made Bluetooth headphones!”), really are just small pieces on a much, much larger chess board.

I remain very excited to try the AirPods, although since I don’t have an Apple Watch I really wish they had controls—other than Siri, which is cumbersome and I assume requires a network connection. Still, I think they’re going to be a hit.

Previously: iPhone 7.

Update (2016-09-24): Accidental Tech Podcast reports that there is a preference to make the double-tap play/pause rather than invoking Siri.

Update (2016-09-30): Mark Sullivan:

Veteran Apple engineer Bill Atkinson—known for being a key designer of early Apple UIs and the inventor of MacPaint, QuickDraw, and HyperCard—saw this coming a long time ago. He gave a presentation at MacWorld Expo back in 2011 in which he explains exactly why the ear is the best place for Siri.

John Gruber:

Not 12 percent of iPhone owners. 12 percent of consumers. For a product that Apple has merely announced, but not yet even started advertising. That’s huge. It’s just a survey, so take it with a grain of salt, but anecdotally, I get stopped almost every day here in Philadelphia by people asking if my review unit AirPods are in fact AirPods.

Update (2016-10-03): Mayur Dhaka:

Tap-and-hold wouldn’t work because the Airpods don’t actually detect a tap the way the iPhone’s screen does. It’s accelerometer picks up on the tap-tap movement to trigger Siri. Surely tap-hold could be implemented, but I doubt it would be as accurate.

The root problem is that Apple didn’t want to have any buttons.

Update (2016-10-11): Federico Viticci:

Not only are Apple’s claims accurate, I think they’re downplaying the magic going on inside their W1-powered headphones.

Update (2016-10-29): Juli Clover (Hacker News):

Apple today told TechCrunch that it needs “a little more time” before the AirPods are ready for a public release, without specifying the reason behind the delay.

Apple did not provide TechCrunch with updated launch information, so it is no longer clear when the AirPods will be available for purchase.

Update (2016-11-17): Rene Ritchie:

I’ve taken them walking, jogging, driving, even a little dancing — my living room, my business! — and they’ve stayed in fine. I’ve been out in the rain, the sleet, and really strong wind. I’ve only had them fall out twice: When I tried whipping my head around to see if they’d fall in, and when I tried some Brazilian Jiu-Jitsu drills at Serenity Caldwell’s urging. Both created enough force that, when I hit at the right angle, the AirPods came loose.

Even so, this exceeded both my expectations and my past experience with wired EarPods.


Because the AirPods offer beam-forming mics that engage when they detect your jaw movement, you can speak very softly — not quite sub-vocally, but close — and still get Siri to understand and trigger commands. In my tests, they do a great job isolating your voice. I’ve used Siri in the car, around the house, on the streets, and in relatively noisy hotels and bars with no problem.


The easy pairing and switching really do make a difference too. With other Bluetooth headphones, I’d swap pairings every once and a while, but mostly stopped because of the hassle. With AirPods, Apple TV is still a hassle, because it pairs like standard Bluetooth, but everything else is a dream.


I bought some PowerBeats 3s specifically to wear with my AppleWatch 2 while running, and I've been pretty disappointed, specifically because of how poor the pairing "magic" is. Sound quality is fine, comfort is good, battery life is ridiculous, I don't care about brand, and cost is quite frankly not a concern to me. I chose them entirely based on what I thought would be least hassle pairing with the W1 chip.

Where it fails so hard is its inability to recognize that I want to play music from the watch to the headphones. It literally takes minutes, not seconds, but MINUTES, every time, to start up my music prior to starting my run.

Update (2016-12-09): Rene Ritchie:

Apple’s new AirPods would be the ultimate stocking stuffer — IF THEY WERE SHIPPING. But they’re not. That means everyone I wanted to gift them too will have to wait. Even if Apple announces them now, they may not arrive in time, so I decided to take matters into my own hands and give out IOUs in the form of cards.

Joe Rossignol quoting the Wall Street Journal:

A person familiar with the development of the AirPod said the trouble appears to stem from Apple’s effort to chart a new path for wireless headphones. In most other wireless headphones, only one earpiece receives a signal from the phone via wireless Bluetooth technology; it then transmits the signal to the other earpiece.

Apple has said AirPod earpieces each receive independent signals from an iPhone, Mac or other Apple device. But Apple must ensure that both earpieces receive audio at the same time to avoid distortion, the person familiar with their development said. That person said Apple also must resolve what happens when a user loses one of the earpieces or the battery dies.

Update (2016-12-10): Nick Heer:

What’s more curious to me about the AirPods is that this issue isn’t something I saw reported in any of the early reviews published back in September. That’s not to say that the reviewers were lying, but if this is the reason for the AirPods’ delay, it must happen regularly enough that Apple wasn’t happy with it.

John Gruber:

“More difficult to manufacture at scale than expected” is also what I’ve heard through the grapevine, from a little birdie who knows someone on the AirPods engineering team. Things like what happens when you lose one or the battery dies — Apple solved those problems during development.

Update (2016-12-13): Apple is now taking order for AirPods. Mine are promised to arrive by December 21.

iPhone 7 Notes

Matthew Panzarino:

Every time you take a picture with the iPhone 7, both the wide angle and telephoto fire off. Yes, two 12 megapixel pictures for every shot. This could be a prime driver behind the increase of the iPhone 7 Plus’ memory to 3GB.

Both images are needed due to an Apple technique it is calling “fusion” internally. Fusion takes data from both sensors and merges them into the best possible picture for every condition. If, for instance, there is a low-light scene that has some dark areas, the image-processing chip could choose to pick up some image data (pixels or other stuff like luminance) from the brighter f1.8 wide angle and mix it in with the data from the f2.8 telephoto, creating a composite image on the fly without any input from the user. This fusion technique is available to every shot coming from the camera, which means that the iPhone 7 Plus is mixing and matching data every time that trigger is tapped.

John Gruber:

In my testing I didn’t see any noticeable difference between 1× shots on the iPhone 7 and 7 Plus. I think this “fusion” stuff only kicks in, or at least mostly kicks in, once you start increasing the zoom level. Put another way, I think the wide angle lens assists the telephoto lens more than the telephoto lens assists the wide angle.

Riccardo Mori:

Of all the new camera improvements in the iPhone 7 and 7 Plus — as ingenious as the dual camera system is on the bigger iPhone — my favourite is the flicker sensor. As Schiller explained, The flicker sensor reads the flickering of artificial lighting and can compensate for it in the photos and videos you take. I take a lot of indoor photos, and the flickering can be very annoying, especially when you want to include the source of artificial light in the frame. If this works as advertised, indoor photos and videos taken under artificial light will definitely look better, probably with more natural tones.

John Gruber:

Here’s the genius of the black and (especially) jet black iPhones 7. In a very seductive way, they look like something new and desirable. And at the same time, they are instantly recognizable as iPhones.

John Gruber (Hacker News):

After just five days — more than half of which I’ve spent using the matte black iPhone 7 Plus — this jet black iPhone 7 has a few “micro abrasions”, to use Apple’s own term. I can only see them when I’m looking for them, and only when I reflect light off the surface at the perfect angle, but they’re there. This is after two days of careful use, and never putting it in a pocket that contains anything else. The back surface of this phone shows more wear after (effectively) two days of use than my space gray 6S does after nearly a year.

That said, the unblemished back of the 6S looks downright boring. The jet black back of this iPhone 7 looks glorious.


The iPhone 7 now has OIS, for both stills and video. It works great. Side-by-side with my old iPhone 6S, I got noticeably better photos at an outdoor family gathering at dusk. I got noticeably better photos shooting indoors at night. And video shot while walking around is noticeably more stable and fluid. OIS does exactly what it says on the tin.


The new home buttons don’t feel like actual button clicks at all. It feels like the iPhone is clicking, not the button.


The new Taptic Engine is cool. Here’s my favorite use so far: the spinner control for things like picking a date or time (say, setting an alarm in the Clock app) now feels like a real spinner. It’s uncanny. I can’t wait to see how developers use these APIs.

Jason Snell:

I found that the Jet Black model indeed felt much more grippable than other iPhone 7 or iPhone 6 colors. Imagine placing a slightly damp finger on an iPhone screen, and how much harder it is to swipe your damp finger along that screen. That’s what’s going on with the Jet Black phone: even a little dampness on your fingers will cause them to skid along the surface, while it might slide right over the rougher anodized aluminum surfaces of the other colors.


I wouldn’t recommend you start using the iPhone for underwater photography—and Apple cautions that water invasion can void your warranty. But if you should get an iPhone 7 a little wet, everything will be okay.


When I first felt the new home button, I was really disappointed. The vibration felt halfhearted, and it made the act of pushing the home button feel like a letdown. I shouldn’t have worried: Apple actually offers three different levels of vibration in the new Home Button entry in the Settings app. And the most aggressive of those three levels worked great for me. No, the feel’s not the same as the old moving home button, but I managed to get used to it after about three button presses.

David Pogue:

When your phone is locked up, you can no longer hold down the Sleep + Home buttons to force-restart it. Instead, you’re now supposed to use Sleep + Volume Down, just as on many Android phones.

Gus Lubin (via Mike Rundle):

There’s an old rumor that iPhone home buttons break easily, and it’s causing millions of people to use an obscure accessibility feature called AssistiveTouch to avoid pressing them.

Juli Clover:

iPhone 7 and 7 Plus users are going to have a tough time unlocking their devices during wintertime. As it turns out, the new “solid-state” Home button on the iPhone 7 and iPhone 7 Plus requires skin contact or the right kind of capacitive gloves to function. […] And because the iPhone 7 uses the redesigned Lock screen in iOS 10, there's no quick and easy way to bring up the passcode entry screen to unlock the phone manually[…]

Raymond M. Soneira (via Craig Hockenberry):

The display on the iPhone 7 is a Truly Impressive Top Performing Display and a major upgrade and enhancement to the display on the iPhone 6. It is by far the best performing mobile LCD display that we have ever tested, and it breaks many display performance records.

Paul Miller and Dieter Bohn:

As pictured above, you can see a piece of plastic sits behind the ingress protection (waterproofing!), right where the headphone jack would have been. And (update!) according to Apple it’s a “barometric vent.” Apparently adding all the waterproofing to the iPhone 7 and 7 Plus meant that it was more of a sealed box, and so to be able to have an accurate and working barometer, Apple used that space. The barometer is the thing that allows a phone to measure altitude, and Apple points out that on the iPhone 7 it can measure even minor changes like climbing a flight of stairs.

Juli Clover:

IPx7, the water resistance rating, means the iPhone 7 can withstand immersion in water to one meter (3.3 feet) for 30 minutes, tested in laboratory conditions. IPx7 is the second-highest rating, below IP8, which indicates an ability to withstand long periods of immersion under pressure. Samsung's devices, by the way, are rated at IP68, suggesting better overall water resistance.

Apple has said that removing the headphone jack helped Apple meet IP67, however Samsung’s IP68 Galaxy S7 does have a headphone jack.

Chipworks (MacRumors):

We have revised our first A10 floorplan with help from our friends at AnandTech in the search for the small, high-efficiency cores. Our combined guess is that it is likely they are indeed integrated within the CPU cluster next to the big, high-performance cores. This makes sense given the the distinct colour of the small cores indicating a different digital library, and the position of the big core L1.

John Gruber (MacRumors):

Looking at Geekbench’s results browser for Android devices, there are a handful of phones in shouting distance of the iPhone 7 for multi-core performance, but Apple’s A10 Fusion scores double on single-core. […] The iPhone 7 scores better on both single- and multi-core than most MacBook Airs ever made, and performs comparably to a 2013 MacBook Pro.

John Gruber:

The iPhone has all the benefits (in short: superior design) that would keep me, and I think most other iPhone users, on the platform even if it didn’t have a performance advantage. But it does have a significant performance advantage, and it is exclusive to Apple. This is an extraordinary situation, historically. And year-over-year, it looks like Apple’s lead is growing, not shrinking. It’s not a fluke, but a sustained advantage.

Mark Sullivan:

Why? For a long time iPhones were one-size-fits-all-networks phones, but the iPhone 7 and iPhone 7 Plus each come in two different versions (or SKUs, in industry-speak), one with an Intel modem chip inside and one with a Qualcomm modem. The Intel 7630 modem doesn’t work with Sprint’s and Verizon’s 3G CDMA networks, so all Sprint and Verizon customers will get an iPhone 7 with a Qualcomm chip inside. For everyone else, the iPhone 7 could have either an Intel or a Qualcomm modem.


The end game for Apple may be to work with Intel to co-design a future system on a chip (SoC) that includes the modem, Apple Ax CPU, GPU, and many other components on one chip. This unified design can reduce the space the chips take up inside the phone, reduce the heat they emit, and reduce the power they require. The whole thing may be fabricated at Intel fabrication facilities.

AppleInsider (MacRumors):

In most cases, users claim the EarPods’ volume and call answer/end buttons become unresponsive after a few minutes of inactivity. Audio continues to play, and the microphone remains active, but users are unable to adjust volume settings, start or stop calls, or invoke Siri with the embedded remote.

Mitchel Broussard:

On the MacRumors forums, mentions of a “buzzing” and “static” sound coming from the back of the iPhone 7 and iPhone 7 Plus began on Friday afternoon. […] As pointed out by The Verge, the consensus of the noise’s origin online is that it’s caused by a phenomenon known as “coil noise.”

Oscar Raymundo:

So, you’ve unboxed your brand-new iPhone 7 or 7 Plus. It’s all set up, and it still has that fresh, new iPhone smell. Then, you hear a weird hissing noise. Or realize that the Home button or the Lightning EarPods are acting funky. Or your iPhone 7 is just not connecting to the cellular network. Yikes!

Yes, those are actual glitches that have already been reported by iPhone 7 users. If you’re experiencing a similar technical issue with your new device, take a deep breath and check out some possible solutions below.

David Steele:

Let’s take a look at seven features that Apple are belatedly bringing to the market and then consider why this is a good thing.

See also: more reviews.

Previously: iPhone 7.

Update (2016-09-24): James Thomson:

The lightning headphone adaptor sucks - walking about town listening to podcasts, it went dead 4-5 times and I needed to unplug / replug.

Yes, this was on 10.0.2, and I was actively listening to stuff and the audio just stopped.

Serenity Caldwell:

My general takeaway from the week’s misadventure is this: You can probably use your iPhone in the shower, at the beach, or wash debris off its screen under the faucet with no ill effects. But when you completely submerge it, you’re putting stress on every water-resistance gasket in the phone — and if just one of those gaskets fail, you’re looking at an Apple Store visit and a costly to very costly repair.