Archive for December 2015

Thursday, December 31, 2015

Twitter for Mac 4.0

Juli Clover:

Twitter for Mac 4.0 includes an updated design with improvements to icons, buttons, and interactions, and it brings a new dark theme to change the background from white to black.

[…]

The Mac Twitter app received a minor update in August of 2015, but beyond that, the app has gone untouched since 2014. The last major version update ahead of today’s refresh was introduced in December of 2013.

Federico Viticci:

That’s good news, of course, but the problem is – it looks like Twitter shipped a ton of bugs and regressions in this release, while still missing some of the latest additions for mobile platforms and the web.

Jason Snell (full post):

New Twitter app design is much less dense. Seems like a questionable move when most Macs are laptops.

Milen Dzhumerov:

Looks cool but perf has seriously regressed. Scrolling at 5-15fps on a Mac Pro, smooth anims are gone.

Casey Newton:

But while many users were glad to see the app getting attention, others criticized it for performance issues: laggy scrolling, repeating old notifications, and login issues. If the app doesn’t appear to be totally in harmony with Twitter’s efforts on mobile apps, here’s one possible reason: Twitter didn’t build it.

Development of the Mac app was outsourced to a third-party developer, said Jonathan Wight, a former Twitter employee, in a tweet. The Verge confirmed that the app’s development was outsourced with other people familiar with the matter. One of those people said the developer is Black Pixel, a well-regarded digital studio based in Seattle. Black Pixel’s other clients have included ESPN, Starbucks, and the New York Times, according to its website.

Along with their own acquisitions such as NetNewsWire.

And at least there is now a team working on Twitter’s Mac app — it previously was the responsibility of a single person, sources tell The Verge.

Wikipedia says that Twitter has 3,900 employees.

Jonathan Wight:

Decided to kill product, then changed their mind, don’t care enough about it to put in-house engineers on it…

Erik Barzeski:

Plus, the 140 character limit on DMs is back, which is a big step BACKWARD. :-P

hayden.evans:

Wow. I now know why they made “no comments” to our questions on the status of their Mac (and iOS) apps when I was at Twitter HQ with a room full of iOS/Mac devs at a WWDC watch party.

Ged Maheux:

No API for Twitter polls. Still no API for group direct messaging. No sign of relenting on restrictive token limits. Going great @jack

Update (2015-12-31): Nick Heer:

“Hold on there, Nick,” you complain, “you’re saying Twitter for Mac was ‘beloved’?”

Indeed, I am. A long time ago, in a version far, far away, there was an excellent Twitter for Mac client made by Loren Brichter. Not only was it functionally complete, there were little transitions and animations everywhere that made it feel joyous to use.

Update (2016-01-04): David Heinemeier Hansson:

I must admit that I didn’t give Twitter 4.0 five minutes. But in the three it got, I was turned off by lower info density, legibility, bugs.

So how do you downgrade from Twitter 4.0 on OSX? I regrettably had the App Store on auto-update for my iMac

Wednesday, December 30, 2015

WWDR Intermediate Certificate Expiration

Apple (via Paul Haddad, comments):

While most developers and users will not be affected by the certificate change, we recommend that all developers download and install the renewed certificate on their development systems and servers as a best practice.

Harish Jonnalagadda makes it sound like developers are supposed to use the new certificate when submitting updates, but I don’t think it’s actually needed when codesigning. Rather, the reason to install it is for testing validation.

You can verify your receipt validation code is compatible with the renewed certificate in the test environment now. You will be able to test your Mac apps and receipt validation code in production starting in January.

Unfortunately, the test environment is still broken.

Mac App Store customers running OS X Snow Leopard (v10.6.8) will be unable to purchase new apps or run previously purchased apps that utilize receipt validation until they install the OS X Snow Leopard update which will be available via OS X Software Update this January.

It’s nice to have some notice this time, but it’s not that much notice. In the event that there’s a problem with 10.6, testing would be possible sometime “in January,” and then you would have to make it through App Review, and have the customer update the app, all before February 14.

Update (2016-01-15): It’s now a month before the certificate expiration. The test environment is still broken. The Snow Leopard update is not available yet.

Update (2016-01-29): The Snow Leopard update is now available.

Gus Mueller and others have continued to find that the test environment doesn’t work. Daniel Jalkut figured out that the test environment does work if you install the new Apple certificate. So perhaps it worked all along if you knew to do this. But it was not documented or obvious, and apparently no one told the Radar filers. As I found, the certificate must be installed in the System keychain. Back in December, I had installed it in my user keychain (which I think was the default), and that seemed to work because receipt validation was working with clock set in the future, but the test environment was not working.

Wednesday, December 23, 2015

Netflix’s New Compression Strategy

Don Melton (comments):

To do that, Netflix will transcode every one of their videos a bazillion times at different resolutions and at different bitrates, finally selecting the smallest one for a particular title that doesn’t suck visually. Seriously, their algorithm for all of this is quite clever.

[…]

But can Apple and Amazon sell 1080p videos — averaging about 5000 Kbps now — at bitrates as low as 2000 Kbps — less than half that average size — without a perceived loss of value?

Update (2015-12-31): Nick Heer:

I don’t see why they couldn’t. From my experiences with a non-technical crowd, they don’t care about video bitrate, likely because video isn’t marketed on bitrate but size.

However, the file sizes are clearly visible in iTunes, however.

Monday, December 21, 2015

Swift Proposal for Default Final

Curt Clifton (tweet, comments):

That is, the suggestion is that subclassing classes and overriding methods should be implicitly banned unless the framework author takes specific action to permit such indignities. The idea has evolved a bit over the last two+ weeks, to suggest that this implicit ban only apply across module boundaries.

I was shocked to find many members of the Swift team at Apple agreeing with this suggestion. When I’d mentioned the suggestion to co-workers and to friends in the app development community, to a person they said it was ridiculous.

Greg Titus:

I can’t prove any causation, but I would certainly argue that the dynamic nature and possible overridability of even things that Apple doesn’t specifically intend to allow overriding is one of the primary reasons why AppKit has survived for 20+ years and spawned arguably the most successful application framework in history in UIKit. On the other hand, efficiency and safety have rarely been major issues.

TLDR: I don’t think using the design trade-offs of Array (which is, after all, a value type and can’t be subclassed anyway) inside stdlib, can be very usefully broadened to apply to reference types in application frameworks.

Jordan Rose:

Supporting arbitrary code injection into someone else’s framework is a non-goal for Swift, perhaps even an anti-goal. […] If you replace a method on someone else’s class, you don’t actually know what semantics they’re relying on. Of course Apple code will have bugs in it. Trying to patch over these bugs in your own code is (1) obviously not an answer Apple would support, but also (2) fraught with peril, and (3) likely to break in the next OS release.

Curt Clifton:

Presumably a goal for Swift is that application developers will use it to build user-facing apps for Apple’s platforms. And presumably a goal for Apple is that developers help promote Apple’s platforms by shipping apps that take advantage of the new OS features when they ship. I fear that you and others dramatically underestimate the difficultly of doing that. I acknowledge your three points. But understand that we are professionals trying to serve our mutual customers. Temporary hacks in the service of shipping is the nature of the business.

I don’t know how to make the case more strongly than I already have. This thread makes me worry that the team does not understand what it’s like for third party developers trying to serve our mutual customers.

Michael Buckley:

But if you’re working on a consumer app, I do think that it’s logical vtable dispatch is what you want most of the time. So in my experience, functions need to be virtual more often than not, and the C++ code I’ve seen would be shorter if you had to explicitly mark methods as nonvirtual rather than virtual.

Curt Clifton:

swizzling and aggressive subclassing are last resorts, but they are necessary in the current ecosystem.

We regularly ship multiple major products on OS release day. We know this stuff.

I could not agree with Clifton more strongly. It seems like there is a culture clash between the compiler developers, who want to increase the potential for optimization, and the app developers, who like things to be more flexible because they are building on top of an imperfect platform. Since Swift’s introduction, I have been arguing that message passing (i.e. the dynamic keyword) should be the default, rather than vtable dispatch. The idea of locking things down further, with final as the default, is insane.

Making code that is not the bottleneck faster is a small win compared with an increase in bugs that directly affect customers. Rose and Joe Groff are right that there are problems with patching. But if it’s temporary and done responsibly, it’s a good pragmatic solution. Bugs are inevitable, and sometimes it is months or years before they are fixed, so Apple should not stand in the way of people trying to mitigate them.

Wil Shipley:

It is a disturbing thought, but it’ll be a long time before frameworks are written in Swift.

I like Swift. It’s exciting to think of future frameworks that take full advantage of it. It’s scary, and ironic, to think about how this modern, safe language may actually lead to more brittle software.

Update (2015-12-22): Brent Royal-Gordon:

This means doing some dangerous overriding, yes. But a UI that breaks after an iOS upgrade is not nearly as dangerous to my business as a three-month delay while I reimplement half of UIKit because someone in Cupertino thought they knew what I need better than I do and turned off—or even worse, left turned off without a single thought—subclassing of UIBarButtonItem.

The bottom line is this: Your users like Swift’s strictures when they’re helpful. This stricture is not helpful. Library users don’t accidentally subclass things, and with the override keyword in Swift, they don’t accidentally override them either. And where it truly is important, for safety or for speed, to prevent subclassing, we already have final. Making it the default is less safety than suffering.

Jesse Larson:

My concern when I saw Swift was that it was done by compiler guys who don’t ship or maintain apps.

Jared Sinclair:

Final by default requires a lvl of transparency and perfection that Apple framework engineers cannot realistically provide

Update (2015-12-23): Curt Clifton and Drew Crawford suggest middleware as a possible solution.

Update (2016-01-08): See also: Accidental Tech Podcast.

Update (2016-01-09): Friedrich Markgraf:

Apple making framework bugs unfixable was my number one concern when Swift was announced.

Marcel Weiher:

Subclassing a type not intended for it may be unfortunate, it may be necessary/desirable. Either way it is fixable.

Not being able to subclass a class is not.

And when the new release comes there is time for 3rd parties to fix. This is different from not being able to fix.

How Gzip Trumps Everything

Greg Hurrell (tweet):

In short, if you try to eliminate redundancy by applying some kind of clever transformation or restructuring your data object before piping it to gzip, you will probably just do a crappy job of reimplementing gzip at the wrong layer of abstraction, and get worse results overall.

Property-Based Testing of a Synchronization Service

