小胖說swift09-------- swift設定MJReflsh

來源:互聯網
上載者:User
import UIKit  class GalleryListViewController:  UIViewController, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout  {      let refreshControl = UIRefreshControl() //下拉重新整理    @IBOutlet weak var collectionView: UICollectionView!      override func viewDidLoad() {        super.viewDidLoad()        self.configureRefresh()     }        //設定下拉和上啦重新整理    func configureRefresh(){        self.collectionView?.header = MJRefreshNormalHeader(refreshingBlock: { () in            print("header")            self.RefreshData()            self.collectionView?.header.endRefreshing()        })                self.collectionView?.footer = MJRefreshAutoFooter(refreshingBlock:            { () in                print("footer")                self.loadData()                self.collectionView?.footer.endRefreshing()        })    }}

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.