GIFRefreshControl is a pull to refresh that supports GIF images as track animations.

Overview

GIFRefreshControl

Build Status Cocoapods Compatible Platform iOS Contact

GIFRefreshControl is a pull to refresh that supports GIF images as track animations.

Example 1 Example 2 Example 3

Installation

You have multiple choices here:

  • Copy GIFRefreshControl.swift in your project.
  • Adding it in your Podfile pod 'GIFRefreshControl'

Usage

let url = Bundle.main.url(forResource: "giphy", withExtension: "gif")
let data = Data(contentsOf: url!)

let refreshControl = GIFRefreshControl()
refreshControl.animatedImage = GIFAnimatedImage(data: data!)
refreshControl.contentMode = .scaleAspectFill
refreshControl.addTarget(self, action: #selector(ViewController.refresh(_:)), for: .valueChanged)
tableView.addSubview(refreshControl)

Memory consideration

Right now, the default implementation of GIFAnimatedImage is not optimized for memory. That's why you are able to use your custom implementation by using AnimatedImage (like FLAnimatedImage). AnimatedImage is a protocol that describe what is needed to use it in the refresh control.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

The MIT License (MIT)

Copyright (c) 2015 Kevin Delannoy

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.

You might also like...
Pull-to-refresh animation in UICollectionView with a sticky header flow layout, written in Swift :large_orange_diamond:
Pull-to-refresh animation in UICollectionView with a sticky header flow layout, written in Swift :large_orange_diamond:

ReplaceAnimation Implementation of Zee Young's Dribbble animation (https://dribbble.com/shots/2067564-Replace) Info I really liked Zee Young's animati

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

ESPullToRefresh is an easy-to-use component that give pull-to-refresh and infinite-scrolling implemention for developers.
ESPullToRefresh is an easy-to-use component that give pull-to-refresh and infinite-scrolling implemention for developers.

ESPullToRefresh is an easy-to-use component that give pull-to-refresh and infinite-scrolling implemention for developers.

An easy way to use pull-to-refresh
An easy way to use pull-to-refresh

CRRefresh an easy way to use pull-to-refresh, If you want to customize its UI style, you just need conform the specified protocol. We will not regular

Animated, customizable, and flexible pull-to-refresh framework for faster and easier iOS development.
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 · 中文文档

PullToRefreshSwiftUI - Pull to refresh for SwiftUI
PullToRefreshSwiftUI - Pull to refresh for SwiftUI

PullToRefreshSwiftUI Pull to refresh for SwiftUI. Usage with @State import Swift

✳️ SwiftUI Pull to Refresh (for iOS 13 and iOS 14) package.

Refreshable ✳️ SwiftUI Pull to Refresh (for iOS 13 and iOS 14) package. See complementary article at SwiftUI Pull to Refresh (for iOS 13 and iOS 14).

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

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

Comments
  • Xcode 7 after convert to swift 2 Syntax build error

    Xcode 7 after convert to swift 2 Syntax build error

    Hi,

    I converted the GIFRefreshControl.swift to Swift 2.0 syntax using the Xcode 7 tool. But it is still giving me a build error at one of the line, please let me know if you can help me out as I am not an expert in Swift.

    Line 144 : private lazy var imageView = GIFAnimatedImageView()

    Build Error : Cannot convert value of type 'UIImageView' to specified type 'GIFAnimatedImageView'

    opened by ajinkyashelar 6
  • Usable in Objective-C?

    Usable in Objective-C?

    I tried using this as a pod in my objective-c project. It looks like the animatedImage property is not exposed in the header... I'm just double checking that's the case and that this pod is not fully compatible with objc -- right?

    opened by paulrolfe 6
  • Implementing  GIFRefreshControl with FLAnimatedImageView.

    Implementing GIFRefreshControl with FLAnimatedImageView.

    I want to use FLAnimatedImageView instead of GIFAnimatedImageView in GIFRefreshControl. Is this possible? If yes, could you share any sample code on this.

    opened by tommanuel 0
  • Refresh callback is not called on iPhone6s simulator

    Refresh callback is not called on iPhone6s simulator

    First, awesome plugin! But I've noticed it's hard to get callback called. Even running the demo on iPhone6s simulator, I couldn't manage to get callback called. Tried playing with smaller gif images and sometimes callback is called but I need to pull all the way down to the bottom of the screen.

    Update: This happens when pulling slowly without acceleration. If compared to standard pull to refresh control, it starts animating when you drag more than size height size, event without acceleration

    opened by gtennis 0
Owner
Kevin Delannoy
Kevin Delannoy
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
Elastic pull to refresh for iOS developed in Swift

DGElasticPullToRefresh Elastic pull to refresh compontent developed in Swift Inspired by this Dribbble post: Pull Down to Refresh by Hoang Nguyen Tuto

Danil Gontovnik 3.7k Jan 3, 2023
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
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
A pull-down-to-refresh control for iOS that plays pong, originally created for the MHacks III iOS app

BOZPongRefreshControl A pull-down-to-refresh control for iOS that plays pong Installation It's on CocoaPods! Put pod 'BOZPongRefreshControl' in your P

Ben Oztalay 885 Dec 12, 2022
Fully customizable pull-to-refresh control inspired by Storehouse iOS app

CBStoreHouseRefreshControl What is it? A fully customizable pull-to-refresh control for iOS inspired by Storehouse iOS app ![screenshot1] (https://s3.

Suyu Zhang 4k Jan 6, 2023
Customizable pull-to-refresh control,written in pure Swift.

What is it This project is heavily inspired by CBStoreHouseRefreshControl which is Objective-C implemented. SurfingRefreshControl provides you a chanc

Peiwei 55 Aug 21, 2022
One gesture, many actions. An evolution of Pull to Refresh.

MNTPullToReact MNTPullToReact is an extended evolution of the famous Pull to Refresh interaction. The main idea comes from a unique question: can the

Mention 777 Nov 20, 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
An easy way to use pull-to-refresh.

MJRefresh An easy way to use pull-to-refresh ?? ✍??Release Notes: more details Contents New Features Dynamic i18n Switching SPM Supported Swift Chaini

M了个J 13.7k Jan 6, 2023