John Hughes et al. (PDF, via Hacker News):

File synchronization services such as Dropbox are used by hundreds of millions of people to replicate vital data. Yet formal models of their behavior are lacking. We present the first formal—and testable—model of the core behavior of a modern file synchronizer, and we use it to discover surprising behavior in two widely deployed synchronizers. Our model is based on a technique for testing nondeterministic systems that avoids requiring that the system’s internal choices be made visible to the testing framework.

Six Windows 10 Features Apple Should Steal

Julio Ojeda-Zapata:

For the longest time, Windows users have been able to position two windows side-by-side on their displays by dragging one to the right and the other to the left until each “snaps” into place. […] Ah, but Windows 10 has already upped the ante. Windows now permits snapping of four windows into a grid, which is useful on big monitors to create a dashboard of sorts. Windows 10 also allows placement of a half-screen window beside two quarter-screen windows.

[…]

But Task View does have one feature I desire in Mission Control: each PC thumbnail incorporates a little clickable “x” that allows me to close it then and there. This is handy when I want to shut down a bunch of apps and windows quickly. While Mission Control lets me switch among open apps, it doesn’t let me quit them with a mouse click.

[…]

Microsoft is offering one of the best standalone news apps I have ever seen. Also known simply as News, it’s a revamping of an earlier app I did not like as much. The new version is vastly improved in appearance and functionality.

Sunday, December 20, 2015

Core Data Threading Demystified

Marcus Zarra (comments):

In the best way, we go back to having one PSC, but we’re going to use the new APIs in iOS 6. We’re going to add a private MOC that talks to that PSC. Then, we’re going to add our main context and define it as a main context, and we’re going to make that a child of that private MOC. Any data processing will be below the main MOC, so we will have three levels of contexts.

[…]

This design allows us to have asynchronous saves, which is extremely important. It allows us to save and to consume or process data without blocking the UI. A user can happily scroll through our application, look at data, play with it, and we’re not telling them that they have to wait for us.

[…]

We have an extra level of indirection between the PSC and the main MOC, so we will get a little bit of slowness there. When I say little bit, I mean if I build up a test case it does thousands upon thousands of iterations, I will find a 1-2% variance in the speed.

[…]

You can use notifications to force one child to consume updates from the other child, but don’t do this. It’s just a bad idea.

MVVM Is Not Very Good

Soroush Khanlou:

Nobody has any idea what the words “view model” mean, and so they can’t agree on what to put in them. The concept itself is too abstract. None of these writers would disagree about what goes in a Validator class, or a Presenter class, or a Fetcher class, and so on. Those are all better names with tightly defined roles.

Giving the same name to a wide variety of different objects with drastically different responsibilities only serves to confuse readers. If we can’t agree view models should do, what’s the benefit to giving them all the same name?

Update (2015-12-21): Ash Furrow (comments):

Next, does MVVM encourage objects that have many responsibilities? Sure, I guess it does. But again, the alternative that most iOS developers are familiar with is a massive view controller. So compared to MVC, MVVM is just telling you to use objects with one fewer responsibilities, which is a step in the right direction!

[…]

I argue that moving to MVVM (keeping the existing app structure, plus view models) is still a great idea. Separating as much code from the view layer as possible makes it way easier to further factor those components into smaller-yet objects.

Jason Brennan:

Both articles, I think, are really arguing the same things, but maybe from different directions[…]

Swift Standard Library Protocols

Greg Heo (via Natasha Murashev):

First up we got the “Can do” protocols. And these describe things that the type can do or have done to it. And they also end in the -able syntax which makes them easy to spot as you’re browsing through the headers. Here’s a first example: A type that conforms to the Hashable protocol, means that you can hash the thing down to an int.

[…]

Next step are the “Is a” protocols, and these describe what kind of thing the type is. In contrast to the “can do” protocols, these are more based on identity. That means conforming to multiple protocols of this kind feels the closest to something like multiple inheritance in Swift. You can identify these protocols in the standard library because they end in the word “-type”. And this is fully half of the standard library, something like 35 or so of those 54 are of this kind. Let’s look at an example. CollectionType is a good one. Not surprisingly Array, Dictionary, and Set conform to CollectionType. Maybe slightly more surprisingly, things like Ranges and String views.

[…]

Finally we have the “Can be” types. Rather than just an alternate view of the same thing, as we have already seen, these are more about straight on conversion. Changing from type X over to type Y. And these ones end in the word “-Convertible”. So that means that the type can either be converted from or converted to something else.

Friday, December 18, 2015

Phil Schiller Takes Over the App Stores

John Gruber (Hacker News, MacRumors):

Up until now, the App Stores were in a weird place in terms of the org chart — they were officially under Eddy Cue because the stores are extensions of the iTunes Store, but partly under Schiller with regard to developer relations. The problem wasn’t that there was conflict between Schiller and Cue, but that without one person in charge of the whole thing, some problems inevitably fell through the cracks.

Treating the App Stores as part of developer relations instead of “media content” is clearly the right way to go. The stores are built on the iTunes Server platform (WebObjects, still!), but running an App Store is nothing like distributing movies, TV shows, books, and music. There are far more improvements that need to be made on the developer relations side of things than the technical side of things (although better search would be welcome).

It’s good to have a single person in charge, and Schiller is probably the SVP who knows the most about the Mac and the business side of software. On the other hand, Schiller was already in charge of App Review, which is a disaster in terms of speed, and he has a history of making misleading statements when justifying the haphazard enforcement of the review guidelines. The marketing department is also speculated as a possible reason for Apple’s software quality problem, which Schiller doesn’t seem to think exists.

Update (2015-12-20): See also: Pierre Lebeaupin.

Update (2015-12-21): Jean-Louis Gassée:

While running last-minute errands before our Xmas family trip to Paris, I chanced upon Tim Cook in a Palo Alto clothing store. After a happy salutation, I hopped on my Apple App Store hobbyhorse and mumbled that while the Store is an immensely valuable asset, its aisles are poorly tended and in need of curation… and offered my services as curator.

Cook has heard my mumblings before: I had said pretty much the same thing three years ago during a chance encounter at the crowded check-in line for the All Things Digital conference.

Thursday, December 17, 2015

USB-C

David Pogue:

USB Type C is the Yahoo Tech Technology of the Year. It is one really amazing connector, capable of replacing the power, video, audio, and data jacks of every phone, tablet, and laptop—from every company. One single way to charge everything you own. One cable to rule them all.

David Pogue:

The specifications for USB-C were finalized late last year. That’s astonishing for two reasons: First, it was dreamed up by engineers and executives from every major electronics company, working side-by-side for three years—even blood rivals like Apple and Google.

[…]

One big question: Will Apple have the nerve to replace its Lightning connector (the one on iPhones and iPads) with USB-C, thus completing the earth’s transition to a completely universal charging jack?

Probably not, because Lightning is thinner and gives them more control.

Sam Byford:

Well, I’ve been using the MacBook as my primary computer for the past six months or so, and it’s true that its one and only USB-C port can make things a bit awkward at times. But the last few weeks have been a whole lot easier, thanks to a little peripheral I’ve been testing. It’s called the Minix Neo C, and Apple really ought to have made this thing itself.

The Neo C comes from Minix, a Hong Kong-based manufacturer of media hubs and various computer accessories. It’s a chunky yet compact hub made of sturdy metal that lets your MacBook’s USB-C port handle just about anything you’d want for regular computer use: two regular USB-A 3.0 ports that carry power, slots for both SD and microSD cards, a Gigabit Ethernet jack, your choice of VGA or HDMI monitor output — the latter up to 4K, though the highest resolution I could test was 2560 x 1080 21:9 — and, critically, another USB-C port so you can continue to charge your computer as you use all these features.

Adobe Premiere, Final Cut Pro, iMovie ’08, and Final Cut Pro X

Randy Ubillos (via Stephen Hackett):

I was working for SuperMac and they were working on something called DigitalFilm - one of the very first digital video recording cards. It did quarter frame standard definition - they were pushing the limits of the JPEG chips that were available at the time and we needed some software to try it out. In about 10 weeks I put together a demo and we’d bring in people and show them editing on a computer and it was going over pretty well. The marketing department had just gotten out of software at SuperMac and they weren’t sure what to do with it and so as it got close to shipping the card in late 1991 my software was sold to Adobe and they released it as Premiere 1.0.

[…]

We’d been going for about three years on the [Final Cut Pro] project, we went over to [Apple] and we had more work to do. Apple wanted to re-look at what it looked like. It turned out to be a good thing. We got to a point right before NAB in ’99 we just said “We are going to show this thing at NAB come hell or high water” and we got the nicest present from Avid because that was the NAB they announced they were leaving the Mac.

[…]

iMovie’s codename was RoughCut, it was conceived originally as a front end to Final Cut - for creating a rough edit for Final Cut. I worked with a graphic designer to make it look good. When I did a demo of it to Steve [Jobs] in about three minutes he said “That’s the next iMovie.” So I asked when it was supposed to ship, and he said “Eight months.”

[…]

My idea was that Final Cut 7 should stay exactly as it was for about a year, and every time you bought a copy of X you got a copy of 7. They didn’t want to hear it. I knew 16 months before the launch that I was going to have a bunch of arrows in my back. I was going to be blamed for this big transition. It’s the Apple way of doing things: ‘Feet first, jump in!’

More Responsive WebKit Tapping on iOS

Wenson Hsieh:

We know that responsive tapping is really important to web developers — so much so that many are willing to employ JavaScript frameworks to avoid the delay using touch handlers. Instead of waiting for WebKit to fire a click after a delay, these libraries prevent the default behavior of the touchend event and call click() immediately so that the element is clicked the moment the user stops touching the element. While this may make a link feel fast, it can also reduce responsiveness in other ways, including page load time and scrolling. To address this, we baked fast tapping optimizations into WebKit so well-scaled mobile web pages will be able to achieve responsive tapping out of the box without the drawbacks of third-party frameworks.

On web pages optimized for mobile viewports, elements such as links and form controls are scaled to fit well on smaller screens. As such, double tapping on these elements increases the page scale by only a small amount. Since double tapping provides little value on these web pages, we’ve implemented a mechanism for removing the delay for single taps by disabling double tap gestures.

The First Spotlight Interface

Riccardo Mori:

What I really like about Spotlight under Mac OS X 10.4 Tiger is the separate, standalone window that comes up when you select Show All at the top of the list[…]

