pod 'MJRefresh'
import MJRefresh
加載更多
let footView = MJRefreshAutoNormalFooter(refreshingBlock:{ //去加載數據 加載完數據后狀態設置為默認 self.collection_view.mj_footer?.state = .idle //如果加載不到數據可以把狀態設置為 noMoreData,就不會在加載數據了 self.collection_view.mj_footer?.state = .noMoreData }) collection_view.mj_footer = footView collection_view.mj_footer.state = .willRefresh //會調用refreshingBlock加載數據