Category Archives: iOS

Multilingual Completion

At times I’ve been frustrated that when I’m trying to type a Spanish word on my iPhone, I’m only offered completions in English. For example, if I wanted to type the Spanish word for ostrich, avestruz:

NewImage

It finally occurred to me that I could add a Spanish keyboard to my Keyboard settings:

IMG 2574

Now, when I’m in an app or on a web site where I’m likely to type in Spanish, I can easily change the keyboard and get Spanish-language completions.

It gets better: if a second-language keyboard such as Spanish is merely enabled, it affects the keyboard completion behavior such that completions from either your first or second language is included. Here I am typing “aves” in the English keyboard, but completion is smart enough to infer that I’m looking for “avestruz”:

IMG 2575

I had hoped that iOS’s willingness to cross language barriers might also apply to Siri dictation, but alas no. “All these truths” is the closest it can muster when I speak “avestruz”:

IMG 2570

However, having the Spanish keyboard at hand means I can quickly switch keyboards and dictate as expected:

IMG 2572

If you find yourself frequently typing a foreign-language word and hoping for some help from your phone, be sure to install a keyboard for the language so that iOS knows you’re interested in its suggestions!

Accessible Resistance

Accessibility in software refers to the noble ambition of ensuring that software is usable by as diverse a user base as possible. To that end, software is made more accessible by adapting to a variety of physical or cognitive impairments that may affect any individual user.

In the United States and other countries, there is an ugly trend towards supporting politicians who don’t believe that people from diverse backgrounds, or with specific impairments, should be accommodated by society as a whole.

Many developers are looking for concrete ways to fight these politicians who don’t value diversity and inclusion. One small thing we can all do to push back, to resist, is to ensure our own apps are as accessible as possible.

During my many years as an indie Mac developer, I have often prioritized accessibility in my apps. I have heard from many MarsEdit users, particularly those with vision difficulties, who tell me its accessibility makes it a better alternative to many other blogging solutions.

I am gratified to hear about the ways I have gotten accessibility right, but I am still not satisfied that I have done enough. There are nuances of MarsEdit’s accessibility that can yet be improved, while some of my other apps, such as Black Ink, are still hardly accessible at all.

If you are a Mac or iOS developer who is committed to improving the accessibility of your app, a great place to start is with the WWDC 2016 What’s New In Accessibility session. Apple is always enhancing the variety of accessible features that are built in to iOS, macOS, tvOS, and yes!, even watchOS.

Spend a half hour watching this video, and start getting up to speed with how you will enhance the accessibility of your app. No matter where you live in the world, you can be a strident voice for inclusion by declaring, through your actions in Xcode, that your software is designed to be used by everyone.

Bitter iCloud Truth

A few days ago, I set about tidying up my completely unruly Contacts database. Over the years I have accumulated 2,953 distinct contact cards. Thousands are duplicates, hundreds were added automatically by Mail or macOS, some are for people whom I no longer know, and a very few are for folks I no longer want to know.

The first thing to do was obviously to take care of those duplicates. Contacts on the Mac features a couple seemingly handy menu items for dealing with this problem: “Look for Duplicates” and “Merge Selected Cards.” I cannot recommend using either of these features.

When I invoked “Look for Duplicates” on my 3000 cards, of which I could tell by visually scanning that at least 1000 were duplicates, Contacts came back at me with a stunningly unhelpful offer to fix 9 of them:

NiceTry

Seeing that I would have to identify the clones myself, I committed to selecting groups of two or three clearly duplicated identities, and selecting Card -> Merge Selected Cards. I generally trust Apple software to do the right thing, but recognizing the heartache that would come with losing any information from these cards, I decided to proactively export my Contacts database so that I would be safe should anything go wrong. Selecting File -> Export… -> Contacts Archive from the menu bar produced a 60MB bundle that seemed certain to contain all of the contact information on my Mac.

I tried “Merge Selected Cards” on a few items, and it seemed to do the trick. Where data from the two cards was identical, it merged them cleanly. Where something was in conflict, for example if a Company Name had changed from “Google” to “Apple” at some point, the conflict was resolved by picking one and appending the other to the merged card’s “Note”.

After painstakingly merging cards in this manner for an hour or so (!), I had stopped paying close attention to whether conflicting data was being persisted well or not. At one point I stumbled upon the realization that I lacked the phone number for a contact whom I had sent an SMS message just within the past week. Other contacts were missing key data, too. An outdated email address here, a missing mailing address there. Whoops! Abort mission! Time to recover from that backup file.

I double-clicked the backup file in the Finder, and agreed when Contacts asked if I was sure I wanted to “replace my Contacts data” with the contents of the archive.

Screenshot 1 3 17 1 14 PM

You’re damned right, I am sure! Give me back my data.

After restoring from Backup, I found that I didn’t have any duplicate entries in Contacts. In fact, I only had around 130 cards. Somehow I had lost the vast majority of cards in this process. What’s going on here?

I think what happened is that exporting from Contacts on my Mac is creating an archive that, when imported, possibly reflects the state of my Contacts database from years ago, before I ever agreed to sync Contacts with iCloud. No amount of futzing with local data on my Mac, including disabling iCloud syncing, and restoring the contents of Contacts’s data folder (~/Library/Application Support/AddressBook) would coerce Contacts into showing me all of my Contacts. I began to panic. Had I actually lost all of my Contacts data? In spite of dutifully backing up my local data and making a proactive archive from Contacts, the app had a very different idea of what my Contacts “truth” was.

I was relieved to discover an iCloud.com feature for recovering Contacts to the state they were in on a previous date. You get to it by navigating to iCloud Settings -> Advanced, and clicking the “Restore Contacts” link.

NewImage

After restoring Contacts through iCloud.com, and syncing to iCloud from my Mac, my Contacts were finally restored to their absurdly broken, but data-intact, state.

The overarching lesson here is that when it comes to iCloud-synced data, you cannot count on local data, and worse: you can’t count on local archives. If you care to archive your data, navigate to iCloud.com and use the pertinent export feature from the web site. For example, from iCloud.com’s Contacts interface, click on a contact, then select “Select All”, and then “Export vCard…”.

ExportVcard

Amusingly, downloading this file will probably cause Contacts on your Mac to immediately attempt to import all of the contacts, which of course you will want to decline to do. Apple has a reference page, with detailed instructions for archiving various kinds of iCloud data.

The other lesson of course is you can’t trust Contacts to do a good or even acceptable job merging Contacts. I’ll be looking for another solution on this front. On Twitter, a f waller suggested Smart Merge Pro for iOS, but I tried that and it unfortunately is also blind to the duplicate nature of my cards! I guess something special is making my cards appear non-duplicated to both Contacts and this third-party app.

Update: I figured out why “Look for Duplicates” behaved so poorly: it wasn’t even considering my iCloud-based cards. So when I invoke it in Contacts on my Mac, it evaluates only the ~140 cards that are considered local to my Mac, and completely ignores the ~3000 cards that are synced via iCloud. Unfortunately there is no “Look for Duplicates” on iCloud.com, so what is a Mac-based user, for whom Smart Merge Pro doesn’t work, to do?

I think the way it works is it only considered “On my Mac” cards, if there are any local cards. If all your cards are iCloud based, then the “Look for Duplicates” command seems to work as expected.

Labeled Siri Alarms

I’ve written before that Siri, in spite of its flaws, is improving quickly. To that end, I occasionally challenge myself to think of ways that it might make my repeated tasks even more effortless.

I alternate mornings with my wife, taking either our 4-year-old, Matthew, to school, or our 7-year-old, Henry, to a different school. The responsibilities come with a different wake-up time, so I have two pre-set alarms in my phone: one for 7:00AM, and one for 7:45AM.

On a typical weeknight I set one or the other, either by tapping into the Clock app and toggling it on, or by asking Siri to for example “wake me up at 7:45AM.” It’s smart enough at least to notice the existing alarm, and doesn’t set a redundant one. Today I thought it would be nice to add labels to my alarms, so that when I’m awakened, any doubt about what my responsibilities are will be quickly clarified:

Image of Clock app configured with labeled alarm

Having labeled the alarms, I thought I’d test Siri’s prowess: “Hey Siri, set my Henry School Day alarm.” Sigh. No dice:

Image of Siri interface with request to set an alarm not understood.

Here’s an example where Siri is frustratingly dense about something that seems so obvious, at least in retrospect. All is not lost, though. It turns out that although it doesn’t have a clue what “my Henry School Day alarm” is, it knows full well what “the Henry School Day alarm” is:

Image of Siri interface accepting request to set an alarm by label name.

I’ve filed Radar #26696594 requesting that “Siri should recognize MY alarms as readily as THE alarms”.

Distance Based Reminders

You’re driving down the highway, across the desert, on a long road trip. You see a sign:

Gas 16 Miles

Next Gas 203 Miles

You glance at the fuel gauge and observe that the tank is running low. Your first thought is: “Dang! I better not miss that exit, or I’m hosed.” So you activate your nearest Siri device and speak:

Hey Siri, remind me in 15 miles to get gas.

Okay, I’ll remind you.

Ahh, you relax back into your chair, crank up the Apple Music, rest assured that all will be taken care of. My, isn’t the future great?

45 miles later you’re stuck in the middle of the desert with no gas, no cell coverage, and limited battery life on your stockpile of iOS devices. You look at your Reminders list to figure out what went wrong:

In 15 miles to get gas.

There it is, on the list. Ungrammatical, uncompleted, unhelpful, uncool.

How would this be solved? By introducing a notion of distance-relative reminders in iOS and by extension in Siri. In the same way that Siri allows you set a reminder for a specific time or for a relative time from now, it should offer the same functionality for distance.

There are other scenarios where this kind of position-relative reminder would be helpful, and it sort of plays into the same kinds of reminders currently offered by e.g. “Arriving Home”, etc.

Imagine you’ve headed out for a run, for example, and intend to cover 6 miles. Just lift your watch and speak:

Hey Siri, remind me in 3 miles to turn around and head home.

In any event, Apple could amend Siri so that it recognizes phrases of relative distance, and cops to not being able to help:

Remind me in 3 miles to turn around

I’m sorry, I’m afraid I can’t help you with distance based reminders… (YET!)

I love Siri, and I’m pretty happy with most of what it does. But the possibilities for improvement are literally limitless. (Radar #25728339).

Hey Siri, Don’t Trivialize My Timer

Siri’s dictated timers are a feature I use all the time. Especially given my propensity to be distracted and lose track of short-term time commitments, the ability to blurt out in the kitchen: “Hey Siri, set a timer for one minute,” has saved many a pancake from being burned.

Something that has bothered me about this feature for a long time is the determination Siri has to be lighthearted and downright goofy when creating the timer, when the timer is for a specific time such as one or three minutes.

“Hey Siri, set a timer for three minutes.”

Siri's visual response when asked to set a three-minute timer.

Ha. Ha. Yeah, I’m always cooking an egg when I set a three-minute timer. By contrast, a request to set a two-minute timer is always met with a curt, yet still humanized, “Two minutes and counting.” If you set a timer for one minute? Whoo-ee, you’re in for some sass. Sometimes Siri just says “Your timer is set for one minute,” but more often you’ll hear a quip like “Remember, a watched iPhone never boils.”

I’ve been more irritated by this cuteness after years of using the feature and, I suppose, the frequency with which I set one and three-minute timers. It’s mostly a passing exasperation for me, but it strikes me as an example where emotionally charging a software interaction is a risky proposition.

My one-minute timers are usually for something trivial like pancakes, but what if I were using them in a more fraught scenario? What if one-minute timers play a serious role in the administration of care to a loved one? What if it’s a key interval in a CPR procedure? One of Siri’s cute quips is “The suspense is killing me.” What if the suspense really is killing somebody?

(Radar #23776483)

Siri’s Headphone Tax

I wrote earlier today about Siri’s impressive, instant attentiveness on the iPhone 6s. I remarked that although I had set out to report a bug to Apple, I discovered it was actually a very awesome feature.

Unfortunately, I still have a Siri-related bug to file today. Armed with my knowledge that, as a rule, Siri will begin processing instructions at the moment the home button is pressed, I have been exercising it quite a bit. But after I popped on some headphones and headed out for a walk, I discovered an unfortunate shortcoming: Siri’s instant attentiveness is thwarted by the presence of headphones.

For some reason, if headphones are plugged in, iOS goes through the old-and-busted delay in which you must wait for the audible signal that Siri is ready to listen. The result is that, having gotten used to it being instantly ready, you will push the home button and start talking, only to hear the tell-tale audio signal and realize that it hasn’t actually been listening yet.

I’m hoping this is a bug in which the old mechanism is simply being inappropriately activated while headphones are plugged in. I don’t think there’s anything about activating the audio out through headphones that should inherently limit Siri’s ability to be instantly attentive. In fact, with headphones plugged in I can still get an instant response when I use “Hey Siri” to precede my request.

In summary: Siri starts listening instantaneously on an iPhone 6s, whether you’re in silent or non-silent modes, provides you haven’t made the mistake of plugging in headphones. Filed as Radar #22881933

If It Ain’t Fixed, Break It

I have always kept my phone on silent, and thus come to depend on vibration feedback for a lot of workflow tasks. One such task is invoking Siri by holding the home button, to make a quick inquiry or request.

On my iPhone 6, long-pressing the home button always resulted in a short pause before a pleasant vibration indicating that Siri was ready to listen. I trained myself to wait until that vibration was felt before bothering to speak, lest Siri miss anything important.

On my iPhone 6s, however, there is no such feedback. Apple “broke” it. I was all in a huff this morning to file a bug about this, sure in my knowledge that the usability of the phone had been diminished by removing this feedback. Every time I invoke Siri now, in the absence of vibration feedback, I wait to see the tell-tale animated sound wave detector. I’m never quite sure when Siri is ready for me.

I complained on Twitter about the problem, hoping there was a secret setting that I had missed when restoring my phone. I got lots of commiseration from folks who also miss the feedback, and assurances from others that I simply needed to set my “vibrate on ring” or “vibrate on silent” settings correctly. I appreciate the responses, but they were all wrong. And I’m wrong. We’re all wrong.

Apple “broke” the haptic feedback associated with invoking Siri, by “fixing” the problem that there had ever been any latency before. Have an iPhone 6s or 6s Plus? Go ahead, I dare you: hold down the home button and start talking to Siri. You will not escape its attention. It’s ready to go when you are, so it would be obnoxious of it to impose any contrived delay or to give taptic feedback that is uncalled for. Siri has become a more perfect assistant, and we have to change our habits to accommodate this.

The elimination of latency in Siri’s attentiveness seems related to the fact that Apple have added dedicated functionality to the phone’s M9 chip to allow Siri to remain efficiently at attention:

The integrated M9 works so efficiently and intelligently that Siri is always on and waiting for your voice commands. You can easily activate Siri by saying “Hey Siri” whenever your iPhone 6s is nearby.

The lesson is that sometimes our instinct tells us something has been terribly broken, when it has actually been gloriously fixed. Now you can quickly dictate “Hey Siri remind me to file a bug about Siri feedback,” before quickly amending yourself: “Hey Siri delete the reminder,” and dismiss any perceived obligation you felt to tell Apple just how “buggy” the iPhone is.

SiriScript

Today I faced a long list of alarms on my iPhone, and decided that I wanted to clean them out. The typical iOS “Edit” interface puts a red “delete” button next to each item, and upon tapping it you must then confirm it by tapping the explicit word “delete” at the other end of the item. Suffice to say: for a list of any significant size, this is very tedious.

On a whim, I decided to give Siri a shot at simplifying the process. I long-pressed the home button, and uttered: “delete all my alarms.”

NewImage

Well, isn’t that nice?

I realize that when I am faced with a problem on iOS or watchOS, for which I wish there were an automated, “power user” mechanism to simplify it, I reach for Siri and hope for the best.

In this respect Siri fills the gap that is left by the omission of an automating service such as AppleScript. On a Mac, when I’m faced with a problem like this, I look to Script Editor, and hope that the app is scriptable enough to get the job done. For example, if alarms were a service provided by my Mac (and why aren’t they!?), then I would expect a script like this to complete the task at hand:

tell application "Clock" to delete all alarms

Having AppleScript at my disposal is great, but I am also frustrated that Siri doesn’t live on my Mac. I should be able to invoke the dictation UI (fn-fn keystroke, by default) and ask Siri to “add to my reminders,” or to perform any of the other common tasks I can perform with my phone or watch.

Siri is more limiting than AppleScript, because it can only carry out tasks that Apple’s engineers have predicted that I will want to perform. But it’s also much easier than opening up Script Editor, scrutinizing a scripting dictionary, spending 10 years learning AppleScript, and then writing and running a script.

Ideally, I’d like to have the best of both worlds: the ease of asking Siri to perform complex procedures and the option of extending the catalog of procedures that it knows how to perform. And I’d like this perfect combination of ease and extensibility on all of Apple’s platforms.

Since the debut of the iPhone, people have speculated about whether we would ever see an official solution for automation, along the lines of AppleScript or Automator. I think we’ve actually been seeing it since Apple acquired and integrated Siri. I hope that one day this will culminate into the consistent, extensible solution for automation that I have imagined here.

Microsoft WinObjC

Microsoft appears to be following through on its promise to provide resources to iOS developers that facilitate the porting of apps to Windows.

The project, identified by the code name “Islandwood” earlier this year, has been renamed to Windows Bridge for iOS, and the company is making the source code available.

I had a surprisingly hard time finding the GitHub sources for the project. No news on Microsoft’s developer home page, nor on the Interoperability Bridges blog (oops, not updated since January, 2014). I even searched Microsoft’s GitHub repositories but couldn’t find anything matching “windows bridge ios” or variations.

Finally, I searched Twitter for related news until I found a link to a story that actually linked to the GitHub project.

The project’s famiilar name is WinObjC. And yes, it is on GitHub.

Update: If I knew The Verge’s format a bit better I might have noticed they credit the source, Microsoft’s own Windows blog, which in fact links to the GitHub project and includes the WinObjC.

Six In One

Craig Hockenberry’s “Half-Assed” calls out the disparity between Apple’s Mac and iOS App Stores with respect to app analytics, limiting customer reviews from beta OS releases, and support for beta testing with TestFlight:

Mac developers have never had access to TestFlight, either internally or externally. It’s “coming soon”, and until that day comes, there’s no way to test apps that use the iCloud servers. Which sucks for both the developer and the customer.

For years, I’ve harbored my own resentments about the way Apple seems to treat the Mac App Store as a second-class citizen. One point that has nagged at me since the Mac App Store launched five years ago is the lack of effort Apple makes in promoting these products through social networks. For years, the @AppStore account has been extremely active promoting iOS apps to its huge (now 3.8 Million people!) audience. It’s obviously a priority for Apple to promote the iOS App Store, and their Twitter account does a great job of it.

But there is no Twitter account for the Mac App Store, and the @AppStore account has nearly never mentioned Mac software. (Go ahead, do an advanced Twitter search for “from:AppStore mac“). Around four years ago at WWDC, I asked a group of App Store affiliated engineers what they made of this. They all looked at me blankly, paused, looked at each other blankly, paused, and then shrugged as if to say “Huh, I wonder why we don’t promote the Mac App Store?” I don’t know either! But they were all in a much better position than I to find out or push for a change. Evidently, that hasn’t happened.

The neglect makes sense on one hand: iOS and now watchOS are the new hotness, the platforms that represent the fastest and most culturally significant growth for Apple. They sell the most devices, generate the most revenue, and create the biggest headlines, worldwide. It still makes sense for Apple to prioritize the iOS App Store, but it’s a shame they haven’t done more over the past five years to integrate the systems that power the stores so that benefits to developers for one platform’s store would automatically benefit the developers for the other.

On the other hand, let’s acknowledge that the disparity is not all roses for iOS and weeds for the Mac. iOS developers continue to face obstacles for which we have long enjoyed simple solutions for on the Mac. As Craig points out, we can’t ship a useful beta testing app that fully exercises all of Apple’s locked down services such as iCloud, but what can we do? We can ship arbitrary binaries to an unlimited number of people, who can install and run those apps on whatever devices they choose. How do you like them, ahem, Apples?

And what about the absurd steps iOS developers must take in order to stay up to date with beta releases of the OS? Either they commit themselves to running guaranteed buggy and possibly unusable versions of the OS on their machine “machines,” or else they spend extra money on devices whose only purpose will be to act as testbeds for the risky new OS. Want to maintain backwards compatibility? Better keep multiple iPhones, iPod touches, and iPads, of varying generations handy, but be careful not to update them to a newer OS, as there’s no going back.

On the Mac, we enjoy the ability to erase and reinstall whatever version of the OS we choose, whenever we choose. Furthermore, we can maintain parallel installations of the same or different versions of the OS, on easily switchable partitions of the same disk. Even in the context of a single OS install, we enjoy the ability to test varying user scenarios by configuring test accounts and “Fast-User Switching” between them from the comfort of our Mac’s menu bar. Heck, we can even virtualize whole Macs thanks to VMware, Parallels and VirtualBox. When it comes to testing various configurations affordably and expeditiously, it’s the iOS developers who should be crying to Apple that their priorities are skewed.

I guess it’s lucky the Mac was around for so many years before the dawn of iOS, it’s had time to accumulate many developer-empowering features. Although Apple’s priorities with respect to development resources and marketing seem to be focused on iOS today, we enjoy many privileges on the Mac that I doubt iOS developers will ever see. And to top this off with a bit of true optimism for the future: the weird thing is, Apple keeps improving OS X. I’m sometimes surprised by the amount of attention Apple continues to give to the OS given its apparent relative lack of importance. But I guess Apple is well and truly stocked with a bunch of Mac softies, after all.

There’s a ton of totally vexing behavior that seems to be ill-spirited towards Mac developers, but also a ton that seems to hold iOS developers in low regard. I think this speaks to the likely truth that Apple is, more than anything, under-staffed and not well situated to deploy solutions to both platforms in tandem. It truly is a case of six in one, a half-dozen in the other. But wouldn’t it be great if iOS and Mac developers could each enjoy the benefits of all twelve? I’ll hold out hope that one day Apple will unlock the secret of organizing their efforts so that developers on all their platforms can benefit more or less equally from the technologies the company provides.