And this is the Search interface I’ve really been missing since Apple removed it in Mac OS X 10.5 Leopard. Perhaps the Aqua elements like the three buttons in the upper left corner or the scroll bar on the right will make you cringe, but I think this is still the best search interface ever appeared on Mac OS X. Whenever I use one of my vintage PowerPC Macs running Tiger, it’s great to be back using Spotlight that way.

[…]

First of all, the way find-as-you-type has changed makes Spotlight under El Capitan appear slower than Spotlight under Tiger — and sometimes it actually is slower. If you look at the following screen recordings, where I performed a simple search for disk, you’ll see that under Tiger results start appearing immediately as I type d, then get progressively refined as I keep typing i, then s, then k. Under El Capitan, as I type disk, I only briefly see suggestions for launching apps, and then, after a pause where the panel is just blank, I finally see some results.

iCloud Music Library’s Metadata

Kirk McElhearn:

This is a single album, yet iTunes shows it as a number of different albums with different titles. I’ve sorted by album so each title should be grouped, but you can see there are four different titles for tracks in the first grouping. And that first group of tracks, which is hanging together as an album, has track numbers in a seemingly random order.

Frank Sinatra is listed as the artist for all these tracks, sometimes with others. But if I view this album in a playlist by Artist, the only artist listed is Cole Porter.

[…]

I’ve seen that iCloud Music Library changes tags and artwork. Rather than assuming that your tags, the ones you may have manually changed, are canonical, it just decides what the tags should be on your music. For example, yesterday, I deleted composer names in all the music in the Rock genre in my library. I don’t care about composers for that kind of music; those tags just get in the way when I browse using the column browser. But, today, all the composers are back for those songs.

Nick Heer:

It’s still failing to provide correct metadata for songs from Apple Music, not just ripped or third-party tracks. It’s too bad, because a lot of Apple Music’s features — like offline playback and playlist creation — require an iCloud Music Library subscription.

My metadata system isn’t complex, but I worry that any cloud service will attempt to “correct” it.

Update (2015-12-17): Joe Rosentseel:

iCloud Music Library is the reason I stopped using Apple Music before the free trial was even over.

Wednesday, December 16, 2015

OSSpinLock Is Unsafe

John McCall (via Peter Steinberger):

Spin locks are, unfortunately, illegal on iOS, which does not guarantee progress in the face of priority inversion.

Greg Parker:

OSSpinLock is unsafe unless you can guarantee that all users have the same priority.

David Smith:

also applies to the new MacBooks since they will depress priority and throttle in thermal overload situations.

to compensate, pthread mutexes are 2-2.5x faster than they used to be on new OSs

It’s a shame that this is not documented. But how great is it to see Apple engineers discuss these sorts of details in public?

Update (2015-12-31): Kevin Ballard:

The reason for this comes back to the thread scheduler and QOS. You remember how I said low-priority threads will eventually execute? That’s no longer true with QOS. More specifically, threads in a higher QOS class will never decay to a lower QOS class, and the scheduler will always prioritize runnable threads in a given QOS class before threads in lower classes. And since threads spinning on a spinlock are always runnable, this means that if there’s enough high-QOS threads waiting on a lock held by a lower-QOS thread, the thread that owns the lock will never execute.

[…]

The Obj-C runtime switched to a handoff lock algorithm, where the spinlock is the size of a word and the owning thread actually stores its thread ID in the lock. Threads that block on the lock can then temporarily donate their priority to the thread that owns the lock, which fixes the priority inversion. There’s potential issues when multiple locks are involved, but in practice it works. The only problem with this solution is it relies on private API, and the spinlock implementation itself isn’t public, so there’s no way for third-party code to use these locks.

Update (2022-10-10): See also: Improving Firefox Responsiveness on macOS.

precondition vs. assert in Swift

Erica Sadun quotes Dave Abrahams:

The two functions have distinct roles:

  • assert: checking your own code for internal errors.
  • precondition: for checking that your clients have given you valid arguments.

It’s actually important to distinguish these two cases because the second one demands public documentation while the first does not.

A Domain Move Disaster

Paul Ingraham (via Hacker News):

Bing handled the transition exactly like Google should have. My rank on Bing never even changed: it just went from indexing SaveYourself.ca URLs to PainScience.com URLs. It was agonizing to behold such good behaviour from a search engine with about 5% of the clout of Google.

Lightbulb DRM

Tim Cushing (via Seven Swans-a-Sarah):

The world of connected devices is upon us and things have never been better. Criminals can access your email account by breaking into your fridge. Your child’s toys and your television record your conversations and send them to manufacturers’ servers, where criminals are (again) able to access them. Your home thermostat goes HAL 9000 and attempts to set your house on fire. And, now, your lightbulbs won’t do the one thing you expect them to do: produce light.

Purchasers of the Philips Hue “smart” ambient lighting system are finding out that the new firmware pushed out by the manufacturer has cut off access to previously-supported lightbulbs.

See also: Hacker News, MacRumors.

Swift Type Constrained Extensions

Matt Long:

One of Swift’s most expressive and powerful features is type constrained extensions. If you’re new to Swift coming from Objective-C, think of it as a category in Objective-C yet with the ability to specify type criteria so that your category (extension) only applies to the class if it conforms to a certain type. For example, if you have an array of your own custom objects, you can create functions that are specific to an array of your objects.

His JSON example seems like a bit much, but I like the idea of extending collections with helpers for particular types. Because of the type system, this doesn’t pollute the namespace, and you will get relevant code completions from the IDE. In Objective-C, I would use a free function (with the type in its name) or a class method, both of which are more cumbersome.

MacKeeper Exposes Data on 13 Million Customers

Juli Clover:

As shared in a reddit post, Chris Vickery (via Forbes) was able to download the records simply by entering an IP address, with no username or password required to access the data, a major security oversight on MacKeeper’s part.

MacKeeper was also using MD5 hashes for passwords, a weak algorithm that’s easily bypassed using an MD5 cracking tool.

John Gruber:

It’s bad enough they were ripping people off in the first place — now they’ve exposed their passwords.

Previously: MacKeeper.

Tuesday, December 15, 2015

Craig Federighi on Swift

John Gruber:

Apple senior vice president of software engineering Craig Federighi joins the show for a wide-ranging half-hour discussion about Swift — Apple’s new programming language that just went open source.

John Siracusa provides follow up (of course).

Craig Federighi:

And slowly we’ve also been bringing back much of the dynamism. Now there are some things that are impossible in Objective-C, and most of the dynamism that you really want is the ability to figure out what classes this really needs, to be able to cast the class dynamically to a particular protocol, to be able to do a kind of response to select or perform selector check. All of these things are possible in Swift today. And there are some other things that aren’t, but certainly we consider important to ultimately bring to the language. So, this thing about a dynamic programming model is still very important to us.

Now there are still some very unsafe things that people do in Objective-C, and I’ve been guilty of this myself, where you walk the Objective-C runtime and hack the method table — and that’s cool. But it is highly unsafe and doesn’t lead to very maintainable, scalable large programs.

There’s a lot of dynamic behavior between -respondsToSelector: and dangerous swizzling, for example adding methods at runtime and capturing messages as objects. It’s also worth noting that much of what did make it into Swift doesn’t work with pure Swift. So it won’t work on Linux or if your code is using the more advanced language features. For example, pure Swift protocols don’t support optional methods, and dynamic properties imply @objc, which comes with lots of limitations. Hopefully this will change.

Monday, December 14, 2015

Core Data Book

Florian Kugler and Daniel Eggert:

With this book we try to shine a new light on a framework that has been around for a while:

  • We embrace Swift 2 with all its latest language features to write more elegant and more safe Core Data code.
  • We focus on demonstrating best practices and advanced techniques that you can immediately apply to a wide range of projects.
  • We explain how Core Data works behind the scenes. This will help you to make better choices when e.g. designing your data model, deciding on a concurrency model, or optimizing performance.

I liked the chapters that I read of the pre-release version and look forward to finishing it now.

Update (2015-12-15): Ole Begemann:

In the section on concurrency and syncing, they discuss tons of stuff you won’t find covered elsewhere in this much detail. […] For instance, they wrote an abstraction for the sync engine that allows them to replace the calls to CloudKit with another implementation that just logs the commands that should be sent to the server. What started as a workaround to allow readers to run the sample app without provisioning problems turned into something that can be used in testing.

A Study of Stack Overflow Careers

Lei Xu et al. (PDF, via Tyler Cowen):

Many online platforms such as Yahoo! Answers and GitHub rely on users to voluntarily provide content. What motivates users to contribute content for free however is not well understood. In this paper, we use a revealed preference approach to show that career concerns play an important role in user contributions to Stack Overflow, the largest online Q&A community. We investigate how activities that can enhance a user’s reputation vary before and after the user finds a new job. We contrast this with activities that do not help in enhancing a user’s reputation. After finding a new job, users contribute 25% less in reputation-generating activity on Stack Overflow. By contrast, they reduce their non-reputation-generating activity by only 8% after finding a new job. These findings suggest that users contribute to Stack Overflow in part because they perceive this as a way to improve future employment prospects. We provide direct evidence against alternative explanations such as integer constraints, skills mismatch, and dynamic selection effects. The results also suggest that, beyond altruism, career concerns play an important role in explaining voluntary contributions on Stack Overflow.

Record Adobe Revenue

Ron Miller:

As we watch organizations like IBM, HP and EMC struggle to transform, Adobe is an interesting contrasting case. It went from selling boxed software to a cloud subscription model in shorter order, and judging from its financial report that came out last week, it’s done quite well making that leap.

First, let’s have a look at the numbers. Adobe reported a record $1.31 billion in revenue for the quarter, a 22 percent year over year increase. It disclosed record annual revenue of $4.8 billion. Mind you these are significant, but the big number to me is that recurring revenue from subscriptions now represents 74 percent of Adobe’s business. What’s more, just under $3 billion in revenue in 2015 came from digital media-related annual recurring revenue (ARR).

In fact, the company added $350 Million in recurring revenue in the fourth quarter alone. Adobe reports that this growth was driven by increasing enterprise adoption and the addition of 833,000 new individual and team Creative Cloud subscriptions.

Saturday, December 12, 2015

Yahoo’s Engineers Move to Coding Without a Net

Tekla Perry (Hacker News, Slashdot):

What happens when you take away the quality assurance team in a software development operation? Fewer, not more errors, along with a vastly quicker development cycle.

