Because I have changed BrainMarksWidgets.swift in an attempt to get the user configuration working, this no longer works but, as shown in the screen cap below, an earlier version did result in the lock screen widget appearing in the widget galley. Also working previously: tapping the widget opened the tweet list view for the first category in the categories array.
Right now, after flailing around attempting to add the user configuration aspects, it's all fairly broken. I am submitting the draft PR as a good faith effort and also in hopes of getting some help. Some questions I have:
How do I get list of categories into the widget configuration (in other words, into the Intents extension)?
How do I get the selected category’s image from within the widget?
What should I be doing with Provider inside the Widgets file? What should it conform to and what do I need to add to correct the Xcode errors?
What’s the right way to set up an IntentTimelineProvider?
Nothing right now, since it's broken, but the idea is to have a circular widget that display's the user's choice of Brain Marks Category. When tapped, this widget will open Brain Marks showing the Tweet List view for the selected category. The user can set up a couple of these widgets on her lock screen, each set to display a different category.
How I Tested
(Interpreting as how one would test; this is currently broken)
Launch app in simulator
Command-L to show Lock Screen
Long press on Lock Screen will eventually lead to a screen configuration view where one can add and edit widgets. This was quite slow on my machine but does eventually work.
Add a Brain Marks Lock Screen widget.
Tap the widget to configure, then choose a category.
The widget now displays that category's image.
When tapped, the widget displays that category's list of tweets.
Notes
Mark Powell has offered to pair with me later in the week, so I do intend to come back and finish this properly!
Because I have changed
BrainMarksWidgets.swift
in an attempt to get the user configuration working, this no longer works but, as shown in the screen cap below, an earlier version did result in the lock screen widget appearing in the widget galley. Also working previously: tapping the widget opened the tweet list view for the first category in the categories array.Right now, after flailing around attempting to add the user configuration aspects, it's all fairly broken. I am submitting the draft PR as a good faith effort and also in hopes of getting some help. Some questions I have:
Provider
inside the Widgets file? What should it conform to and what do I need to add to correct the Xcode errors?IntentTimelineProvider
?References
Natascha Fadeeva’s 05 Sep 2022 blog post, [“How to build a configurable widget with WidgetKit and SwiftUI”] (https://tanaschita.com/20220905-how-to-build-a-configurable-widget-with-widgetkit-and-swiftui/)
@FloWritesCode’s video, “Custom Intent Handling (Give User Options to Configure Widget) | WidgetKit Course [6]”
The Apple doc on Making a Configurable Widget
Progress on issue #155
What it Does
Nothing right now, since it's broken, but the idea is to have a circular widget that display's the user's choice of Brain Marks Category. When tapped, this widget will open Brain Marks showing the Tweet List view for the selected category. The user can set up a couple of these widgets on her lock screen, each set to display a different category.
How I Tested
(Interpreting as how one would test; this is currently broken)
Notes
Screenshot