[TIMOB-16887] TiAPI: Add an event on TabGroup that fires before a Tab is focused
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-12-12T14:21:54.000+0000 |
Affected Version/s | Release 3.2.2 |
Fix Version/s | n/a |
Components | TiAPI |
Labels | ios |
Reporter | Marcus Olovsson |
Assignee | Unknown |
Created | 2014-04-10T14:41:03.000+0000 |
Updated | 2018-12-12T14:21:54.000+0000 |
Description
I would like to have an event that fires when handleWillShowTab is fired. Currently, the focus-event fires when handleDidShowTab has fired. I would like to do some UI-changes while changing tab, and found that firing an event in handleWillShowTab instead makes it a bit quicker (probably because it's fired before the tab content is rendered?)
As a quick fix I created my own event called "willShowTab", as I'm sure there are different use-cases for events just before and after the tab has changed.
I could not find a reference to handleWillShowTab and handleDidShowTab events. I would appreciate if you can point me to these events in the documentation.
Ah my mistake, it was just a method name I found in TiUITabGroup.m, it seems like it's fired from -(void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
Thanks for your clarification. Can you please describe what user action or change should trigger this event at the application level?
Sorry, I'm not sure I understand the question?
It would be great if you can provide a code sample to show how you will use this event to help your use case.
Okay, in my case I use it to change the tintColor of the TabGroup. When using the current focus event, you definitely notice some lag when the tab has changed, since the views inside has to be redrawn as well (I guess). With this new event the tabgroup changes color before redrawing the inner views, which makes the transition between tabs much smoother.
Moving this feature request to engineering for further evaluation and prioritization. There may be a better way to achieve the same using current events though.
Closing ticket due to the above dialogue. If this is a mistake please feel free to re-open this ticket.