That, at least, has been the experience at Yahoo, according to Amotz Maimon, the company’s chief architect, and Jay Rossiter, senior vice president of science and technology. After some small changes in development processes in 2013, and a larger push from mid-2014 to the first quarter of 2015, software engineering at Yahoo underwent a sea change. The effort was part of a program Yahoo calls Warp Drive: a shift from batch releases of code to a system of continuous delivery. Software engineers at Yahoo are no longer permitted to hand off their completed code to another team for cross checking. Instead, the code goes live as-is; if it has problems, it will fail and shut down systems, directly affecting Yahoo’s customers.

The article doesn’t say what they mean by “errors” or how they are being counted.

chojeen:

Before the switch, our team (advertising pipeline on Hadoop) used the waterfall method with these gigantic, monolithic releases; we probably released a handful of times a year. Almost without exception, QA was done manually and was painfully slow. I started to automate a lot of the testing after I arrived, but believe you me when I say that it was a tall order.

Soon after I moved into development, QA engineers without coding chops were let go, while the others were integrated into the development teams. The team switched over to agile, and a lot of effort was made to automate testing wherever possible. Despite some initial setbacks, we got down to a bi-weekly release cycle with better quality control than before.

reid:

I’m a programmer at Yahoo -- deploying multiple times a day to production, with the confidence your code will work, feels great.

Manual (“batch-release”) deployments have been forbidden for over a year, which is a forcing function to change development process to allow deploying to production continuously multiple times a day. This requires robust test and deployment automation and for engineers to better understand what they build. It’s pretty nice overall!

diivio:

Microsoft switched to this model a few months after Satya took over.

For the majority of Microsoft teams it worked really well and showed the kinds of results mentioned in this yahoo article. Look at many of our iOS apps as an example.

But for some parts of the Windows OS team apparently it didn’t work well (according to anonymous reports leaked online to major news outlets by some Windows team folks) and they say it caused bugs.

See also: Why Good QA Matters to Businesses.

Apple Pushes iPhone 6s Pop-up Ads to App Store

Roger Fingas (comments):

Apple is beginning to push fullscreen pop-up ads for the iPhone 6s to people opening the App Store app on some older iPhone models, according to a rush of user complaints.

[…]

Apple has previously marketed new devices through things like App Store banners and collections, but this is the first time Apple has temporarily prevented people from using an app simply for the sake of marketing — at least when excluding the Apple Music sign-up screen seen after launching the iOS Music app for the first time.

damonf:

Seems like this should have only been targeted at iPhone 5 or older, given that customers can currently purchase the 5s as the entry-level iPhone model. That’s kinda like buying a low-end/entry level model from a car manufacturer, open up the on-screen owner’s manual, and it has a pop-up recommending you by the high-end/premium model.

Prof_Peabody:

The new Music app was the first of it. If you have a force-press phone, it contains an advertisement for the Apple Music service that cannot be removed and sits there day after day asking you to join up. Every time you upgrade and re-start music for the first time, it shoots an advert at you on top of the one on the force-press menu.

Hell since iOS 8, most of the time when you open a store in an Apple OS, even if you are clicking on a link from an upgrade notification, it takes you to the promotional screen first, then you have to purposely switch back to the upgrades tab. It’s getting a bit ridiculous if you ask me.

Convex_Clock:

It is already the trend. iTunes has alway been bent to try to sell things while I’m trying to use my computer on a daily bases. And on iOS I think it was about a year ago that App Store started defaulting back to the Featured screen, instead of staying on the Updates where I left it. They thought I wouldn’t notice that I see ads now when I update my apps. I did notice, and it bothers me every time.

Previously: Push Notifications to Send Promotions.

Update (2015-12-12): Nick Heer:

Interstitial advertising is obnoxious, and Apple is already too keen on self-promotion in iOS for my liking — you can’t hide the Watch app if you don’t own an Apple Watch, for example.

Update (2015-12-14): Nick Mediati:

Although it’d be easy to dismiss the ad as a hoax—after all, it seems so...un-Apple—other iOS users have confirmed the existence of the popup, both on Twitter and in 9to5Mac’s comments section.

A Macworld commenter says that the pop-up even appeared on an iPhone 6.

John Gruber:

Very strange decision on Apple’s part to do this. It’s uncouth.

Update (2015-12-16): Thom Holwerda:

I got the ad as well, but on my iPhone 6S, which makes even less sense. This is just sleazy and scummy.

Update (2018-03-09): scott:

Apple News spamming my device. This is a full screen pop-up ad in Apple News that forces me to interact with it before I can get to the app.

The only options are ‘sign me up’ or ‘not now’, meaning Apple is going to continue spamming me.

Update (2018-04-14): Joe Baumgartner:

Looks like Apple is advertising via notifications similar to third parties.

Update (2018-06-25): Damien Petrilli:

This is the obnoxious part of Apple I can’t stand. I don’t want to use your service Apple, stop showing it to me everywhere.

Update (2019-02-18): Renaud Lienhart:

This the experience of launching Music.app nowadays: a full-screen, non-dismissible loading modal, followed by a broken marketing upsell.

Appalling 😒

Humble Object Pattern in Swift

Alexei Kuznetsov (comments):

The outside world can just tell [the view controller] to show some data and doesn’t have to know about the UIKit-specific details of presenting it. All labels, text fields, and image views are encapsulated inside a view controller, and only strings and images are exposed.

What’s left in the view controller is a simple mapping of values it receives from the outside to the UI elements of the view it controls. The view controller becomes very humble.

See also: The Clean Architecture:

The overriding rule that makes this architecture work is The Dependency Rule. This rule says that source code dependencies can only point inwards. Nothing in an inner circle can know anything at all about something in an outer circle. In particular, the name of something declared in an outer circle must not be mentioned by the code in the an inner circle. That includes, functions, classes. variables, or any other named software entity.

By the same token, data formats used in an outer circle should not be used by an inner circle, especially if those formats are generate by a framework in an outer circle. We don’t want anything in an outer circle to impact the inner circles.

Previously: Making a Mockery with Mock Objects.

Friday, December 11, 2015

Comcast Stream TV and Net Neutrality

Klint Finley:

Comcast says this isn’t a violation of network neutrality law because, although you’re viewing Stream TV on your computer via your Comcast broadband connection, the service isn’t technically offered over the Internet, but over Comcast’s cable television network, much like its Xfinity Xbox 360 service, which allowed Xbox users to view video that didn’t count against their data limits and was shuttered last summer.

This arrangement won’t affect many Comcast customers, at least at first. The company only imposes a 300GB limit on users in 15 areas so far. According to Ars Technica, which first reported that Stream TV won’t count towards those limits, some parts of Maine within the greater Boston area are the only areas where Stream TV availability and data limits overlap. But Comcast plans to expand Stream TV into other markets, and it might expand its data caps into other regions as well. As it does, network neutrality advocates will surely challenge Comcast’s claims.

[…]

But Comcast is in a unique position: under the terms of its merger with NBC Universal in 2011, Comcast is specifically barred from zero-rating its own services while counting data from competing services against a data cap.

NSFileHandle’s Indeterminable readabilityHandler

Sven (via Jeremy W. Sherman):

The problem is that I need to know when the last chunk of data was read. availableData should return an empty NSData instance if it reached end-of-file, but the problem is that the reachability handler is not called again on EOF.

I can’t find anything about how to get some kind of notification or callback on EOF. So what am I missing? Is Apple really providing an asynchronous reading API without an EOF callback?

The Grand Unified Theory of Apple Products

Above Avalon (comments):

One theme that has come to represent the Tim Cook era is product line expansion. Over the past four years, Apple has doubled its product lineup from 12 distinct models to more than 24, including a new product category. On a SKU basis, the growth is even more noticeable when taking into account additional finish options and various iPhone models geared toward specific mobile carriers.

[…]

The message behind the slide was simple: each distinct product category possesses a different ratio of personal technology and power. The smaller the device, the more personal the technology. Meanwhile, the large iMac is positioned as the ultimate computing machine. The best choice as to what to buy or use is dependent on the individual. All of a sudden, Apple had a way to explain iPad’s declining sales momentum (cannibalization by other Apple products), while also planting the seed that not every one will want an Apple Watch in the near-term. Instead, it’s all about personal preference.

[…]

The first thing to notice about Schiller’s new product theory is that it is actually a series of goals that also serve a dual purpose: help describe the product. What is the Apple Watch? It is a device that is supposed to handle a growing number of tasks once given to your iPhone. What is the iPhone? It is a device that is supposed to handle a growing number of tasks once given to your iPad.

Swift’s Lazy Weak References

Mike Ash:

Weak references to an object will cause that object’s memory to remain allocated even after there are no strong references to it, until all weak references are either loaded or discarded. This temporarily increases memory usage. Note that the effect is small, because while the target object’s memory remains allocated, it’s only the memory for the instance itself.

[…]

Extra memory is required to store the weak reference count on every object. In practice it appears that this is inconsequential on 64-bit. The header fields want to occupy a whole number of pointer-sized chunks, and the strong and weak reference counts share one. If the weak reference count weren’t there, the strong reference count would just occupy all 64 bits by itself. It’s possible that the strong reference could otherwise be moved into the isa by using a non-pointer isa, but I’m not sure how important that is or how it’s going to shake out in the long term.

Joe Groff:

We do plan to make weak references use a side table implementation like ObjC so we can eagerly reclaim their memory.

It’s nice for perf, yeah, but leaking the memory is unacceptable for things like outlets and delegates that get hit infrequently.

Mike Ash:

The current implementation of weak references has a race condition when multiple threads read the same weak reference to a deallocating object simultaneously.

Previously: Weak and Unowned References in Swift, How Swift Implements Unowned and Weak References.

Update (2015-12-13): Here’s the mailing list discussion for the thread-safety bug.

Double Core Data Accessors by Omitting @NSManaged

Trevor Squires:

If our implementation is not exposed to Objective-C, then Core Data will not find it at runtime, which means that, yes, Core Data will dynamically generate the accessor implementation for us.

[…]

This is why I now consider Swift to be the most satisfying language for using Core Data. The fact that (more expressive) types can’t be represented in Objective-C is a benefit, not a limitation.

Swift NSManagedObject subclasses can provide Swift-only accessors which happily coexist with Core Data’s dynamically-generated ones, and that feels like the best of both worlds.

Update (2016-06-07): Marc Charbonneau:

