Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Programmatically changing content offset triggers TLYShyNavBar #5

Closed
koenbud opened this issue Jul 2, 2014 · 5 comments
Closed

Programmatically changing content offset triggers TLYShyNavBar #5

koenbud opened this issue Jul 2, 2014 · 5 comments

Comments

@koenbud
Copy link
Contributor

koenbud commented Jul 2, 2014

I am developing a chat application where I set the content offset programmatically when inserting new rows in chat table view.

TLYShyNavBar trigger when this happens and shortly contracts the navigation bar. Is there a way to solve this?

For instance, temporarily disable ShyNavBar while programmatically changing the content offset or make it trigger only when the user is scrolling.

@Mazyod
Copy link
Contributor

Mazyod commented Jul 2, 2014

@koenbud Off the top of my head, we can check in the scrollViewDidScroll: method if the scrollView is not dragging/tracking nor decelerating, that's a probably a programatic offset.

The problem with this, tho, is when you tap on the status bar. I would assume that is programatic from within the framework, and we do want to update the TLYShyNavBar..

Your solutions might be the only way, to add a freeze state... Or, even better, can you please try setting the contraction/expansion resistance to INFINITY? That should "freeze" the ShyNavBar. If that works, you can submit a PR with a new property called freeze that caches the resistance values in internal variables, and restores them when freeze is set to false. Just probably make sure if the user calls shyNavBarManager.freeze = YES twice, you don't cache the INFINITY value.

Of course, general code style conformation, docs, and testing is highly appreciated!

Let me know if I can help.

@koenbud
Copy link
Contributor Author

koenbud commented Jul 2, 2014

Awesome, thanks for the quick reply. I'll try to take a look in the next couple of days.

@nolanw
Copy link

nolanw commented Jul 7, 2014

@Mazyod the status bar tap comes to the delegate via -scrollViewShouldScrollToTop: and -scrollViewDidScrollToTop: so it shouldn't be an issue to temporarily freeze the ShyNavBar. (Just make sure to take the subsequent scrollview delegate's response to -...ShouldScrollToTop: into account first!)

@Mazyod
Copy link
Contributor

Mazyod commented Jul 7, 2014

@nolanw Interesting point, thanks! Yup, that solves the tapping on statusbar issue.
I think I'll give it a shot!

@Mazyod
Copy link
Contributor

Mazyod commented Nov 15, 2015

I think this was resolved by introducing the disabled property on the manager.

@Mazyod Mazyod closed this as completed Nov 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants