After I wrote the post above, I did extensive research. I read Apple’s documentation and quite a few web pages on the topic of App Intents and SwiftUI.
This led me to refactor my app, pulling a couple of vars and a method out of the view, and putting them into model. On the advice of one site, I have chosen the document as the model. This leaves me with one, hopefully not intractable, problem. How do I reference the document from the App Entity and App Intent?
This is not as easy as it might seem. The app is based on the SwiftUI Document Template. As such, the document is created inside the body of the App. The statements called out by the Apple documentation will not work in that environment. So, how do I connect up the document with the App Entity?
Thanks,
Don Carlile
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: