PullToRefresh extension for all UIScrollView type classes with animated text drawing style

Overview

PullToRefreshCoreText

PullToRefresh extension for all UIScrollView type classes with animated text drawing style

Demo

alt tag

Install

Manual
Copy the files in the folder named PullToRefreshCoreText to your project.
Import the "UIScrollView+PullToRefreshCoreText.h"

Cocoapods

    source 'https://github.com/CocoaPods/Specs.git'
    pod 'PullToRefreshCoreText', '~> 0.2'

Usage

- (void)addPullToRefreshWithPullText:(NSString *)pullText
                       pullTextColor:(UIColor *)pullTextColor
                        pullTextFont:(UIFont *)pullTextFont
                      refreshingText:(NSString *)refreshingText
                 refreshingTextColor:(UIColor *)refreshingTextColor
                  refreshingTextFont:(UIFont *)refreshingTextFont
                              action:(pullToRefreshAction)action;

It has 2 main texts, pulling and refreshing.
Init function has parameters for creating this texts with its strings, text colors and fonts.
Last parameter is the block function where loading code goes to.

Alternatively I added some other init methods if you want to use same texts or fonts etc.

   - (void)addPullToRefreshWithPullText:(NSString *)pullText
                                 action:(pullToRefreshAction)action;
   
   - (void)addPullToRefreshWithPullText:(NSString *)pullText
                         refreshingText:(NSString *)refreshingText
                                 action:(pullToRefreshAction)action;
   
   - (void)addPullToRefreshWithPullText:(NSString *)pullText
                                   font:(UIFont *)font
                                 action:(pullToRefreshAction)action;
   
   
   - (void)addPullToRefreshWithPullText:(NSString *)pullText
                         refreshingText:(NSString *)refreshingText
                                   font:(UIFont *)font
                                 action:(pullToRefreshAction)action;
   
   
   - (void)addPullToRefreshWithPullText:(NSString *)pullText
                          pullTextColor:(UIColor *)pullTextColor
                         refreshingText:(NSString *)refreshingText
                    refreshingTextColor:(UIColor *)refreshingTextColor
                                   font:(UIFont *)font
                                 action:(pullToRefreshAction)action;

Implementation

//Create ScrollView
self.scrollView = [[UIScrollView alloc] initWithFrame:self.view.frame];
[self.scrollView setContentSize:CGSizeMake(self.view.frame.size.width, self.scrollView.frame.size.height + 1)];
[self.view addSubview:self.scrollView];


//add pull to refresh
__weak typeof(self) weakSelf = self;
[self.scrollView addPullToRefreshWithPullText:@"Pull To Refresh" pullTextColor:[UIColor blackColor] pullTextFont:DefaultTextFont refreshingText:@"Refreshing" refreshingTextColor:[UIColor blueColor] refreshingTextFont:DefaultTextFont action:^{
    [weakSelf loadItems];
}];

One last thing: you should call the [scrollView finishLoading] method after the load finishes.
Otherwise you stuck in refreshing state always.

Credits

Blogs and codes I used for creating this
https://github.com/jrturton/NSString-Glyphs
http://www.codeproject.com/Articles/109729/Low-level-text-rendering
http://ronnqvi.st/controlling-animation-timing/

You might also like...
Add PullToRefresh using animated GIF to any scrollView with just simple code
Add PullToRefresh using animated GIF to any scrollView with just simple code

UzysAnimatedGifPullToRefresh Add PullToRefresh using animated GIF to any scrollView with just simple code UzysAnimatedGifPullToRefresh features: simpl

The application is develop in Objective IOS. kids can draw whatever they want and also kids can save the drawing as well as undo erase the drawing.
The application is develop in Objective IOS. kids can draw whatever they want and also kids can save the drawing as well as undo erase the drawing.

IOSObjC_KidsBoard The application is develop in Objective IOS. kids can draw whatever they want and also kids can save the drawing as well as undo era

SwiftColorArt is a demo application that includes Swift files with all classes and extension necessary to create a font color schema matching to an image
SwiftColorArt is a demo application that includes Swift files with all classes and extension necessary to create a font color schema matching to an image

SwiftColorArt SwiftColorArt is a demo application that includes Swift files with all classes and extension necessary to create a font color schema mat

iOS Simple Cool PullToRefresh Library. It is written in pure swift.
iOS Simple Cool PullToRefresh Library. It is written in pure swift.

