HamzaGhazouani / HGPlaceholders

Nice library to show placeholders and Empty States for any UITableView/UICollectionView in your project
MIT License
2.2k stars 159 forks source link

[Suggestion] The placeholders should not disable the scrolling functionality? #10

Closed sasojadrovski closed 6 years ago

sasojadrovski commented 7 years ago

Hi @HamzaGhazouani,

I was thinking whether it would be nice to have the option to choose whether the placeholders should disable the scrolling functionalities of UITableViews and UICollectionViews.

One good example why I think that sometimes we need to have that one enabled is let's say you want to check for new data by triggering a pull to refresh action. Currently, if an empty state is visible, there is no way you can trigger this action, since the scrolling is disabled.

What are your thoughts on this?

Best regards, Sasho

sasojadrovski commented 6 years ago

@HamzaGhazouani, any thoughts on this?

HamzaGhazouani commented 6 years ago

Hi @sasojadrovski,

Sorry for my late reply. If the TableView has the UIRefreshScroll the scroll is enabled, I should check if it's the case in the CollectionView. If the user would like to refresh we could use the placeholder action button. But I think it can be interesting to keep always the scroll enabled and if the user would like to disable it, he can use directly alwaysBounceVertical = false The disadvantage is that we should do it every time before/after showing any placeholder... May be we can add a new property to ask the user if he would like to have scroll or not when the placeholder is shown...

sasojadrovski commented 6 years ago

Hey @HamzaGhazouani, no worries for the delayed reply, we are all busy with work :) I am super glad that you replied anyway, so kudos to that!

I think that the best option is the last one you've mentioned, adding a new property that can be set by the developer if he would like to allow scrolling when the placeholder is visible. This can be found in dzenbot's DZNEmptyDataSet library where he implemented it as a delegate method (because the entire library was built around delegates), so in your case, a property would be great.

Let me know your thoughts and whether you will be adding this feature soon.

Thanks!

HamzaGhazouani commented 6 years ago

@sasojadrovski Perfect, let's implement that in the next release 🎉

junweimah commented 6 years ago

Hi

Is the scrolling enabled release out?

HamzaGhazouani commented 6 years ago

Hi @junweimah, Not yet this feature will be available in the next release

junweimah commented 6 years ago

@HamzaGhazouani Ok thanks.

HamzaGhazouani commented 6 years ago

Available in HGPlaceholders 0.3.0