Resolving the user's input

When you create an intents extension, Xcode creates a single main class for your extension, named IntentsExtension. This is the class that serves as an entry point for your extension. It contains a handler(for:) method that returns an instance of Any. The Any type indicates that this method can return virtually anything and the compiler will consider it valid. Whenever you see a method signature like this, you should consider yourself on your own. Being on your own means that the Swift compiler will not help you to validate that you've returned the correct type of object from this method.

In addition to the handler(for:) method, Xcode has generated a lot of sample code to show how you could implement an intent handler. ...

Get Mastering iOS 12 Programming - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.