iClaudius is an iMessage extension that uses the Anthropic Claude API to generate responses to texts as the Roman Emperor.
The extension requires a Claude API key to function. To install it on a device an Apple Developer account is also required.
The iClaudius project demonstrates several components
- Using Swift UI in an iMessage extension by replacing the default Storyboard file
- Constructing a URL request with model selection and other parameters for use with the Anthropic API
- Basic prompt engineering to configure the response personality
- Calling asynchronous functions from within a Swift UI structure
There are some differences in scrolling within the iMessage window, if you're experiencing issues with this, test the Swift UI in a stand alone app first to ensure its functionality.
The UX is outlined below, click an image for the full size version.
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
** iClaudius is not affiliated or related to the "I, Claudius" book or TV series.