Latest 1.0.0
Homepage https://github.com/krimpedance/KRPullLoader
License MIT
Platforms ios 9.0, requires ARC
Authors

日本語

Version
License
Platform
Download
Carthage compatible
CI Status

Features

  • Easy-to-use
  • Possibles both of pull refresh and load more.

Requirements

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

DEMO

To run the example project, clone the repo, and open KRPullLoaderDemo.xcodeproj from the DEMO directory.

or appetize.io

Installation

KRPullLoader is available through CocoaPods and Carthage.
To install it, simply add the following line to your Podfile or Cartfile:

# CocoaPods
pod "KRPullLoader"
# Carthage
github "Krimpedance/KRPullLoader"

Usage

(see sample Xcode project in /Demo)

Add views

The simplest way:

let refreshView = KRPullLoadView()
refreshView.delegate = self
tableView.addPullLoadableView(refreshView, type: .refresh)

KRPullLoadView is a simple loading view which consists of UIActivityIndicatorView and UILabel.

The change in the state can be watched by the delegate method.

type has .refresh and .loadMore and can add either of UIScrollView’s top and bottom.

Add custom views

You can design loading views freely by making custom UIView in succession to KRPullLoadable protocol

Please refer to KRPullLoadView.swift or HorizontalPullLoadView.swift.

KRPullLoadable

/**
 Handler when KRPullLoaderState value changed.

 - parameter state: New state.
 - parameter type:  KRPullLoaderType.
*/
func didChangeState(_ state: KRPullLoaderState, viewType type: KRPullLoaderType)

KRPullLoaderState

This is enum which shows the state of the scrolling.

.none
  // hides the view.
.pulling(offset: CGPoint, threshold: CGFloat)
  // Pulling.
  // `offset` is pull offset (always <= 0).
  // This state changes to `loading` when `offset` exceeded `threshold`.
.loading(completionHandler: ()->Void)
  // Shows the view.
  // You should call `completionHandler` when some actions have been completed.

Contributing to this project

I’m seeking bug reports and feature requests.

Release Note

  • 1.0.0 : First release.

License

KRPullLoader is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "KRPullLoader",
    "version": "1.0.0",
    "summary": "A 'pull to load' control for UIScrollView(, UITableView, UICollectionView, ...).",
    "description": "KRPullLoader is a 'pull to load' control for UIScrollView(, UITableView, UICollectionView, ...) on iOS.",
    "homepage": "https://github.com/krimpedance/KRPullLoader",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "krimpedance": "[email protected]"
    },
    "requires_arc": true,
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/krimpedance/KRPullLoader.git",
        "tag": "1.0.0"
    },
    "source_files": "KRPullLoader/**/*.swift",
    "pushed_with_swift_version": "3.1"
}

Pin It on Pinterest

Share This