Archive for September 22, 2017

Friday, September 22, 2017

Swift Proposal: Non-Exhaustive Enums

Jordan Rose:

Currently, adding a new case to an enum is a source-breaking change, which is very inconvenient for library authors. This proposal aims to distinguish between enums that are exhaustive (meaning they will never get any new cases) and those that are non-exhaustive, and to ensure that clients handle any future cases when dealing with the latter. This change only affects clients from outside the original module.


Public enums can be declared as exhaustive or as nonexhaustive. In Swift 4 mode, the default behavior will be exhaustive for source compatibility; in Swift 5 it will be nonexhaustive.

When a client tries to switch over a nonexhaustive enum, they must include a default case unless the enum is declared in the same module as the switch. In Swift 4 mode, omitting this case will result in a warning; in Swift 5, it will be an error.

Enums imported from C will be nonexhaustive by default, with a new C-side annotation to make them exhaustive. These enums conservatively always have the “cross-module” behavior.

Update (2017-12-20): See SE-0192.

iPhone 8 and iPhone X Cameras

DxOMark (via Phil Schiller, Hacker News):

The Apple iPhone 8 Plus is the best-performing mobile device camera we have ever tested. Its overall DxOMark Mobile score of 94 sets a new record, beating out the 90 points for both the Google Pixel and the HTC U11, as well as the 92 that its sibling iPhone 8 just scored. Its Photo score of 96 is also a new record, blowing past the Pixel’s 90. For Video, its score of 89 is among our highest, but tied with the HTC U11 and slightly below the Pixel’s 91. Of course, the Pixel is nearly a year old now, so it makes sense that Apple’s new flagship is breaking new ground.


In this case, DXOMark magically added a metric (bokeh and zoom) just one week after the iPhone 8 review. Of course this is a good plus for Apple. Before iPhones were behind Google Pixel, behind HTC U11, Samsung S8+. They were not in the top 10. Now magically, they get to be on top. I wouldn’t be surprised if there wasn’t a discussion or collaboration between doxmark and apple to review their metrics to have iPhone 8 and X under the best light possible.


On the other hand the iPhone 7 Plus was never reviewed while the Plus models always tended to be about 3-4 points better than the regular sized iPhones. But this was around the launch of the Google Pixel where they quoted (so I assume they paid) the DXO score to show how much better it was than the iPhone.


Comparing their subscores it’s obvious that without the new zoom and bokeh categories the Pixel would have stayed on top.

Regardless, the photos are impressive.

John Paczkowski:

This year’s leap, however, feels particularly meaningful. A number of early reviews of the iPhone 8 obsess over the camera — TechCrunch, for example, chose to review the phone exclusively as a camera. And there’s a decent argument to be made that the enhancements to the camera systems in the 8 Plus and the X are some of the biggest upgrades in the new line. The camera’s effects don’t rely on filters. They’re the result of Apple’s new dual camera system working in concert with machine learning to sense a scene, map it for depth, and then change lighting contours over the subject. It’s all done in real time, and you can even preview the results thanks to the company’s enormously powerful new A11 Bionic chip. The result, when applied to Apple scale, has the power to be transformative for modern photography, with millions of amateur shots suddenly professionalized. In many ways it’s the fullest realization of the democratization of high-quality imagery that the company has been working toward since the iPhone 4.


It’s worth noting that Apple has been working towards this in ways that are far less flashy than Portrait Lighting. The cameras on the 8 Plus and the X, for example, detect snow as a situation and automatically make adjustments to white balance, exposure, and whatnot so you don’t need to worry about it. “It’s all seamless; the camera just does what it needs to,” says Schiller. “The software knows how to take care of it for you. There are no settings.”

Austin Mann (Hacker News):

Almost no one is talking about it, but this year we got Slow Sync for the flash, and it’s actually pretty cool. Traditional photographers are already familiar with this, but for those of you who aren’t, basically Slow Sync is keeping the shutter open a bit longer to allow more natural light in when shooting with a flash. As a result, the image isn’t only lit by the light provided by the flash, but instead is balanced with the ambient light of the environment which creates a more balanced, natural shot.

See also: Stephen Su’s discussion of the original iPhone’s camera (via Bob Burrough).

Previously: iPhone 8 Reviews.

Update (2017-09-23): John Gruber:

Particularly with their “overall” score, DXO is pretending to assign an objective scientific-looking measurement to something that is inherently subjective. It’s horseshit, but everyone in the media falls for it. I said it was horseshit last year when they named a Pixel their “highest rated ever”, and I say it’s bullshit now when they said that about an iPhone.

Nick Heer:

Now, I don’t think there was any collusion with Google or any nonsense like that. There are some people who believe that DxOMark’s updated protocol conveniently aligns with Apple’s camera priorities and I, too, don’t believe that there’s any favouritism going on there either — their updated test suite is simply reflecting the changing reality of these products. But I think that DxOMark somewhat soiled their credibility with such an enormous lag in testing the 7 Plus, without great reason to do so.

Update (2017-10-04): Tim Hardwick:

Samsung’s Galaxy Note 8 produces generally better results than the iPhone 8 Plus when shooting still photography, but falls short of Apple’s handset when it comes to recording video. That’s according to the latest comprehensive smartphone camera test conducted by Dxo Labs, in which the two phones essentially came out tied overall.

Update (2017-10-23): Mark Spoonauer (via John Gruber):

The iPhone 8 Plus and Google Pixel 2 represent the pinnacle of camera phones right now. But which one is best? We put both of these sharpshooters to the test, comparing them head to head in all sorts of conditions. Apple’s camera came out on top, but Google’s won some key rounds.

Update (2017-11-15): Philip Greenspun:

Compared to the Huawei Mate 10, which scored the same overall, the iPhone X has much better “zoom” (switching from the wide to the normal perspective camera?) and much worse autofocus (not great for parents of the young and restless).


My take-away is surprise that the competition is so close. Apple has a vast advantage in money and engineering resources, yet they cannot beat Huawei or HTC and LG (the builders of the Pixel 2 and 2 XL, respectively). There is no getting around the physics when the case is that slim and therefore it is impossible to use a real sensor and real lens? Stuffing four more cameras in there and using them in parallel (see the Light L16) won’t help?

iTunes Rentals Increase From 24 to 48 Hours

Apple (via Jon Maddox):

You have 30 days to start watching a movie after you rent it. After you start watching the movie, you have 48 hours to finish it. You can watch the movie as often as you like until it expires.

This makes a lot of sense, as we often have trouble watching a movie in one sitting.

3D Touch App Switcher to Return

Craig Federighi (via Quinn Nelson):

We regretfully had to temporarily drop support for this gesture due to a technical constraint. We will be bringing it back in an upcoming iOS 11.x update.

I wonder what that constraint was and why it’s taking so long to fix given that people have been complaining about the gesture’s removal since the early iOS 11 betas.