Add PullToRefresh using animated GIF to any scrollView with just simple code

Overview

UzysAnimatedGifPullToRefresh

License MIT CocoaPods License MIT

Add PullToRefresh using animated GIF to any scrollView with just simple code

Screenshot

UzysAnimatedGifPullToRefresh features:

  • simple to use.
  • Support CocoaPods.
  • ARC Only (if your project doesn't use ARC , Project -> Build Phases Tab -> Compile Sources Section -> Double Click on the file name Then add -fno-objc-arc to the popup window.)

Information

Installation

  1. UzysAnimatedGifPullToRefresh in your app is via CocoaPods.
  2. Copy over the files libary folder to your project folder

Usage

###Import header.

#import "UIScrollView+UzysAnimatedGifPullToRefresh.h"

Initialize

adding PullToRefreshActionHandler

- (void)viewDidLoad
{
    __weak typeof(self) weakSelf =self;
    [self.tableView addPullToRefreshActionHandler:^{
        typeof(self) strongSelf = weakSelf;
        [strongSelf insertRowAtTop];
    }
    ProgressImagesGifName:@"[email protected]" 
    LoadingImagesGifName:@"[email protected]" 
    ProgressScrollThreshold:60 
    LoadingImageFrameRate:30];
}

programmatically trigger PullToRefresh

[_tableView triggerPullToRefresh];

stop PullToRefresh Activity Animation

[_tableView stopRefreshAnimation];

option

Progress : Animated GIF , Loading : Animated GIF

- (void)addPullToRefreshActionHandler:(actionHandler)handler
                ProgressImagesGifName:(NSString *)progressGifName
                 LoadingImagesGifName:(NSString *)loadingGifName
              ProgressScrollThreshold:(NSInteger)threshold;

Progress : Animated GIF , Loading : UIActivitiyIndicator

- (void)addPullToRefreshActionHandler:(actionHandler)handler
                ProgressImagesGifName:(NSString *)progressGifName
              ProgressScrollThreshold:(NSInteger)threshold;

Progress : Array images , Loading : UIActivitiyIndicator

- (void)addPullToRefreshActionHandler:(actionHandler)handler
                       ProgressImages:(NSArray *)progressImages
              ProgressScrollThreshold:(NSInteger)threshold;

Progress : Array images , Loading : Array images

- (void)addPullToRefreshActionHandler:(actionHandler)handler
                       ProgressImages:(NSArray *)progressImages
                        LoadingImages:(NSArray *)loadingImages
                    ProgressScrollThreshold:(NSInteger)threshold
               LoadingImagesFrameRate:(NSInteger)lframe;

Setup TopInsets for both landscape and portrait.

[self.tableView addTopInsetInPortrait:64 TopInsetInLandscape:52];
// iOS 7 LandScape Navigationbar size 52 , Portrait Navigationbar size 64  

Non Translucent Navigation Controller.

self.navigationController.navigationBar.translucent= NO; 
[self.tableView addTopInsetInPortrait:0 TopInsetInLandscape:0];

Contact

License

Acknowledgements

This application makes use of the following third party libraries:

AnimatedGIFImageSerialization

Copyright (c) 2014 Mattt Thompson (http://mattt.me/)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Example Project Resources From

Comments
  • Memory leak

    Memory leak

    Thanks to provide such a good tool. At first I thought it was AnimatedGIFImageSerialization no update problem, Then I put it to update to the latest 0.2.0 version(no memory leaks), but found that the problem still exists

    opened by bawn 8
  • Issue using it with the library SKSTableView together.

    Issue using it with the library SKSTableView together.

    Hello friend. Congratulations for this great control. I'm having problems when I try to use your control together to another control named SKSTableView. When I pull to refresh, the tableview change the position.

    opened by mariovillamizar 5
  • Auto Layout / Orientation Support?

    Auto Layout / Orientation Support?

    Hey!

    Love this project, implementing it in our next update to an app. I'm wondering if you know if this supports Autolayout/Orientation changes at all?

    Right now I have implemented it in a view using autolayout but the gif is presenting at the left edge of the screen. Change it's center or loading it in viewDidAppear fixes it but the gif doesn't reposition after changing the orientation.

    Am I missing a trick to reposition the gif once constraints have been set / orientation has been changed?

    Thanks so much!

    opened by ay8s 5
  • It doesn't work on page menu view.

    It doesn't work on page menu view.

    I use it on scroll page menu view. (like PageMenu https://github.com/uacaps/PageMenu) It works on 1st page but doesn't work on 2nd+ pages. It just doesn't display images, probably images'x position is wrong. Any Idea? Thanks.

    opened by nagaho 4
  • UINavigationController issue

    UINavigationController issue

    code:[navi.navigationBar setBackgroundImage:[UIImage imageWithColor: [UIColor colorWithWhite:0 alpha:1.0]]] forBarMetrics:UIBarMetricsDefault]; There is a issue, contentOffset.top should be 100,and your codes should not work.When alpha is <=1.0,It should work.

    opened by oyh520200 4
  • Crash on orientationChanged:

    Crash on orientationChanged:

    Hi!

    I installed the version 0.9.6 of the library, and i have a (semi)systematic crash when i rotate the device or the simulator from portrait to landscape and viceversa, with the tableview/collectionview visible.

    I read that this is a bug of the previous version, but the problem persist in this release, with a crash.

    I have this crash log from my Fabric account:

    schermata 2015-09-04 alle 23 51 18

    Thanks, Paolo

    opened by pmusolino 3
  • Prevent orientationChanged been called when only support Portrait

    Prevent orientationChanged been called when only support Portrait

    In my project I don't support any others orientation, except Portrait. But everytime I "rotate" the phone every changes in UIDeviceOrientation and UIInterfaceOrientation, the method orientationChanged: is called.

    That causes my tableView scrolls to top. And that's what I'd like to prevent

    opened by FelipeDocil 3
  • Top inset not being reset after pull to refresh

    Top inset not being reset after pull to refresh

    I added the pull to refresh handler to a UITableView, and sometimes after I pull it down to refresh, the top insets are not reset, which makes my cells to be offset by a constant value. I was able to reproduce this issue in a iPhone 6 running iOS 9.1.

    opened by edufschmidt 1
  • problem frame on ios 8.4

    problem frame on ios 8.4

    I tried to add this library to my table, It worked perfect on ios 7 but when I switch to run on 8.4 I got a problem that uitableview appear an small space on the top. Could anyone help me to solve this?

    opened by DuyKha 1
  • Using tableview instead of UItableviewcontroller

    Using tableview instead of UItableviewcontroller

    //pull to refresh stuff __weak typeof(self) weakSelf =self; [self.postTableView addPullToRefreshActionHandler:^{ [weakSelf insertRowAtTop]; } ProgressImagesGifName:@"[email protected]" LoadingImagesGifName:@"[email protected]" ProgressScrollThreshold:60 LoadingImageFrameRate:30]

    Using this gives an error because weakSelf does not insertRowAtTop method. How would I fix this?

    opened by jianglin612 1
  • Non translucent navigation bar & iOS 8

    Non translucent navigation bar & iOS 8

    Hey,

    I'm trying to use your project with a non-translucent bar on iOS 8 and the tableview insets are not correct. See here : http://cl.ly/image/2P2A3C0H250N and http://cl.ly/image/0R1y2b3S3j2N

    I tried setting the tableview.contentInset to 0 top but the trigger seems to start at 64 (status bar + navigation bar height).

    Using your sample project : • Navigation bar non translucent • addPullToRefreshActionHandler: in viewDidAppear • self.automaticallyAdjustsScrollViewInsets = NO; and self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0); in viewDidLoad

    Thanks !

    opened by gobtronic 1
Owner
Jaehoon Jung
Jaehoon Jung
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
Pull to refresh functionality for any ScrollView in SwiftUI!

SwiftUIPullToRefresh Pull to refresh is a common UI pattern, supported in UIKit via UIRefreshControl. (Un)surprisingly, it's also unavailable in Swift

Gordan Glavaš 185 Dec 29, 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
SwiftUI ScrollView can pull to fresh

FreshScrollView SwiftUI ScrollView can pull to fresh One day, when I were writing a scrollview with a SwiftUI, I suddenly wanted to add a drop-down re

Weiha Wang 1 Dec 12, 2021
SwiftUI ScrollView can pull to fresh

FreshScrollView SwiftUI ScrollView can pull to fresh One day, when I were writing a scrollview with a SwiftUI, I suddenly wanted to add a drop-down re

Weiha Wang 0 Dec 8, 2021
GIFRefreshControl is a pull to refresh that supports GIF images as track animations.

GIFRefreshControl GIFRefreshControl is a pull to refresh that supports GIF images as track animations. Installation You have multiple choices here: Co

Kevin Delannoy 163 Oct 4, 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
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
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
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
The fastest and easiest way to present a UITableView - in 3 lines of code.

Swift Table The fastest and easiest way to present a UITableView - in 3 lines of code. Powered by Generics to present any data type. No need to use th

Benyam Alemu Sood 16 Nov 1, 2022
Play BreakOut while loading - A playable pull to refresh view using SpriteKit

BreakOutToRefresh Play BreakOut while loading - A playable pull to refresh view using SpriteKit BreakOutToRefresh uses SpriteKit to add a playable min

Dominik Hauser 2.5k Dec 29, 2022
Recipe App TableView Using Swift

RecipeApp---TableView Features in Food Recipe App User Login search for recipes View recipe lists View Steps tutorials for recipes Like recipes In app

Hardik 3 Apr 27, 2022
BountyList - A bounty list of One-Piece characters by using tableView

bountyList It shows a bounty list of One-Piece characters by using tableView str

null 0 Jan 18, 2022
Simple refresh control for iOS based on SpriteKit and Core Graphics

RainyRefreshControl Simple refresh control for iOS based on SpriteKit and Core Graphics. Project inspired by concept of Yup Nguyen Installation Instal

Onix-Systems 680 Dec 29, 2022
Async GIF image decoder and Image viewer supporting play GIF images. It just use very less memory.

YLGIFImage Asynchronized GIF image class and Image viewer supporting play/stop GIF images. It just use very less memory. Following GIF usually will co

Yong Li 1.8k Aug 15, 2022
PullToRefresh extension for all UIScrollView type classes with animated text drawing style

PullToRefreshCoreText PullToRefresh extension for all UIScrollView type classes with animated text drawing style Demo Install Manual Copy the files in

Cem Olcay 314 Dec 3, 2022
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.

LoadingShimmer An easy way to add a shimmering effect to any view with just single line of code. It is useful as an unobtrusive loading indicator. Thi

Jogendra 1.4k Jan 4, 2023
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.

LoadingShimmer An easy way to add a shimmering effect to any view with just single line of code. It is useful as an unobtrusive loading indicator. Thi

Jogendra 1.4k Jan 6, 2023