When you declare an @NSManaged var in your managed object subclass, normally it can be an Int, Bool, or Double. But not for Core Data primitive accessors! Primitive accessors (not to be confused with primitive types, I’m talking about methods that are a shorthand for primitiveValueForKey: … ) must be declared as an NSNumber. You don’t have to explicitly wrap your value in an NSNumber, you can still assign an Int or Double to your var and Swift will box it up for you. Not a big deal, but something to remember if you find your app crashing.

Thursday, December 10, 2015

Improving Readabilty With Swift Extensions

Jacob Bandes-Storch:

One perk of being a programmer is that, if your tools don’t do what you want, you can improve them yourself. Swift makes this particularly easy, providing several features which enable you to extend and customize the language in a way that feels natural.

Unlike Objective-C categories, Swift extensions let you extend C types like CGContext and dispatch_queue_t.

If your project has both Objective-C and Swift, you may encounter an awkward moment when an Obj-C API just doesn’t feel Swifty enough. NS_REFINED_FOR_SWIFT to the rescue.

Mac OS X 10.11.2

Mac OS X 10.11.2 fixes the bug where Mail wouldn’t let you Option-Spacebar to page up. I’m seeing intermittent problems with account keyboard shortcuts no longer working, however. [Update (2015-12-15): Here is a script to remedy that.]

Safari continues to get stuck loading certain URLs, particularly from t.co.

I’m now getting errors from iTunes that it can’t connect to “Store Purchases.”

Sandbox test user accounts for the Mac App Store are now broken. When trying to launch my app, I get a “This Apple ID has not yet been used with the App Store” error message. If I go through all the setup steps in the store, it eventually wants a credit card.

Brad West reports that the application sandbox has (undocumented) tightened restrictions, which broke the Mac App Store version of his app.

Update (2015-12-11): Adam C. Engst discusses the iTunes error and others.

Update (2016-01-16): Nick Heer:

Happily, Timothy Hatcher has some good news:

We have a Radar and a fix identified. It is lower level than WebKit.

iPhone 6s Smart Battery Case

Apple’s new battery case has been getting a lot of criticism. The shape doesn’t seem like that big a deal to me, but I was disappointed to see Cabel Sasser’s report about the materials:

Apple Case. So heavy. Bump more uncomfortable than ugly. But iPhone is 96% at 6:53 PM. Conclusion: vacation use only

Oh also, if you get one, don’t get the dark one, this rubber material is like an Apple Swiffer for all the dust in your life and pockets

Why can’t they find a material that doesn’t collect lint or pull your pocket inside out?

Unless you really need a battery integrated into your case, I think most people would be better served with a simple external battery. I use the Jackery Bar, which has more than three times the capacity of Apple’s case. Even the smaller Jackery Mini and Anker PowerCore+ mini have higher capacities. They’re all much cheaper than Apple’s and will continue working after next year’s phone no longer fits in the case. Plus, you don’t have to hold the extra bulk the whole day. You can just connect the battery now and then to recharge.

Update (2015-12-10): Rene Ritchie:

Apple is routinely criticized for putting form ahead of function. In this case, though, putting function ahead of form has resulted in some of the loudest bouts of criticism in recent history.

The “hump” is the result of hard choices made during the design process. By not running the battery all the way along the back, and by not using rigid material to cover it, Apple can hide a hinge beneath the silicone. That hinge lets the top part of the case bend backwards so you can slide your iPhone in and then slip the case back over it.

[…]

Because of the Smart Battery Case’s design, the antenna bands are essentially covered only by thin silicone portion of the case.

Update (2015-12-11): John Gruber:

Me, I don’t like the way any of them look. But after using the Smart Battery Case for three days, and having previously spent time using the thinnest available cases from Mophie, I feel confident saying Apple’s Smart Battery Case feels better when you’re holding it than any other battery case, both because of the material and its shape.

[…]

The Smart Battery Case would certainly help with an overnight hiking trip, but I think Cook was off-message here, because that scenario is really not what it was designed for. Big 5,000 mAh (or more) external battery chargers (or the highest capacity, extremely thick battery cases from third parties) are far better suited to that scenario than the Smart Battery Pack.

[…]

After a few days using this case, my thoughts turn not to the Smart Battery Case itself but instead to my personal desire that Apple had made the 6/6S form factor slightly thicker.

That probably would have also made it more comfortable to hold.

However bulky the Plus feels in your pocket and hands, it feels less bulky to me than the iPhone 6S with any battery pack. An iPhone 6S Plus, even with a normal case on it, weighs noticeably less than an iPhone 6S with the Smart Battery Case.

Update (2015-12-14): See also: Accidental Tech Podcast.

Not Your Mac, Anymore

Mike Ash:

I can’t attach to TextEdit because of system integrity protection?

@millenomi:

the point of the thing is to prevent software to do damage to the system where a user gave their admin password.

Mike Ash:

How does preventing debuggers attaching to unimportant processes match that intent?

Mayur Pawashe:

you may be able to copy TextEdit to your Desktop and attach to a running instance of it, if SIP is still broken in this way

Milen Dzhumerov:

the ominous wording when you disable SIP seems quite worrying: “… is an unsupported configuration, likely to break in the future…”.

Rosyna Keller:

TIL rootless has the ability to disable protections for one specific class if you only need to change one thing!

Update (2015-12-10): Paul Kim:

I can’t attach to SysPrefs with SIP. We’re not talking about hacking things here. SysPrefs has a officially sanctioned plugin API.

Wednesday, December 9, 2015

Swift Plans

It’s great that Apple has opened not only Swift’s code but also its reasoning, ongoing development work, and plans for the future. Here are some interesting things I’ve found:

Moving to Medium, Preserving Permalinks

David Heinemeier Hansson:

Fourth, Medium has listened to the concerns of publishers. By offering custom domains, we’re ensured that no permalink ever has to break, even if we leave the platform. By committing to never showing advertisement, unless the publisher consents, we can remain with Basecamp as the sole commercial sponsor of Signal v. Noise. Between these two facts, we feel confident about owning our content and our legacy, regardless of where Medium-The-$82M-VC-Funded-Company goes.

Daniel Jalkut:

So when any new Medium post is linked, it points directly to the “m.signalvnoise.com”, and is handled by Medium. When any older post is linked, it goes directly to “signalvnoise.com” and is handled the same as ever. The one change? When the main page at signalvnoise.com is visited, it redirects with a “302 Found” response to the Medium site, getting a casual visitor on track to viewing only the latest posts.

tvOS 9.1 Enables Remote App

Joe Rosensteel:

For me, the Apple TV was recognized by the Remote app on my iPhone 6 and I was able to use direction, menu, play/pause, and —most important of all— the iPhone’s virtual keyboard. This does not cover the full range of features that the Siri Remote can handle, and there are interface bits that the 4th generation Apple TV does not support (the options element does nothing).

There was no update at all to the Remote app.

Presumably this is because of customer feedback because Apple previously said that there were no plans to support the Remote app. Then there’s the announcement of a new remote app coming by June 2016, a year after the Apple TV 4’s announcement:.

That is a horse of a different color. Was this never part of the plan for the full product? If it was part of the plan, why was it never mentioned before now? Why mention it half a year from the release of the app instead of at the unveiling?

So much about this product seems confused.

Apple Maps Used Three Times as Often

Anick Jesdanun (via Nick Heer):

Apple says its mapping service is now used more than three times as often as its next leading competitor on iPhones and iPads, with more than 5 billion map-related requests each week. Research firm comScore says Apple has a modest lead over Google on iPhones in the US, though comScore measures how many people use a service in a given month rather than how often.

Or, we could look at this as 1 in 4 iOS users going to the trouble to download a third-party app and choosing to use it regularly. You have to be motivated to do this because Apple doesn’t let you change the default maps app that Phone, Calendar, Mail, and Siri take you to. And even if you don’t intend to use Apple’s mapping service, you are voting for it every time you view a calendar item or Find My Friends.

iOS 9.2

iOS 9.2 unfortunately doesn’t fix the three most annoying iOS 9 issues for me:

  1. The Shift key doesn’t work the first time when typing the passcode to unlock my iPad mini and iPhone 6s. I have to swipe back to the lock screen and then swipe back to the keyboard first.
  2. Opening the Camera app pauses audio that’s playing.
  3. The Camera app doesn’t remember that I always want to use HDR.

I hit all of these multiple times per day.

Camera is one of the most important apps for me, so it’s frustrating that using it is so annoying. The obvious solution would be to try a third-party app, but I have yet to find one that I like. ProCamera (App Store) seems promising, but it’s more complicated than I prefer, and the HDR feature feels very slow. Perhaps this is because it’s not using Apple’s HDR implementation—there does not appear to be an API to access that.

Of course, even if I found a camera app that I liked, I wouldn’t be able to access it from the lock screen or Control Center. iOS doesn’t let you change the default camera app.

Update (2015-12-11): John Gordon:

Neither of my bugs were fixed: audiobook titles, cellular data restrictions.

Kirk McElhearn:

In iOS 9.2, Apple made a subtle change. When you swipe now, one window slides out of the way, but the stream of windows stops on the next one, instead of continuing, potentially past the window you want to tap. It’s as if the windows snap into position as you swipe.

Update (2016-02-18): In iOS 9.3, the audio still pauses when you open the camera, but it resumes when you exit the camera.

Update (2016-03-19): Andrew Abernathy:

The way the Live Photos feature substantially worsened the user experience of non-Live photography makes me hate it.

For me, at least, the camera app certainly shouldn’t kill audio if it’s playing via Bluetooth/AirPlay, or via headphones.

Tuesday, December 8, 2015

Sunsetting Carousel and Mailbox

Dropbox (Hacker News, MacRumors):

Building new products is about learning as much as it’s about making. It’s also about tough choices. Over the past few months, we’ve increased our team’s focus on collaboration and simplifying the way people work together. In light of that, we’ve made the difficult decision to shut down Carousel and Mailbox.

Nick Heer:

No matter how much I liked Mailbox — and I really like lots of what Mailbox does — this dependency has always been an inherent flaw, and I don’t think this is adequately explained when setting it up. Most people who use it probably have no idea that their email messages live on a third-party server in between their mail host and their phone.

Jeremy W. Sherman:

Didn't realize signing into Mailbox got you an extra gig of Dropbox space. Downloaded app, signed in, deleted app. Now up to 3,5 GB.

Brent Simmons:

When deciding whether or not you can trust an app to stick around, you can’t go by whether or not it was acquired.

You also can’t go by whether or not it’s open source, because open source apps get abandoned.

