Giter Club home page Giter Club logo

gearrefreshcontrol's Introduction

CocoaPods Carthage compatible Swift 3.0

A custom animation for the UIRefreshControl. Inspired by this Dribble shot and this tutorial.

Screenshot

GearRefreshControl

Usage

Install through CocoaPods

pod 'GearRefreshControl', '~> 1.0.0'

use_frameworks!

Setup your refreshControl:

override func viewDidLoad() {
    super.viewDidLoad()
    gearRefreshControl = GearRefreshControl(frame: self.view.bounds)
    gearRefreshControl.addTarget(self, action: #selector(ViewController.refresh), for: UIControlEvents.valueChanged)
    self.refreshControl = gearRefreshControl
}

Update state:

override func scrollViewDidScroll(_ scrollView: UIScrollView) {
    gearRefreshControl.scrollViewDidScroll(scrollView)
}

Stop the animation on completion:

self.gearRefreshControl.endRefreshing()

Customization

You can customize the color of the control by setting the gearTintColor property:

gearRefreshControl.gearTintColor = .red

Checkout the sample project for the full implementation.

Author

Andrea Mazzini. I'm available for freelance work, feel free to contact me.

Want to support the development of these free libraries? Buy me a coffee โ˜•๏ธ via Paypal.

Contributors

Thanks to everyone kind enough to submit a pull request.

MIT License

Copyright (c) 2017 Andrea Mazzini. All rights reserved.

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.

gearrefreshcontrol's People

Contributors

andreamazz avatar bryant1410 avatar iaugux avatar readmecritic avatar yoobato avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gearrefreshcontrol's Issues

Editable colors

Nice library. Would it be possible to make the gear colors as well as the background color customizable?

Thanks

Creating a library

This refresh control looks amazing! I love the way the gears are animated and the fluidity of the transition. If possible, could you make a library of this project? I would be very interested

how to build on my iPhone ?

Run it success on my simulator.But run crash on my iPhone .
dyld: Library not loaded: @rpath/Pods_GearAnimation.framework/Pods_GearAnimation
Referenced from: /var/mobile/Containers/Bundle/Application/7C2B1BB8-A967-4E9A-B801-A81AC1E88EB1/GearAnimation.app/GearAnimation
Reason: image not found
(lldb)
How to fix it ?
Thanks.

Manual Installation in Swift 3?

Can this be installed manually without CocoaPods?

I copied over the 3 files from the Source folder, but receiving a lot of errors regarding MainGear : UIView

Swift 3 Support

Hello - would it be possible to add Swift 3 support?

Cheers,

Andrew

TableView appears to jump on iOS 10

When pulling to refresh, everything seems fine until the moment it reaches the threshold when pull to refresh starts. The table view seems to jump up slightly.

This seems to only happen on iOS 10.
Do you know if there is a fix or is this an Apple problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.