UIScrollView-InfiniteScroll alternatives and similar libraries
Based on the "UI" category.
Alternatively, view UIScrollView-InfiniteScroll alternatives based on common mentions on social networks and blogs.
-
Lottie
An iOS library to natively render After Effects vector animations -
IGListKit
A data-driven UICollectionView framework for building fast and flexible lists. -
AsyncDisplayKit
Smooth asynchronous user interfaces for iOS apps. -
MBProgressHUD
MBProgressHUD + Customizations -
IQKeyboardManager
Codeless drop-in universal library allows to prevent issues of keyboard sliding up and cover UITextField/UITextView. Neither need to write any code nor any setup required and much more. -
SVProgressHUD
A clean and lightweight progress HUD for your iOS and tvOS app. -
iCarousel
A simple, highly customisable, data-driven 3D carousel for iOS and Mac OS -
DZNEmptyDataSet
A drop-in UITableView/UICollectionView superclass category for showing empty datasets whenever the view has no content to display -
NVActivityIndicatorView
A collection of awesome loading animations -
animated-tab-bar
:octocat: RAMAnimatedTabBarController is a Swift UI module library for adding animation to iOS tabbar items and icons. iOS library made by @Ramotion -
TTTAttributedLabel
A drop-in replacement for UILabel that supports attributes, data detectors, links, and more -
folding-cell
:octocat: 📃 FoldingCell is an expanding content cell with animation made by @Ramotion -
FSCalendar
A fully customizable iOS calendar library, compatible with Objective-C and Swift -
Material
A UI/UX framework for creating beautiful applications. -
SkeletonView
☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting -
SWTableViewCell
An easy-to-use UITableViewCell subclass that implements a swippable content view which exposes utility buttons (similar to iOS 7 Mail Application) -
MGSwipeTableCell
An easy to use UITableViewCell subclass that allows to display swippable buttons with a variety of transitions. -
LTMorphingLabel
[EXPERIMENTAL] Graceful morphing effects for UILabel written in Swift. -
RESideMenu
iOS 7/8 style side menu with parallax effect. -
JTAppleCalendar
The Unofficial Apple iOS Swift Calendar View. Swift calendar Library. iOS calendar Control. 100% Customizable -
XLPagerTabStrip
Android PagerTabStrip for iOS. -
FlatUIKit
A collection of awesome flat UI components for iOS. -
Texture
Smooth asynchronous user interfaces for iOS apps. -
JVFloatLabeledTextField
UITextField subclass with floating labels - inspired by Matt D. Smith's design: http://dribbble.com/shots/1254439--GIF-Mobile-Form-Interaction?list=users -
ViewAnimator
ViewAnimator brings your UI to life with just one line -
XLForm
XLForm is the most flexible and powerful iOS library to create dynamic table-view forms. Fully compatible with Swift & Obj-C. -
SwiftMessages
A very flexible message bar for iOS written in Swift. -
FSPagerView
FSPagerView is an elegant Screen Slide Library. It is extremely helpful for making Banner View、Product Show、Welcome/Guide Pages、Screen/ViewController Sliders. -
TPKeyboardAvoiding
A drop-in universal solution for moving text fields out of the way of the keyboard in iOS -
SVPullToRefresh
Give pull-to-refresh & infinite scrolling to any UIScrollView with 1 line of code. -
SCLAlertView-Swift
Beautiful animated Alert View. Written in Swift -
SideMenu
Simple side/slide menu control for iOS, no code necessary! Lots of customization. Add it to your project in 5 minutes or less. -
SwipeCellKit
Swipeable UITableViewCell/UICollectionViewCell based on the stock Mail.app, implemented in Swift. -
ComponentKit
A React-inspired view framework for iOS. -
PageMenu
A paging menu controller built from other view controllers placed inside a scroll view (like Spotify, Windows Phone, Instagram) -
Koloda
KolodaView is a class designed to simplify the implementation of Tinder like cards on iOS. -
Alerts & Pickers
Advanced usage of UIAlertController and pickers based on it: Telegram, Contacts, Location, PhotoLibrary, Country, Phone Code, Currency, Date... -
AMScrollingNavbar
Scrollable UINavigationBar that follows the scrolling of a UIScrollView -
Macaw
Powerful and easy-to-use vector graphics Swift library with SVG support -
TextFieldEffects
Custom UITextFields effects inspired by Codrops, built using Swift -
ViewDeck
An implementation of the sliding menu found in various iOS apps. -
SwiftEntryKit
SwiftEntryKit is a presentation library for iOS. It can be used to easily display overlays within your iOS apps. -
Material Components
[In maintenance mode] Modular and customizable Material Design UI components for iOS -
SWRevealViewController
A UIViewController subclass for presenting side view controllers inspired on the FaceBook and Wunderlist apps, done right ! -
expanding-collection
:octocat: ExpandingCollection is an animated material design UI card peek/pop controller. iOS library made by @Ramotion -
TSMessages
💌 Easy to use and customizable messages/notifications for iOS à la Tweetbot -
CSStickyHeaderFlowLayout
UICollectionView replacement of UITableView. Do even more like Parallax Header, Sticky Section Header. Made for iOS 7.
Appwrite - The open-source backend cloud platform
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of UIScrollView-InfiniteScroll or a related project?
README
UIScrollView+InfiniteScroll
Infinite scroll implementation as a category for UIScrollView.
* The content used in demo app is publicly available and provided by hn.algolia.com and Flickr. Both can be inappropriate.
Swizzling
Be aware that this category swizzles setContentOffset
and setContentSize
on UIScrollView
.
CocoaPods
Just add the following line in your Podfile:
pod 'UIScrollView-InfiniteScroll', '~> 1.2.0'
Carthage
Just add the following line in your Cartfile:
github "pronebird/UIScrollView-InfiniteScroll" ~> 1.2.0
Examples
This component comes with example app written in Swift and Objective-C.
If you use CocoaPods you can try it by running:
pod try UIScrollView-InfiniteScroll
Documentation
http://pronebird.github.io/UIScrollView-InfiniteScroll/
Before using module
Objective-C
Import header file in Objective-C:
#import <UIScrollView_InfiniteScroll/UIScrollView+InfiniteScroll.h>
Swift
Add the following line in your bridging header file:
#import <UIScrollView_InfiniteScroll/UIScrollView+InfiniteScroll.h>
Basics
In order to enable infinite scroll you have to provide a handler block using addInfiniteScrollWithHandler
. The block you provide is executed each time infinite scroll component detects that more data needs to be provided.
The purpose of the handler block is to perform asynchronous task, typically networking or database fetch, and update your scroll view or scroll view subclass.
The block itself is called on main queue, therefore make sure you move any long-running tasks to background queue. Once you receive new data, update table view by adding new rows and sections, then call finishInfiniteScroll
to complete infinite scroll animations and reset the state of infinite scroll components.
viewDidLoad
is a good place to install handler block.
Make sure that any interactions with UIKit or methods provided by Infinite Scroll happen on main queue. Use dispatch_async(dispatch_get_main_queue, { ... })
in Objective-C or DispatchQueue.main.async { ... }
in Swift to run UI related calls on main queue.
Many people make mistake by using external reference to table view or collection view within the handler block. Don't do this. This creates a circular retention. Instead use the instance of scroll view or scroll view subclass passed as first argument to handler block.
Objective-C
// setup infinite scroll
[tableView addInfiniteScrollWithHandler:^(UITableView* tableView) {
// update table view
// finish infinite scroll animation
[tableView finishInfiniteScroll];
}];
Swift
tableView.addInfiniteScroll { (tableView) -> Void in
// update table view
// finish infinite scroll animation
tableView.finishInfiniteScroll()
}
Collection view quirks
UICollectionView.reloadData
causes contentOffset to reset. Instead use UICollectionView.performBatchUpdates
when possible.
Objective-C
[self.collectionView addInfiniteScrollWithHandler:^(UICollectionView* collectionView) {
[collectionView performBatchUpdates:^{
// update collection view
} completion:^(BOOL finished) {
// finish infinite scroll animations
[collectionView finishInfiniteScroll];
}];
}];
Swift
collectionView.addInfiniteScroll { (collectionView) -> Void in
collectionView.performBatchUpdates({ () -> Void in
// update collection view
}, completion: { (finished) -> Void in
// finish infinite scroll animations
collectionView.finishInfiniteScroll()
});
}
Start infinite scroll programmatically
You can reuse infinite scroll flow to load initial data or fetch more using beginInfiniteScroll(forceScroll)
. viewDidLoad
is a good place for loading initial data, however absolutely up to you to decide.
When forceScroll
parameter is positive, Infinite Scroll component will attempt to scroll down to reveal indicator view. Keep in mind that scrolling will not happen if user is interacting with scroll view.
Objective-C
[self.tableView beginInfiniteScroll:YES];
Swift
tableView.beginInfiniteScroll(true)
Prevent infinite scroll
Sometimes you need to prevent the infinite scroll from continuing. For example, if your search API has no more results, it does not make sense to keep making the requests or to show the spinner.
Objective-C
[tableView setShouldShowInfiniteScrollHandler:^BOOL (UITableView *tableView) {
// Only show up to 5 pages then prevent the infinite scroll
return (weakSelf.currentPage < 5);
}];
Swift
// Provide a block to be called right before a infinite scroll event is triggered. Return YES to allow or NO to prevent it from triggering.
tableView.setShouldShowInfiniteScrollHandler { _ -> Bool in
// Only show up to 5 pages then prevent the infinite scroll
return currentPage < 5
}
Seamlessly preload content
Ideally you want your content to flow seamlessly without ever showing a spinner. Infinite scroll offers an option to specify offset in points that will be used to start preloader before user reaches the bottom of scroll view.
The proper balance between the number of results you load each time and large enough offset should give your users a decent experience. Most likely you will have to come up with your own formula for the combination of those based on kind of content and device dimensions.
// Preload more data 500pt before reaching the bottom of scroll view.
tableView.infiniteScrollTriggerOffset = 500;
Custom indicator
You can use custom indicator instead of default UIActivityIndicatorView
.
Custom indicator must be a subclass of UIView
and implement the following methods:
- (void)startAnimating;
- (void)stopAnimating;
Objective-C
CustomInfiniteIndicator *infiniteIndicator = [[CustomInfiniteIndicator alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
self.tableView.infiniteScrollIndicatorView = indicator;
Swift
let frame = CGRect(x: 0, y: 0, width: 24, height: 24)
tableView.infiniteScrollIndicatorView = CustomInfiniteIndicator(frame: frame)
Please see example implementation of custom indicator view:
Objective-C: CustomInfiniteIndicator.m
At the moment InfiniteScroll uses indicator's frame directly so make sure you size custom indicator view beforehand. Such views as UIImageView
or UIActivityIndicatorView
will automatically resize themselves so no need to setup frame for them.
Contributors
Please see CHANGES
Attributions
Demo app icon by PixelResort.