You can’t go by size of company, because big companies like Google or Apple will retire apps, and small companies will fail — or switch their attention to the app that makes them money but isn’t the one you use.

There are some companies you can rely on: Bare Bones, Panic, and Omni (my employer), for instance.

Even then, you can’t rely on every product, no matter how good, continuing to receive a lot of attention. See Mailsmith, Audion, and OmniWeb. Which is sad, even though overall I’m happy to see those resources directed towards BBEdit, Coda, and OmniFocus.

Mark Alldritt:

How hard is it to transition your data to an alternative application should the one you are using be withdrawn?

[…]

A developer’s past actions give good clues to what they may do in the future (e.g. Apple & Google have pulled beloved apps many times).

See also: Upgrade.

Also, Nick Heer:

Sad news from Facebook, too: the part of the company that was responsible for a bunch of fairly unpopular but rather nice apps has been shut down. Most notably, Creative Labs is behind Paper, which has always been a far better Facebook experience than the official Facebook app.

Low-Hanging Fruit

Brent Simmons:

So we have Apple Watch and Apple TV now. What I’m hoping for — what I’m nearly begging for, more as a user than as developer — is that Apple spend a year making things better. Nothing new. Just make things work better.

John Gruber:

When the upgrade to El Capitan finished on my iMac, three of my email accounts in Mail were missing. They happened to be the accounts for my three most important email addresses. Two of them were still configured in Mail’s settings, but had been disabled — I just needed to toggle the “Enable this account” checkbox for each of them. The third account I had to reconfigure from scratch. All three accounts needed to re-download all of my mail — about 280,000 messages all told. These are IMAP accounts, so the mail was (and remains) on the server. I sure hope this bug doesn’t affect POP accounts (where the mail is only stored locally). This sort of bug would be terrifying for normal people, who don’t understand how IMAP works. If this happened to my parents, I’m certain they would just assume their email was gone, forever.

Nick Heer:

Meanwhile, on my Macs at home and at work, twitter.com and t.co links regularly fail to load in Safari. It’s only those URLs, only since upgrading to El Capitan, and only in Safari — Tweetbot works fine. Baffling.

But I hold out hope. Earlier this year, Apple released an update to iTunes that made any database edit last about a minute. Change a straight prime to a curly quote? That’ll cause iTunes to hang for a minute. Making sure A$AP Rocky is listed as “ASAP Rocky” by editing the sort artist? Another minute of hanging. Deleting a track? That’ll cause another hang. Though this bug is at least five months old, I was very happy to discover this weekend that this bug has been fixed.

Accidental Tech Podcast mentions a German video claiming that the impetus for finally reverting discoveryd to mDNSResponder was a phone call from Vint Cerf to Tim Cook. ATP also recalls the previous story of Logic bugs getting fixed because John Mayer would e-mail them to Steve Jobs. It’s scary if true that it would take one of the inventors of the Internet contacting the CEO to get the company to fix probably the most widely reported networking bug in its history.

Nacho Soto:

Apple may have unlimited cash in the bank, but they’re close to technical debt bankruptcy.

It seems like there are a large number of so-called P2 bugs that have been building up over the years. Individually, most of them could be ignored or worked around. And they are probably eminently fixable. The problem is that, though some of them do get fixed, the overall list seems to be getting longer rather than shorter. Each major new OS version brings new bugs, while leaving some from the previous release unfixed. This cannot go on forever. Either Apple will change course to make software quality a priority, or Mac users will wake up one day and find that their OS is just as buggy and unreliable as the software that Microsoft was once known for.

The bugs also affect third-party software. I spend a huge amount of development time working around OS bugs rather than adding features or fixing bugs that were my own fault. This is bad for business and for customers.

Update (2015-12-09): The after show of that ATP episode discusses brokenness with Pages and iCloud Drive, and even saving to the local disk.

Update (2015-12-10): Lloyd Chambers:

[Upgrading] to 10.11.2 destroyed my mail accounts; I had to delete the accounts and set them up again.

[…]

On my desktop, to this day the VIP accounts do not function (destroyed by El Crapitan), even if deleted and recreated. The VIP accounts list feature is utterly non-functional.

[…]

My local Contacts and Calendar are destroyed. If I jump through hoops and restore them from iCloud (a convoluted process), then I get duplicate entries for all of them on my Mac and my iPhone. It’s a sick joke.

Saturday, December 5, 2015

IBM’s Swift Sandbox

John Petitto:

The IBM Swift Sandbox is an interactive website that lets you write Swift code and execute it in a server environment – on top of Linux! Each sandbox runs on IBM Cloud in a Docker container. In addition, both the latest versions of Swift and its standard library are available for you to use.

Here’s the link. You can double-click on a token to see other occurrences of it.

Friday, December 4, 2015

Edit Distance and Edit Steps

Dave DeLong:

One of the interesting things about NSMetadataQuery is that after it has done its initial “gathering” of the results, all further updates are reported as a single array of results. Did something get added to the results? Here’s a new array of the state of all results now. Did something get removed? Here’s another array.

[…]

In other words, the Levenshtein algorithm can easily be generalized to work on any CollectionType of Equatables. Suddenly, it looks like just the thing we need to implement more-efficient array diffing.

One downside of the Levenshtein algorithm is that it only returns an Int. It only tells us how many steps we would need, but not what the actual steps are. For that, we’ll turn to a specific implementation of the Levenshtein algorithm, called the Wagner-Fischer algorithm.

Counting Steps With Multiple Devices

David Smith:

As you go about your daily life with an iPhone and Apple Watch each is constantly trying to measure your movement to determine if you are walking. Depending on what your current activity is, one or the other will be doing a better job of capturing what you are doing.

If, for example, you are pushing a stroller the iPhone in your pocket will do a much better job than the watch on your wrist. Conversely if your iPhone is in your purse, the watch on your wrist is much more accurate. The challenge this update solved is how to merge these two data sources in a way that provides a consistent and reliable picture of your day.

You might be wondering why I don’t use Apple’s Health.app merging system for this. After extensive testing about how that works I determined that it doesn’t really do a good job for step data. The Apple Health algorithm works around the concept of a ‘priority’ device. This priority device’s steps are then used in all instances except where that device is completely unavailable. In which case the secondary devices data is used to fill in the gaps.

The Search for a Faster CRC32

Rob Norris:

With the assistance of Linux’s perf utility, we found that most of our CPU time (~10%) was spent in one of the many Cyrus processes, in a function called crc32(). This function computes a checksum (using the common CRC32 algorithm) of some arbitrary chunk of data. The idea is to store the data and the checksum separately and then later, when you read the data, you recompute the checksum and compare with the original. If they’re different, then you know that either the data or the checksum have been corrupted and you can take appropriate action. Over the years, we’ve added checksums all over Cyrus, particularly in its data storage engine (known as twoskip [PDF]), and they’ve saved us more than once.

At that point it became obvious - we calculate billions of CRC32 checksums, and when you add it all up, that's a lot of CPU time. So we started looking into alternative implementations, because even a small gain will translate into a big win once you run it a few billion times.

The TTY Demystified

Linus Åkesson (via Hacker News):

The TTY subsystem is central to the design of Linux, and UNIX in general. Unfortunately, its importance is often overlooked, and it is difficult to find good introductory articles about it. I believe that a basic understanding of TTYs in Linux is essential for the developer and the advanced user.

Beware, though: What you are about to see is not particularly elegant. In fact, the TTY subsystem — while quite functional from a user’s point of view — is a twisty little mess of special cases. To understand how this came to be, we have to go back in time.

Launching PDF Expert for Mac

Denys Zhadanov (via Hacker News):

Watching 51 seconds and understanding the concept is much easier than reading a webpage or article, no matter how great they are. That’s why I strongly recommend shooting a professional video for your product launch.

[…]

Apple is being very helpful these days, and they want developers to succeed. That is why you really should keep in touch with App Store Business Management and keep them updated on what you’re building and when you’re getting ready for a launch.

[…]

 I initially thought that Mac App Store is pretty small, but it’s possible to pull solid revenue just there. #1 position in Top Charts will give you 1000–1200 installs a day in the US alone.

However, they also have a direct sale version because they really wanted to offer trials. They send out multiple e-mails to potential customers (who have signed up) before and after the trial period expires.

Update (2016-09-06): Denys Zhadanov:

I believe that developers are able to make good extra revenue on the Mac App Store, as opposed to distributing apps via the web site alone.

[…]

Since it’s more difficult to create a great Mac app, and the trend has been to abandon the Mac App Store, there’s less competition there! If you manage to create a great product that you know people will love, you can be a stand out there.

Thursday, December 3, 2015

Apple Open Sources Swift

Eric Slivka:

As promised, Apple has officially made its Swift programming language open source, making the project available through Swift.org.

Most surprising, to me, is that Apple is reimplementing Foundation on top of cross-platform libraries without using the Objective-C runtime.

Curiously, Apple plans to remove the “NS” prefix from the classes, which would seem to hamper compatibility. [Update (2015-12-03): I guess the idea is that the prefix will also be removed when calling the Objective-C Foundation APIs, so the names would then be consistent. I’m not sure what this means for code that intends to distinguish between NSString and Swift’s String.]

The Swift Programming Language Evolution repository is particularly interesting. The current goal is to stabilize the ABI by fall 2016.

Javier Soto:

I think it’s safe to say Apple greatly exceeded all of our expectations with their work open sourcing Swift. Well done, !

Henri Watson:

Shout out to Apple for not just having an “initial commit” and actually including the entire project history.

Update (2015-12-03): Russ Bishop has a good summary.

Apple’s announcement:

Swift.org is where the daily engineering work for Swift will take place, as the community of developers work together to bring Swift to new platforms, add new features, and continually evolve our favorite language.

Andrew Cunningham:

Most of that is covered under the standard Apache license, but Federighi tells us that Apple has also included a more permissive runtime exception, “so that if you build code in Swift and parts of the Swift library are generated in your own code, you don’t have to provide attribution in that case.”

Apple engineers working on Swift will start using the GitHub repos, developing the language out in the open.

“The Swift team will be developing completely in the open on GitHub,” Federighi told Ars. “As they’re working day-to-day and making modifications to the language, including their work on Swift 3.0, all of that is going to be happening out in the open on GitHub.”

[…]

“We think [Swift] is how really everyone should be programming for the next 20 years,” Federighi told Ars. “We think it’s the next major programming language.”

Bravo for having real mailing lists.

