Skip to content

MJRefresh

A drop-in library that adds pull-to-refresh and load-more controls to iOS scroll views.

Stars
13.8k
Forks
3.5k
Licence
MIT
Language
Objective-C
Last update
12 months ago
Type
Library

What it is

MJRefresh is an Objective-C library for iOS apps that adds 'pull down to refresh' and 'load more' controls to scrolling screens like table views, collection views, and web views. Developers use it so they do not have to build these common loading gestures and animations from scratch. The README shows it can be installed with CocoaPods, Carthage, Swift Package Manager, or by copying files manually.

  • Add a pull-down refresh header to a UITableView that loads new data
  • Add a footer that loads more items when the user scrolls to the bottom
  • Show a custom animated image while refreshing, using the GIF header class
  • Localize refresh status text by setting the language in MJRefreshConfig

Great for

  • iOS developers who need standard pull-to-refresh behavior in a table or collection view
  • Teams maintaining Objective-C iOS apps
  • Developers who want to customize refresh animations or text
  • Apps that need localized refresh text, since the README describes dynamic language switching

Not ideal for

  • Developers building only with SwiftUI, since the README is focused on UIKit scroll views and does not mention SwiftUI
  • Projects that need Android or web support, since this is an iOS library
  • Beginners with no iOS experience, since setup and customization assume familiarity with Xcode and UIKit
Step-by-step guide: how to use MJRefreshInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Xcode · CocoaPods, Carthage, or Swift Package Manager

    Install with CocoaPods

    pod 'MJRefresh'

    Install with Carthage

    github "CoderMJLee/MJRefresh"
  2. 2

    Run it

    • Add MJRefresh to your project using CocoaPods, Carthage, or Swift Package Manager.
    • Import the library in your view controller (the README shows #import "MJRefresh.h" for Objective-C).
    • Attach a header or footer to your scroll view, such as a MJRefreshNormalHeader with a refresh block.
    • Run your app in the simulator and pull down on the screen to see the control.
  3. 3

    Get the most out of it

    • Use the GIF header and footer classes to show custom animated images while loading
    • Set MJRefreshConfig.default.language to switch refresh text between languages
    • Use additionalFlipsViews if you need views to flip in right-to-left layouts with a flipped collection view layout
    • Subclass MJRefreshComponent or MJRefreshHeader to build your own refresh control

Downloads

Strengths

  • Installable through common iOS dependency managers (CocoaPods, Carthage, SPM)
  • Supports several scroll view types, including UITableView, UICollectionView, and WKWebView
  • Widely used, with 13,799 GitHub stars and an MIT license

Trade-offs

  • The README is partly outdated in places and includes Chinese-language sections and links to old external blog images
  • Written in Objective-C, which may be less familiar to teams building new apps in Swift
  • Customization beyond the provided controls requires subclassing and reading the class structure documentation

How it compares

ProjectStarsTypeLevelUpdatedBest for
MJRefresh (this)13.8kLibraryintermediate12 months agoiOS developers who need standard pull-to-refresh behavior in a table or collection view
DZNEmptyDataSet12kLibraryintermediate4.3 years agoiOS developers maintaining Objective-C apps that show lists
SDWebImage25.6kLibraryintermediate7 months agoiOS or macOS app developers who need to show remote images in lists or grids
IQKeyboardManager16.6kLibrarybeginner1 months agoiOS app developers building forms or screens with several text inputs
IGListKit13.1kLibraryintermediate13 days agoiOS developers building list or feed screens with UICollectionView
SVProgressHUD12.4kLibrarybeginner8 months agoiOS developers who need a quick loading indicator for a blocking task

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.