telly / TLYShyNavBar

Unlike all those arrogant UINavigationBar, this one is shy and humble! Easily create auto-scrolling navigation bars!
MIT License
3.73k stars 426 forks source link

Fix refresh #122

Closed szweier closed 8 years ago

szweier commented 8 years ago

I believe this could be a clean fix for the refresh control issue found here: https://github.com/telly/TLYShyNavBar/issues/99

What it does

This checks to see if any of the subviews of the scrollview being set is of type UIRefreshControl. If it is it sets a new property on the shyscrollviewcontroller equal to that refresh control. If the refreshControl is nil (a scrollview without pull to refresh) the code behaves the same (still calling tly_setInsets), if the refreshControl exists it only calls tly_setInsets if the refreshControl is hidden. I tried to check if the refreshControl was refreshing but that check is too late. This PR will make it so when the pull to refresh appears (user is thinking about refreshing) we will no longer layout the views. It seems to work on my end.

Mazyod commented 8 years ago

Wow, superb work! I never thought of going with that approach, thanks for submitting this. I'll give it a shot, and merge it ASAP. Hopefully then, make a new release with this being the main new feature :D

szweier commented 8 years ago

Awesome, thanks. Yea definitely give it a run through, seems to work well for my situation but seeing other situations tested would be great.

jgrana commented 8 years ago

Tried this out in my project and it works great.

szweier commented 8 years ago

Good to hear. Thanks for trying it out.