All Projects → hoangtaiki → Refreshable

hoangtaiki / Refreshable

Licence: MIT License
🌀Pull to refresh and load more function for UIScrollView

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to Refreshable

Tabanimated
A skeleton screen framework based on native for iOS. (一个由iOS原生组件映射出骨架屏的框架,包含快速植入,低耦合,兼容复杂视图等特点,提供国内主流骨架屏动画的加载方案,同时支持上拉加载更多、自定制动画。)
Stars: ✭ 2,909 (+9283.87%)
Mutual labels:  uitableview, pull-to-refresh
Pull To Refresh.rentals Ios
This project aims to provide a simple and customizable pull to refresh implementation. Made in Yalantis
Stars: ✭ 2,171 (+6903.23%)
Mutual labels:  customizable, pull-to-refresh
Pulltorefreshkit
【Deprecated】Pull to refresh in Swift, easy to use, easy to customize(下拉刷新/QQ/淘宝/优酷/雅虎天气/大众点评)
Stars: ✭ 533 (+1619.35%)
Mutual labels:  customizable, pull-to-refresh
SJLineRefresh
pull-to-refresh by line path
Stars: ✭ 36 (+16.13%)
Mutual labels:  customizable, pull-to-refresh
pulse-editor
Tha Platzi Flavored Markdown extensible and customizable editor.
Stars: ✭ 66 (+112.9%)
Mutual labels:  customizable
comet
A minimal and robust BEM-style CSS toolkit.
Stars: ✭ 18 (-41.94%)
Mutual labels:  customizable
NodeKit
surfstudio.github.io/nodekit
Stars: ✭ 27 (-12.9%)
Mutual labels:  customizable
vscode-react-javascript-snippets
Extension for React/Javascript snippets with search supporting ES7+ and babel features
Stars: ✭ 782 (+2422.58%)
Mutual labels:  customizable
react-native-month-picker
This is a month picker to use in react native mobile apps.
Stars: ✭ 16 (-48.39%)
Mutual labels:  customizable
soloalert
A customizable lightweight Alert Library with Material UI and awesome features.
Stars: ✭ 18 (-41.94%)
Mutual labels:  customizable
ml-stack-nav
Customizable, responsive, accessible, easy-to-use multi-level stack navigation menu with slide effect.
Stars: ✭ 20 (-35.48%)
Mutual labels:  customizable
customizable-django-profiler
Customizable cProfileMiddleware for Django
Stars: ✭ 28 (-9.68%)
Mutual labels:  customizable
TableBundle
Symfony Bundle for easy pagination and filtering
Stars: ✭ 24 (-22.58%)
Mutual labels:  customizable
MagiRefresh
swift版下拉刷新,支持多种样式,同时支持,加载动画,网络错误占位(有兴趣学习如何用swift使用runtime的可以看看)
Stars: ✭ 25 (-19.35%)
Mutual labels:  pull-to-refresh
cocoaheads-modernuitableview
Demo project for Modern UITableView Talk
Stars: ✭ 18 (-41.94%)
Mutual labels:  uitableview
LottieSwipeRefreshLayout
Pull to refresh layout that shows a Lottie View.
Stars: ✭ 50 (+61.29%)
Mutual labels:  pull-to-refresh
Obsidian-Harmonic
Harmonic is a minimal and highly customizable theme for Obsidian.md
Stars: ✭ 33 (+6.45%)
Mutual labels:  customizable
WBChainMenu
This will show horizontal menu to a UITableViewCell with chain animation
Stars: ✭ 28 (-9.68%)
Mutual labels:  uitableview
XLRefresh
iOS 下拉刷新工具
Stars: ✭ 25 (-19.35%)
Mutual labels:  uitableview
Transfiguration
Mystical way to transform data into reusable view in Swift
Stars: ✭ 14 (-54.84%)
Mutual labels:  uitableview

Refreshable

Version License Platform Language Build Status

Refreshable is a component that give pull to refresh and load more (infinite scrolling) feature for UIScrollView. By extension to UIScrollView, you can easily add features for any subclass of UIScrollView. Refreshable is developed to you can easily customize its UI style.

Requirements

  • Xcode 9 or later
  • iOS 9.0 or later
  • ARC
  • Swift 4.0 or later

Features

  • Support UIScrollView and its subclasses UICollectionView UITableView UITextView
  • Pull down to refresh and pull up to load more
  • Support customize your own style(s)

Getting Started

CocoaPods

Install with CocoaPods by adding the following to your Podfile:

platform :ios, '9.0'
use_frameworks!
pod 'Refreshable'

Swift Package Manager

Install with Swift Package Manager by adding the following to your Package.swift:

dependencies: [
    .package(url: "https://github.com/hoangtaiki/Refreshable", from: "1.0.0"),
],

Submodules

Or manually checkout the submodule with git submodule add [email protected]:hoangtaiki/Refreshable.git, drag Refreshable.xcodeproj to your project, and add Refreshable as a build dependency.

Usage

Add Pull to refresh

The easiest way to use the pull to refresh feature is use default style from us.

tableView.addPullToRefresh(action: { [weak self] in
    DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
        self?.tableView.stopPullToRefresh()
    }
})

Add if you want to custom UI you just need conform the PullToRefreshDelegate protocol You can refer TextLoadingAnimator we implemented

Add Load more

tableView.addLoadMore(action: { [weak self] in
    DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
       	self?.tableView.stopLoadMore()
    }
})

We support disable load more when no more data

tableView.setLoadMoreEnable(false)

Use with RxSwift

I am a fan of reactive programming. I use RxSwift for my projects. If you want use Refreshable with RxSwift. Create new file with name Refreshable+Rx.swift then copy below code into that file.

import RxSwift
import RxCocoa
import Refreshable

extension Reactive where Base: UIScrollView {
    
    public var refreshing: Binder<Bool> {
        return Binder(base) { scrollView, isShow in
            if isShow {
            	scrollView.startPullToRefresh()
            } else {
                scrollView.stopPullToRefresh()
            }
        }
    }
    
    public var loadingMore: Binder<Bool> {
        return Binder(base) { scrollView, isShow in
            if isShow {
            	scrollView.startLoadMore()
            } else {
                scrollView.stopLoadMore()
            }
        }
    }

}

Contributing

We’re glad you’re interested in Refreshable, and we’d love to see where you take it. If you have suggestions or bug reports, feel free to send pull request or create new issue.

Thanks, and please do take it for a joyride!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].