PullToRefreshSwift iOS Simple PullToRefresh Library. ##Installation ####CocoaPods pod 'PullToRefreshSwift' ####Manually Add the following files to yo

Type-safe networking abstraction layer that associates request type with response type.

APIKit APIKit is a type-safe networking abstraction layer that associates request type with response type. // SearchRepositoriesRequest conforms to Re

A phantom type is a custom type that has one or more unused type parameters.

PhantomTypes A phantom type is a custom type that has one or more unused type parameters. Phantom types allow you to enforce type-safety without sacri

Animated top menu for UITableView / UICollectionView / UIScrollView written in Swift
Animated top menu for UITableView / UICollectionView / UIScrollView written in Swift

Persei Animated top menu for UITableView / UICollectionView / UIScrollView written in Swift! Made in Yalantis. Check this project on Dribbble Check th

Animated
Animated "Pull To Refresh" Library for UIScrollView.

PullToBounce Animated "Pull To Refresh" Library for UIScrollView. You can add animated "pull to refresh" action to your UIScrollView, UITableView and

Custom animated pull-to-refresh that can be easily added to UIScrollView
Custom animated pull-to-refresh that can be easily added to UIScrollView

PullToMakeSoup Custom animated pull-to-refresh that can be easily added to UIScrollView Check this article on our blog to know more details about anim

Adding ruby style each iterator to Cocoa/Cocoa touch Swift Array and Range classes, And Int.times{} to Int class

Collection-Each Adding ruby style each iterator to Cocoa/Cocoa touch Swift Array, Dictionary and Range classes, and Int.times ###Why? Array/Dictionary

An iOS app to turn typed text into images of handwritten text in your own handwriting style.
An iOS app to turn typed text into images of handwritten text in your own handwriting style.

Text-to-Handwritting © 2021 by Daniel Christopher Long An iOS app to turn typed text into images of handwritten text in your own handwriting style. ht

A simple, declarative, functional drawing framework, in Swift!
A simple, declarative, functional drawing framework, in Swift!