There are lots of comments on Hacker News and Reddit.

Craig Federighi:

Objective C is forever. I don’t think anyone should fear for the future of Objective C. We’re going to continue to support Objective C for ourselves and the developer community.

We think Objective C is still a great language, and Apple has an investment in many many millions of lines of Objective C, and that’s not going to change.

Variable Capture and Loops

Tim Ekl:

The difference, it turns out, has to do with how variables are bound in loops, and how values are captured in anonymous functions. The Swift (and Objective-C) behavior – which I was most used to at the time of writing – was to bind i as a different immutable value in each loop iteration, then capture a reference to that value each time through.

Go, on the other hand, binds a single mutable value for the entire loop, then captures a reference to that single variable instead, only getting the value in question at the time the function is executed.

[…]

Interestingly enough, we can even “introduce” this bug in Swift code by using a C-like loop instead of the nicer forin syntax[…] Since this style explicitly uses a single mutable i for the entire loop, rather than binding a new i for each iteration, the “buggy” behavior – printing five sixes – occurs. Swift is even kind enough to make the mutability of i here more explicit, by requiring it be annotated var in the loop declaration.

See also: Capturing references in closures, Capture Lists, The __block Storage Type.

Put Save As Back on the File Menu

Adam C. Engst:

Regardless, the more important question is how you can bring Save As back, if that’s what you’d prefer. I fall into that category — the make-a-duplicate-and-then-save model doesn’t fit with the way I work.

You could remember to press Option when the File menu is showing to reveal Save As or invoke Save As from the keyboard with Command-Shift-Option-S. But that’s fussy, and there’s a way to put Save As back on the File menu permanently, and even replace Duplicate with it, if that’s what you want.

If you assign a keyboard shortcut, the system will show the Save As menu item all the time, instead of treating it as an alternate of Duplicate.

The Secret Power of “Read It Later” Apps

Tiago Forte (via Hacker News):

Let’s look at the 4 main barriers to consuming long-form content, and the affordances that Read It Later apps use to overcome them[…]

[…]

Bringing this back to filtering, not only am I saving time and preserving focus by batch processing both the collection and the consumption of new content, I’m time-shifting the curation process to a time better suited for reading, and (most critically) removed from the temptations, stresses, and biopsychosocial hooks that first lured me in.

I am always amazed by what happens: no matter how stringent I was in the original collecting, no matter how certain I was that this thing was worthwhile, I regularly eliminate 1/3 of my list before reading. The post that looked SO INTERESTING when compared to that one task I’d been procrastinating on, in retrospect isn’t even something I care about.

pdkl95:

The “secret power” of Pocket is that someone is making money off selling detailed information on what people red, probably including when, where, probably how long a given document is read. They aren’t offering their bandwidth and storage as some sort of charity; those server costs are obviously being covered by surveillance-as-a-business-model.

The database Pocket is building is an incredibly tempting target for many different groups (governments, insurance companies, etc). Even if Pocket isn’t using that data (unlikely), the probability of leaks/theft is high.

The End of Dynamic Languages

Elben Shira (via Michael Feathers):

There is a frantic rush to bolt-on a type system to every dynamic language out there. Typed Racket, Typed Clojure, TypeScript, Typed Lua. Even Python has “type hints”. […] The fundamental problem, you see, is that a programming language is not just about code. Implied in the community is a school of thought, a philosophy. And that is difficult to change.

[…]

This is my bet: the age of dynamic languages is over. There will be no new successful ones. Indeed we have learned a lot from them. We’ve learned that library code should be extendable by the programmer (mixins and meta-programming), that we want to control the structure (macros), that we disdain verbosity. And above all, we’ve learned that we want our languages to be enjoyable.

Marcel Weiher:

Looks like someone else confused hash-languages with dynamic languages. If you pass hashes around the type checker won’t save you

Dan Luu:

There are some pretty strong statements about types floating around out there; for the most part, those claims haven’t matched my personal experience. The claims range from the oft-repeated phrase that when you get the types to line up, everything just works, to “not relying on type safety is unethical (if you have an SLA)”, “I think programmers who doubt that type systems help are basically the tech equivalent of an anti-vaxxer”, and “It boils down to cost vs benefit, actual studies, and mathematical axioms, not aesthetics or feelings”. There are probably plenty of strong claims about dynamic languages that I’d disagree with if I heard them, but I’m not in the right communities to hear the more outlandish claims about dynamically typed languages. Either way, it’s rare to see people cite actual evidence.

This is a review of the empirical evidence.

Via Lambda the Ultimate:

Part of the benefits of types allegedly surround documentation to help refactoring without violating invariants. So another future study I’d like to see is one where participants develop a program meeting certain requirements in their language of choice. They will have as much time as needed to satisfy a correctness test suite. They should then be asked many months later to add a new feature to the program they developed. I expect that the maintenance effort required of a language is more important than the effort required of initial development, because programs change more often than they are written from scratch.

This could be a good thread on how to test the various beliefs surrounding statically typed and dynamically languages. If you have any studies that aren’t mentioned above, or some ideas on what would make a good study, let’s hear it!

Maxime Chevalier-Boisvert:

That there are less dynamic programming languages coming out is an undeniable fact. I’ve written code in statically typed languages such as C, C++, D and OCaml, and I agree that their type systems help catch certain classes of bugs more easily and rapidly. When writing code in JavaScript, you can run into nasty surprises. Latent, trivial bugs that remain hidden in your code, sometimes for months, until some specific input causes them to manifest themselves.

[…]

Dynamic languages are at a disadvantage. Most of the mainstream ones out there today were designed by amateurs, people with no formal CS background, or no adequate background in compiler construction. They were designed with no regard for performance, and an impractical mash of features that often poorly work together. Most of the dynamic languages you know are simply poorly crafted. This has resulted in some backlash.

[…]

Have static languages won? It seems to me that what people really like about static languages is IDE support for things like simple refactorings and autocompletion. Program analysis that can provide some guarantees, find certain classes of bugs without having to run programs with every possible combination of inputs. It’s perfectly legitimate for programmers to want these things. They help alleviate the cognitive burden of working with large (and small) codebases. But, these advantages aren’t inherently advantages of statically typed programming languages. I would argue that Smalltalk had (has) some amazingly powerful tools that go way beyond what the Eclipse IDE could ever give you.

Update (2015-12-04): Michael R. Bernstein:

IMO you’re wrong if you think the “next big language” will be “either” “static” or “dynamic.” It’ll be both, if we’re making progress.

The Success of ARM

ChuckMcM:

What is fascinating is that Intel got into that position by being open, there were no fewer than 12 licensees for its 8086 design, and people had supplanted “expensive, proprietary lock-in” type architectures with more open and cheaper chips. It was the emergence of the PC market, and the great Chip Recession of 1984, where Intel decided if it was going to stay a chip maker, it had to be the best source of its dominant computer chips. I was at Intel at the time and it shifted from partnering, to competing, with the same people who had licensed its chips, with the intent of “reclaiming” the market for CPU chips for itself.

[…]

The relentless pace of putting more transistors into less space drove an interesting problem for ARM. When you get a process shrink you can do one of two things, you can cut your costs (more die per wafer), or you can keep your costs about the same and increase features (more transistors per die). And the truth is you always did a bit of both. But the challenge with chips is their macro scale parts (the pin pads for example) really couldn’t shrink. So you became “pad limited”. The ratio of the area dedicated to the pads (which you connected external wires too) and the transistors could not drop below the point where most of your wafer was “pad”. If it did so then you’re costs flipped and your expensive manufacturing process was producing wafers of mostly pads so not utilizing its capabilities.

[…]

So we had an explosion of “system on chip” products with all sorts of peripherals that continues to this day. And the process feature size keeps getting smaller, and the stuff added keeps growing. The ARM core was so small it could accommodate more peripherals on the same die, that made it cost effective and that made it a good choice for phones which needed long battery life but low cost.

Update (2015-12-03): mrpippy (via Twitter):

The advantages that Apple derives from the A-series SoCs is not due to any inherent advantage of ARM vs. x86, but because Apple has full control over the design and manufacturing.

The Apple Pencil

Gus Mueller:

It feels absolutely right. Super low latency, palm rejection, and … it just works.

Is it the same as drawing in my sketchbook? No. Of course not. I’m rubbing a plastic tip across a glass screen.

It’s still God Damn Amazing though.

Serenity Caldwell:

But it does something heretofore unexpected: It beats Wacom at its own game. The Pencil is just as good a sketching tool as any Wacom pen. I don’t care that we don’t know its official pressure rating. It’s right. Apple got it right. The pressure, the accuracy, the lag, the palm rejection. My brain is fully and thoroughly tricked into believing it’s drawing on paper, and even the pen on glass sensation can’t convince me otherwise.

Myke Hurley:

When this happens the weights actually seem to give it momentum, and will propel it forward further and faster than it would have otherwise. Each time as the Pencil turns, it acts against itself as it is moving to quickly to balance, and on it goes, off the table.

In all honesty, I’m not sure that putting weights in the Pencil is the right way to solve this issue. Even Apple’s own Marc Newson put a clip on his recent Mont Blanc pen which would stop this from happening. I wish Apple would have considered this when designing the Pencil.

Jean-Louis Gassée:

As I write this, the Smart Keyboard and the Apple Pencil are still at least three weeks away. One assumes that the DRI (Directly Responsible Individual) in charge of the iPad Pro Supply Chain now works at a procurement office for rare minerals in Mongolia’s Ulaanbaatar. (An Apple Store employee took pity on me and sold me a Pencil from a freshly arrived shipment. I may need to get another…I’ve left mine at home more than once.)

Liz Marley:

It is a small, expensive device, which I basically expect to lose. And I don’t see a good way to attach a TrackR to its sleek exterior. But! It is bluetooth-paired to a rather large iPad. There’s no microphone, either in the official description or in the teardown, so it probably can’t be pinged. But maybe an iPad app could still give you a vague hotter/colder indicator? Or if it went out of range, the GPS location of the last time they were together?

Paul Haddad:

I know the Apple Pencil charges super fast, but is it me or is standby life pretty crappy? Charged it yesterday, haven’t used it, 75% now.

