Which is the best way to create interactive buttons in widgets? I develop widget for todoist/reminder like application. I have browsed all examples, that I could found.
In UITable view my app works perfectly in fullscreen mode. I try to figure out what I can do in widget mode. I have read that middle and big widgets are interactive (it seems that small are not).
As I see the most functional object is ListWidget ? Is it the only way to develop complicated widgets?
May be there are examples of todoist like widgets (icon + strings and active action on string tap)?
AFAIK, yes. At least I haven’t seen any other possibilities. You can add buttons to it and assign tap handlers to them, but only (as you said) for medium and large widgets. For small widgets, you only have a single tap handler for the whole widget, you can’t assign individual ones to buttons.
There’s a whole bunch of widget examples out there, also with tap handlers.
I think I have some troubles with buttons.
Does the only algorithm that work with interactive objects is calling url?
let tapArea = container.addStack()
tapArea.url = 'https://www.google.com'
I have no opportunity to return control inside script to run some logic on text tap?
@simonbs can some buttons running script functions be implemented in scriptable?
You can essentially call functions inside your script or another script as tap targets. Here’s a proof-of-concept.