WatchKit: The Text Input and Dictation API is Available!

I spoke at Wearables TechCon about WatchKit last week, and as part of my class, I directed the attendees to the new Apple Watch App Store Apps page to show what is currently possible. After class, one of the attendees asked me about the NPR app, which allows you to “search for specific shows using dictation”. I haven’t heard that the Apple Watch had a dictation API and haven’t looked at the new WatchKit beta, so I just assumed NPR had a private API access.

However, I’ve looked into it some more, and voila, the text input API is in fact available for everyone to use. Of course it is not fully useable yet in the current simulator, but there is an API for it. I created a simple Interface Controller with a button that will bring up the text input controller using this code:

WatchKit Text Input Code

The result is this:

Note that when I click on the Emoji or Microphone button, I get an message that this is not supported in the simulator:

Screen Shot 2015-03-16 at 5.28.37 AM

Also note that using options is not necessary (it’s an optional value). As per Apple’s WatchKit Development Tips:

“If you are using the text input controller to enable dictation, send people directly to dictation without an intermediary sheet by passing no suggestions and setting the text input mode to plain.”

So sadly we can’t really test the dictation yet. But the options do work, so that’s cool. Either way, having an input API for the Apple Watch is pretty huge and opens up a whole set of interactivity with the Watch!

Enjoy the article? Join over 20,000+ Swift developers and enthusiasts who get my weekly updates.

  • amj

    thx a lot 🙂

  • Jason Cramer

    Now that it’s out – has anyone had a chance try this or see how it might work to possibly record things? I’m looking for a simple way to record audio clips directly from the watch’s microphone – and then kind of who care’s about the dictation …nice bonus maybe if it can save both into memory in the app, but the primary thing I’m after is the audio clip.

    • I don’t think you can get the raw audio clip… it gets turned into text for you with this API

      • MikeTradr

        Natasha, great newsletter. I have this working. But I can;t for life of me get the string value I set in the closure out so I can pass it so another function can use it. Can you advise please? or we can discuss or show you somehow if needed. Thank you so much, Mike

  • Dictation works perfectly on my watch. Anyway, I am searching for a way to answer after the dictation, which is possible on a device using AVSpeech.

    Has anyone an idea?

  • NIcky

    Hi, How can i add suggestions on AppleWatch message composer.