带搜索标题的UICollectionView和Pull to Refresh

Giu*_*ppe 9 objective-c ios uicollectionview

我们的想法是在UICollectionView中有一个搜索视图,并且仍然可以使用UIRefreshControl来刷新.在用户向下滚动UICollectionView之前,搜索和UIRefreshControl将不可见.

------------------
| Pull To Refresh |
------------------
|      Search     |
------------------    <--- Above of this line the content is hidden
|    A   |   B    |
------------------
|    C   |   D    |
------------------
|     Footer      |
------------------
Run Code Online (Sandbox Code Playgroud)

我已经尝试将SearchView实现到UICollectionView的节头中,但是这样我就不能使用reloadData,而集合视图的单元格是第一个响应者.

一个好的解决方案应该可以:

  • 用户在搜索框中键入时更新CollectionView数据源
  • 不要弄乱UIRefreshControl的动画

Met*_*Say -3

使用scrollView而不是处理CollectionView。对于拉动刷新功能,您可以使用开源https://github.com/kenzan8000/PullRefreshView

  • 为什么不只是“UIRefreshControl”? (2认同)