I recently played around with an iPad Pro. The Pencil really is amazing. It is much more comfortable to hold than I would have expected from the photos. Yes, it does not feel like drawing on paper, but there is a bit of texture from the Pencil tip, so it doesn’t really feel like glass, either. It’s faster than other styluses I’ve used, although there was more lag in Adobe Sketch than I was expecting based on the reviews. It took a long time to get it working in the Notes app because of a bug that hid the button for entering drawing mode. (I never had that problem on my iPhone.) I found that I really liked using the Pencil for non-drawing purposes, controlling the interface with a more precise instrument than my finger. More generally, the iPad Pro seems like a good product, but I, personally, have no use for it. I was not impressed by the keyboard and found the multitasking confusing.

Update (2015-12-04): Christopher Phin:

Let me be completely clear: this is the best digital drawing tool there has ever been. Better than a Wacom Intuos, better than a Wacom Cintiq, and better, by a margin so wide it's downright comical, than any other stylus for iOS or Android.

Wednesday, December 2, 2015

Adobe Animate CC

Adobe (via Scott Hanselman):

Flash has played a leading role in bringing new capabilities to the web. From audio and animation, to interactivity and video, Flash has helped push the web forward.

Today, open standards like HTML5 have matured and provide many of the capabilities that Flash ushered in. Our customers have clearly communicated that they would like our creative applications to evolve to support multiple standards and we are committed to doing that. So today we are announcing Animate CC, previously Flash Professional CC, which will be Adobe’s premier web animation tool for developing HTML5 content while continuing to support the creation of Flash content. Adobe Animate CC will be available in early 2016.

Susie Ochs:

But Flash isn’t going away. Animate CC will still support Flash creation, along with HTML5, WebGL, 4K video, and SVG. And you’re still going to run into content online that requires Flash Player, such as Facebook games and, yes, even some Flash video. Adobe says that Facebook will be sending back “security information” to Adobe so the company can improve Flash Player’s security. Adobe’s blog post also mentions having worked with “Microsoft and Google to help ensure the ongoing compatibility and security of Flash content” in browsers.

Jacob Kastrenakes:

By acknowledging that Flash is dying, Adobe is able to better position its animation tools for the future. Flash Professional CC is already capable of creating HTML5 content — in fact, it already represents a third of all content created in the app, according to Adobe. By taking up the name Animate CC, Adobe is able to sell Flash Professional CC as a general animation tool, rather than a tool geared toward Flash.

Previously: Thoughts on Flash.

Generating Core Data Swift

Human Friendly:

There are two [Xcode] generation options, with “Use scalar properties for primitive data types” you get usefully typed integers, floats, doubles and bools but lose the expression to express optionals/nil values. This is presumably due to the limitations of the Objective-C based API. It also expresses date types as NSTimeIntervals (Doubles) rather than NSDates. The other option will generate with objects so you will get NSDates but for number values and Booleans you will get NSNumbers which lose information about whether it is a floating point type, integer or boolean.

[…]

The Core Data model file is actually a very simple XML file and parsing it is relatively straightforward. I’ve written a quick (but brittle so far) parser using NSXMLParser. This means that I can easily get at the key information (Entities, Attributes and the relationships) to generate the code I need.

See also: mogenerator.

Flickr’s Experience With iOS 9

Rocir:

Flickr provides a huge amount of public content, including many amazing photos. If anybody searches for “Northern Lights” in Spotlight, shouldn’t we show them our best Aurora Borealis photos? For this public content – photos, public groups, tags and so on – we leverage NSUserActivity, with its new search APIs, to make it all searchable when viewed.

[…]

Every time a user opens a photo, public group, location page, etc., we create a new NSUserActivity and make it current. The more often a specific activity is made current, the more relevant iOS considers it. In fact, the more often an activity is made current by any number of different users, the more relevant Apple considers it globally, and the more likely it will show up for other iOS users as well (provided it’s public).

[…]

In Flickr, we have a few different domains. That means that each one of flickr.com, http://www.flickr.com, m.flickr.com and flic.kr must provide its own JSON association file, whether or not they differ. In our case, the flic.kr domain actually does support different paths, since it’s only used for short URLs; hence, its “apple-app-site-association” is different than the others.

[…]

If the user taps on a photo in one of these cells, it will open the photo view. But if the user taps on another user’s name, it will open that user’s profile view. Previews of these UIViewControllers should be shown accordingly. But the “peek and pop” mechanism requires you to register a delegate on your UIViewController with registerForPreviewingWithDelegate:sourceView:, which means that you’re working in a much higher layer. Your UIViewController’s view might not even know about its subviews’ structures.

Previously: Flickr for iOS 9.

Swift and C Libraries

Chris Eidhof:

We started with a very simple invocation of qsort and sorted some numbers. Then, we put it into a function and made it work on any array of numbers. The moment we started making it generic, things got really complicated. The blocks were relatively okay, but once we needed to use this qsort_r strategy with the void pointer, things got a bit magical. However, this is a very common pattern in C libraries, and anytime you want to wrap a C library, you can use this technique. You might also think, “Why would I ever want to wrap a C library?” I think that once Swift is open-source, we want to run it on multiple platforms, for example Linux. And on Linux we will probably not have access to all the Apple frameworks that exist on Cocoa and iOS. We will need to wrap frameworks all of a sudden for networking, drawing things, etc. Then, it will be important that you know how to work with C libraries. That’s why I think this can be very useful.

Tuesday, December 1, 2015

Sketch Leaving the Mac App Store

Bohemian Coding (comments):

There are a number of reasons for Sketch leaving the Mac App Store—many of which in isolation wouldn’t cause us huge concern. However as with all gripes, when compounded they make it hard to justify staying: App Review continues to take at least a week, there are technical limitations imposed by the Mac App Store guidelines (sandboxing and so on) that limit some of the features we want to bring to Sketch, and upgrade pricing remains unavailable.

Federico Viticci:

Sketch is, quite possibly, one of the most popular image editing apps for professionals who use Macs nowadays, and it’s yet another high-profile departure from the Mac App Store.

[…]

At this stage, we are far beyond the point of acknowledging there is a problem on the Mac App Store. We are not talking a bunch of isolated cases anymore – leaving the Mac App Store has become an accepted trend among developers, which is compounded by the sad state of abandon in which Apple has left it and other issues developers illustrated in the past.

Milen Dzhumerov:

Apple has completely lost the goodwill of Mac developers. The one and only reason the ones that haven’t gone bankrupt are still staying is because they have no other choice due to platform lock-in. Every single conversation that I’ve had with indies recently have gone along the same lines: Apple is killing the indie scene.

[…]

And now you have another flagship OS X app ditching the MAS due to the multitude problems it creates. The message is loud and clear - if you’re a real software business, not a hobbyist at home, don’t waste your time with the MAS - it simply does not allow you to run your business properly.

When the companies building the flagship apps for the platform publicly state they cannot do business due to the restrictions of the Mac App Store and then abandon the dysfunctional virtual marketplace, then you know Apple have pushed them beyond the edge. No company would just decide to leave the MAS unless the situation is hurting them significantly and holding them back.

One of my bug fix updates for El Capitan is still in review after 59 days.

Update (2015-12-02): John Gruber:

Deeply troubling indictment of the Mac App Store. Sketch isn’t the first big name professional app to be pulled from the Mac App Store (Bare Bones Software’s BBEdit, Panic’s Coda, Quicken, just to name a few). But Sketch is the poster child for Mac App Store era professional Mac software. It’s the sort of app Apple might demo in a keynote — and the winner of an Apple Design Award. Apple thinks so highly of it that they provide Sketch templates for Apple Watch UI designers. It’s incredibly popular (and was among the top-grossers on the Mac App Store), Mac-only, and they want no part of the Mac App Store.

Seth Lilly:

As a consumer, I like the Mac App Store. It’s a one-stop shop. That convenience is what has made the iOS App Store indispensable. But as a software publisher I’m not willing to make the trade-off in customer experience for discoverability.

As with Bohemian Coding, he’s saying that the customer experience is better outside of the store. That once would have been a very controversial opinion, because the store makes buying and updating so easy, but those pluses are offset by features that are missing or harder to use (because of sandboxing), bug fixes that are delayed (because of App Review), upgrades that are separate apps, and not being able to help customers directly.

Greg Maletic:

Few apps leave the iOS Store. But it’s the pro apps that weren’t ever created for iOS, due to the Store’s limitations, that are the problem.

Rene Ritchie:

Much of the debate has focused on the reasons stated in the Sketch post, on the perennials—trial periods/refunds, upgrade pricing, direct customer relationships, freedom from sandboxing, disintermediation of review, etc. All mechanisms and realities from a time before mobile shattered the expectations associated with traditional software businesses.

They’re easy to point to, and have nostalgia on their side, but it’s tough to say what if any substantive difference they’d make in the post-”pop app” world. It’s one of the many reasons why presenting perceived solutions to a problem is never as productive as stating problems and leaving them open to potentially novel solutions. It’s the “faster horses” trap.

I see this point made from time to time and couldn’t disagree more. I would love it if Apple were working on something better than a faster horse for the Mac App Store. But all the evidence points to Apple’s Model T being an actual car. There are not even rumors about improvements to the store. And, like the iPad filesystem, no one else seems to have a better idea, either. At this point, the problems have been common knowledge for years, countless Radars have been filed, yet people doubt that Apple even cares about them. The perceived solutions worked well for decades and continue to work outside of the Mac App Store. That doesn’t mean that they would solve all the problems. But it’s heartbreaking that, absent a better idea, Apple would let the market crash rather than try them.

See also: the prescience of Wolf Rentzsch and Rich Siegel.

Craig Hockenberry:

Worse, I don’t think Apple really understands the problems developers are facing just to stay in business.

The effects on the ecosystem are long-term: the fallout from an unhealthy indie scene won’t be felt until it’s too late.

Manton Reece:

All this time, Apple could have been iterating on the Mac App Store, improving sandboxing entitlements, improving review times, customer interaction, and more. Yet they have not.

Update (2015-12-08): Jason Snell:

The continued rotting of the Mac App Store seems to be the most likely scenario here.

See also: Release Notes.

Update (2015-12-14): Rory Prior:

I was initially very enthusiastic about the Mac App Store (MAS), but as the years have ticked by with literally no improvements, that enthusiasm has waned to be replaced firstly by concern and now increasingly by anger and frustration.

[…]

In some cases like with Microsoft and Adobe or Barebones and Panic, they have enough clout to survive outside the MAS. But for smaller developers, including ThinkMac, the MAS has sucked so much oxygen out of the rest of the world, that it would be suicide to pull out. So we stick around, accruing cuts and counting down the days until we finally succumb to them.