Booky is a work-in-progress, heavily-commented demo app built to explore Apple's new 'App Intents' framework introduced in iOS 16.
This API lets you extend actions from your app into other areas of the OS - for example the Shortcuts app and Siri.
Functionally, Booky is a basic library you can add books to and mark them as read or unread. It's runnable code that is conceptually and structurally similar to the examples provided in WWDC22's 'Dive Into App Intents' session.
Technically, Booky is built using SwiftUI and persists saved books to a local CoreData store. It has only been tested on iPhone but the code should run on iPad (though the UI hasn't been optimised for it yet).
When you first open the app, three dummy books will be added to the library for testing. Please note that the functionality is extremely bare bones. Testing, error handling and localization are all currently absent. Hopefully, however, it'll be a useful playground to help explore some of what the App Intents framework has to offer.
There are some known issues with the app (see 'Known Issues' below) - I'll try and iron these out as the betas progress.
Here are some of the things covered by Booky:
- 5x Shortcut actions
- Foreground & background actions
- Conditional parameter summaries
- Rich confirmation prompts
- Dynamic lookup parameters with thumbnails and subtitles
- Custom entity with queryable properties
- Action library categories
- Custom errors
- Snippet results
Booky has five actions (or 'intents') that it provides to the Shortcuts app:
Add a new book to the library.
This action has properties of various types which support different input options, such as per-word keyboard capitalization.
It displays a SwiftUI 'Snippet' UI (functionally similar to a Homescreen widget) showing a preview of the new book when it completes successfully.
It also outputs a rich custom 'Book' entity for use in the next action.