这个想法是在 UICollectionView 中有一个搜索视图,并且仍然能够使用拉来刷新 UIRefreshControl。在用户向下滚动 UICollectionView 之前,搜索和 UIRefreshControl 将不可见。
------------------
| Pull To Refresh |
------------------
| Search |
------------------ <--- Above of this line the content is hidden
| A | B |
------------------
| C | D |
------------------
| Footer |
------------------
我已经尝试将 SearchView 实现到 UICollectionView 的部分标题中,但是这样我不能在集合视图的单元格是第一响应者时使用 reloadData。
一个好的解决方案应该能够:
- 在用户输入搜索框时更新 CollectionView 数据源
- 不要乱用 UIRefreshControl 的动画