Skip to content
/ LLRefresh Public

LLRefresh is a pull&push to refresh library written in Swift

License

Notifications You must be signed in to change notification settings

Lves/LLRefresh

Repository files navigation

LLRefresh

  • 用Swift实现下拉刷新,上滑加载更多(LLRefresh is a pull&push to refresh library written in Swift)

Features

  • 下拉刷新(pull to refresh )
  • 上滑加载更多(push to load more)
  • 动画(Animation)
  • 自定义(Custom)

Requirements

  • iOS 8.0+
  • Xcode 8.0+
  • Swift 3.0+

Installation

1. CocoaPods

pod 'LXLRefresh'

2. SourceCode

Usage

引入Module

import LLRefresh

使用时可以使用target或者block

  • Block
//1.0 Init
self.tableView.ll_header =  LLRefreshStateHeader {[weak self] _ in
    sleep(2)
    //3.0 Stop Refreshing
    self?.tableView.ll_header?.endRefreshing()
}
//2.0 Begin refreshing
self.tableView.ll_header?.beginRefreshing()
  • Target
tableView.ll_header = LLRefreshStateHeader(target: self, action: #selector(loadNewData))
tableView.ll_header?.beginRefreshing()
 func loadNewData()  {
    //update data
    sleep(2)
    //end refreshing
    tableView.ll_header?.endRefreshing()
    tableView.reloadData()
  }

具体使用和自定义可以下载demo查看

Demo

  1. Noraml refresh header

normal

  1. Refresh header with BgImage

bgheader

  1. Refresh header with Gif

bgheader

  1. Refresh footer

footer

About

LLRefresh is a pull&push to refresh library written in Swift

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages