iOS MJRefresh的使用 (列表上拉加载更多)

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加载数据