Adds an onTapped method for TabChildItems that can be passed through the property wrapper and indicate whether the tab was just tapped through the isRepeat parameter: false if the tab was just selected and true if it was previously selected and was selected again. The coordinator used along with the tab item is passed to the function for whatever behavior, like popping to the root of a navigation view which I provided in the sample app.
A probable solution to https://github.com/rundfunk47/stinsen/issues/56 is to have an internal notification fire when the tab is repeated and the corresponding view listens to that notification as I don't think that a ScrollView/List or any other information can be grabbed just by being passed a Coordinator or View. I would have to look more into that.
There is a small undesirable behavior where at least a few (3-4) views/coordinators are pushed, and then popToRoot() is called, instead of a single push occurring a few of the views/coordinators pop one at a time. I don't know if this was previous behavior with popToRoot() but was just an observation of mine.
I'm only iffy in the using function on Content by implicitly setting _output and force unwrapping it in onTapped. I just quickly took this shortcut as using is implicitly called when a TabChildItem is created but I would want to move setting _output to init. Let me know if this is requested and I'll readily make the change.
Adds an
onTapped
method forTabChildItem
s that can be passed through the property wrapper and indicate whether the tab was just tapped through theisRepeat
parameter:false
if the tab was just selected andtrue
if it was previously selected and was selected again. The coordinator used along with the tab item is passed to the function for whatever behavior, like popping to the root of a navigation view which I provided in the sample app.A probable solution to https://github.com/rundfunk47/stinsen/issues/56 is to have an internal notification fire when the tab is repeated and the corresponding view listens to that notification as I don't think that a
ScrollView/List
or any other information can be grabbed just by being passed aCoordinator
orView
. I would have to look more into that.There is a small undesirable behavior where at least a few (3-4) views/coordinators are pushed, and then
popToRoot()
is called, instead of a single push occurring a few of the views/coordinators pop one at a time. I don't know if this was previous behavior withpopToRoot()
but was just an observation of mine.I'm only iffy in the
using
function onContent
by implicitly setting_output
and force unwrapping it inonTapped
. I just quickly took this shortcut asusing
is implicitly called when aTabChildItem
is created but I would want to move setting_output
toinit
. Let me know if this is requested and I'll readily make the change.