DePict - A simple, declarative, functional drawing framework. To produce a drawing, call the Draw function (just type Draw and let autocomplete do the

CoreMotion Controlled Drawing in 3D Space

SwiftSpace Gyroscope Driven Drawing in 3D Space Companion project to: http://flexmonkey.blogspot.co.uk/2015/08/coremotion-controlled-3d-sketching-on.h

A Fast and Complete Swift Drawing Library

FastDraw A Fast and Complete Swift Drawing Library Description FastDraw is a high performance and highly extensible Drawing Library that supports Appl

A simple, declarative, functional drawing framework, in Swift!
A simple, declarative, functional drawing framework, in Swift!

DePict - A simple, declarative, functional drawing framework. To produce a drawing, call the Draw function (just type Draw and let autocomplete do the

Drawing and Geometry made easy on iOS - now in Swift 3.0

InkKit Swift Support Swift 4.0 InkKit is Swift 4.0 by default, so to use that just include InkKit in your podfile: pod 'InkKit' Swift 3.2 In order to

NXDrawKit is a simple and easy but useful drawing kit for iPhone
NXDrawKit is a simple and easy but useful drawing kit for iPhone

⚠️ To use with Swift 5.0 please ensure you are using = 0.8.0 ⚠️ ⚠️ To use with Swift 4.2 please ensure you are using = 0.7.1 ⚠️ ⚠️ To use with Swift

it's simple drawing app.
it's simple drawing app.

IOSObjC_KidsBoard The application is develop in Objective IOS. kids can draw whatever they want and also kids can save the drawing as well as undo era

it's simple drawing app
it's simple drawing app

IOSObjC_KidsBoard The application is develop in Objective IOS. kids can draw whatever they want and also kids can save the drawing as well as undo era

Comments
  • Fix positioning on orientation change

    Fix positioning on orientation change

    When the orientation changes the width of the PullToRefreshCoreTextView's superview will change. I perform a check for this when the scrollview begins to scroll and update the view's frame and it's layers.

    Additionally, I added a UITableViewController example.

    opened by garfbargle 1
  • Getting more done in GitHub with ZenHub

    Getting more done in GitHub with ZenHub

    Hola! @bitnpc has created a ZenHub account for the cemolcay organization. ZenHub is the leading team collaboration and project management solution built for GitHub.


    How do I use ZenHub?

    To get set up with ZenHub, all you have to do is download the browser extension and log in with your GitHub account. Once you do, you’ll get access to ZenHub’s complete feature-set immediately.

    What can ZenHub do?

    ZenHub adds a series of enhancements directly inside the GitHub UI:

    • Real-time, customizable task boards for GitHub issues;
    • Burndown charts, estimates, and velocity tracking based on GitHub Milestones;
    • Personal to-do lists and task prioritization;
    • “+1” button for GitHub issues and comments;
    • Drag-and-drop file sharing;
    • Time-saving shortcuts like a quick repo switcher.

    Add ZenHub to GitHub

    Still curious? See more ZenHub features or read user reviews. This issue was written by your friendly ZenHub bot, posted by request from @bitnpc.

    ZenHub Board

    opened by bitnpc 0
  • Can't scroll back without dispatch_after()

    Can't scroll back without dispatch_after()

    In ViewController.m

    if using [weakScrollView finishLoading] without dispatch_after, the scrollView can't go back. - (void)loadItems { __weak typeof(UIScrollView *) weakScrollView = self.scrollView; __weak typeof(self) weakSelf = self; // dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, 3 * NSEC_PER_SEC); // dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ // [weakSelf addNewItem]; [weakScrollView finishLoading]; // }); }

    opened by bitnpc 0
  • Potential leak of an object

    Potential leak of an object

    Potential leak of an object Call to function 'CTFontCreateWithName' returns a Core Foundation object with a +1 retain count Object leaked: allocated object is not referenced later in this execution path and has a retain count of +1

    opened by aleksandrshoshiashvili 1
Releases(v0.2)
Owner
Cem Olcay
iOS Developer
Cem Olcay
iOS Simple Cool PullToRefresh Library. It is written in pure swift.

PullToRefreshSwift iOS Simple PullToRefresh Library. ##Installation ####CocoaPods pod 'PullToRefreshSwift' ####Manually Add the following files to yo

Yuji Hato 535 Dec 15, 2022
Animated "Pull To Refresh" Library for UIScrollView.

PullToBounce Animated "Pull To Refresh" Library for UIScrollView. You can add animated "pull to refresh" action to your UIScrollView, UITableView and

Takuya Okamoto 1.9k Dec 5, 2022
Custom animated pull-to-refresh that can be easily added to UIScrollView

PullToMakeSoup Custom animated pull-to-refresh that can be easily added to UIScrollView Check this article on our blog to know more details about anim

Yalantis 1.9k Dec 17, 2022
Give pull-to-refresh & infinite scrolling to any UIScrollView with 1 line of code.

SVPullToRefresh + SVInfiniteScrolling These UIScrollView categories makes it super easy to add pull-to-refresh and infinite scrolling fonctionalities

Sam Vermette 4.9k Dec 1, 2022
Easily add vertical and horizontal pull to refresh to any UIScrollView. Can also add multiple pull-to-refesh views at once.

This is a fork from the famous SVPullToRefresh pod with 2 additional functionalities: Can add multiple pull-to-refresh views into one single UIScrollV

Hoang Tran 42 Dec 28, 2022
Simple way to add parallax header to UIScrollView/UITableView written in Swift.

ParallaxHeader Simple way to add parallax header to UIScrollView or it's subclasses. One image view Slider with images Blur vibrant text Blur round ic

Roman Sorochak 998 Dec 11, 2022
LCPullRefresh - Use UIActivityIndicatorView to provide a pull-to-refresh function for UIScrollView.

LCPullRefresh Use UIActivityIndicatorView to provide a pull-to-refresh function for UIScrollView. Requirements iOS 8.0+ Xcode 11.0+ Usage Pull-up refr

LiuChang 7 Aug 5, 2022
Animated, customizable, and flexible pull-to-refresh framework for faster and easier iOS development.

KafkaRefresh Animated, customizable, and flexible pull-to-refresh framework for faster and easier iOS development. Report bug · Request feature · 中文文档

H. H. Hsiang 1.2k Dec 11, 2022
Stacked style tableview

StackPageView Vertical page view with UIViewControllers stacked on the top of each other Install add StackPageView.swift your project. How to Use clas

noppefoxwolf 33 Jan 13, 2020
A Safari Web Extension to allow auto-refreshing of individual tabs

Safari Web Extension - AutoRefresh See article on Medium. App store download (free and no Ads). There are a few websites that I visit and that time ou

Bing Qiao 4 Jul 18, 2022