Code Monkey home page Code Monkey logo

pulltomakesoup's Introduction

PullToMakeSoup Carthage compatible

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

Yalantis

Check this article on our blog to know more details about animations implementation

Inspired by this project on dribble

Requirements

  • iOS 8.0+
  • Xcode 8
  • Swift 3
  • Portrait orientation
github "Yalantis/PullToMakeSoup" ~> 2.0

Installing with CocoaPods

use_frameworks!
pod 'PullToMakeSoup', '~> 2.0'

Usage

At first, import PullToMakeSoup framework:

import PullToMakeSoup

Create refresher:

let refresher = PullToMakeSoup()

Add refresher to your UIScrollView subclass in 'viewDidAppear' method and provide action block:

override func viewDidAppear(animated: Bool) {
    super.viewDidAppear(animated)
    tableView.addPullToRefresh(refresher) {
        // action to be performed (pull data from some source)
    }
}

After the action is completed and you want to hide the refresher:

tableView.endRefreshing()

You can also start refreshing programmatically:

tableView.startRefreshing()

Component was implemented based on customizable pull-to-refresh

Let us know!

We’d be really happy if you sent us links to your projects where you use our component. Just send an email to [email protected] And do let us know if you have any questions or suggestion regarding the animation.

P.S. We’re going to publish more awesomeness wrapped in code and a tutorial on how to make UI for iOS (Android) better than better. Stay tuned!

License

The MIT License (MIT)

Copyright © 2017 Yalantis

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.

pulltomakesoup's People

Contributors

aeugene avatar dharin-shah avatar edbaev avatar egorsobko avatar esetnik avatar gorbannastya avatar katerynazaikina avatar maximletushov avatar mrcompoteee avatar serejahh 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  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

pulltomakesoup's Issues

Adding the framework to app

Whenever I add the import statement to my bridging header it gives me an error reading saying that the files could not be found. Any help please?

Refresh View Offset!

Hi,

After the refresh view starts to refresh it doesn't move at the top of the tableView. It stops there by leaving this offset.
screen shot 2015-09-13 at 3 20 56 pm

Can't find Soupview

public class PullToMakeSoup: PullToRefresh {
public convenience init() {

    let refreshView =  NSBundle(identifier: "Yalantis.PullToMakeSoup")!.loadNibNamed("SoupView", owner: nil, options: nil).first as! SoupView
    let animator =  SoupAnimator(refreshView: refreshView)
    self.init(refreshView: refreshView, animator: animator)
}

}

fatal error: unexpectedly found nil while unwrapping an Optional value

Simultaneous Access issue

Report a bug

In line 98 and 126 of PullToRefresh.swift, the following warning is generated: Simultaneous accesses to 0x104e18828, but modification requires exclusive access

line 98: if (context == &KVOContext && keyPath == contentOffsetKeyPath && object as? UIScrollView == scrollView) {

line 126: else if (context == &KVOContext && keyPath == contentSizeKeyPath && object as? UIScrollView == scrollView) {

I believe this is an issue from Swift 4 monitoring simultaneous access more carefully.

Your Environment

  • Version of the component: 2.0
  • Swift version: 4.1
  • Device: iphone 8
  • Xcode version: 9.4

Stack

   CocoaPods : 1.3.1
        Ruby : ruby 2.3.3p222 (2016-11-21 revision 56859) [universal.x86_64-darwin17]
    RubyGems : 2.5.2
        Host : Mac OS X 10.13.4 (17E199)
       Xcode : 9.4 (9F1027a)
         Git : git version 2.15.1 (Apple Git-101)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ d216389487cda4da0b37deddcb79b5f6373ede58

Installation Source

Executable Path: /usr/local/bin/pod

Plugins

cocoapods-deintegrate : 1.0.2
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.3.0
cocoapods-try         : 1.1.0

Podfile

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

target '' do

  pod 'PullToMakeSoup', '~> 2.0'
end

warning: Could not find remote branch 1.4.0 to clone. fatal: Remote branch 1.4.0 not found in upstream origin

Zafars-iMac:podinstall ZafarAhmad$ pod install
Analyzing dependencies
Downloading dependencies
Installing PullToMakeFlight (1.1.2)
Installing PullToMakeSoup (1.2)
Installing PullToRefresher (1.4.0)

[!] Error installing PullToRefresher
[!] /usr/bin/git clone https://github.com/Yalantis/PullToRefresh.git /var/folders/89/9pzfjxd50bs5_hy39qqm3m8r0000gn/T/d20160804-2979-vq368o --template= --single-branch --depth 1 --branch 1.4.0

Cloning into '/var/folders/89/9pzfjxd50bs5_hy39qqm3m8r0000gn/T/d20160804-2979-vq368o'...
warning: Could not find remote branch 1.4.0 to clone.
fatal: Remote branch 1.4.0 not found in upstream origin

This is my Podfile

Uncomment this line to define a global platform for your project

platform :ios, '8.0'

inhibit_all_warnings!

target 'podinstall' do

Comment this line if you're not using Swift and don't want to use dynamic frameworks

use_frameworks!

Pods for podinstall

target 'podinstallTests' do
pod 'PullToMakeFlight'
pod 'PullToMakeSoup'

# Pods for testing

end

target 'podinstallUITests' do
inherit! :search_paths
# Pods for testing
end

end

Ambiguous use of 'init'

let refresher = PullToMakeSoup() When I add this somewhere in my code, I get that error. Yes I included the import PullToMakeSoup and PullToRefresh. Also, tableView.endRefreshing() is saying: Missing argument for ' at'. How can I fix this?

Animation slides up and hides after releasing the pull handle

I have implemented the code as suggested. Everything works fine except that when I release the pull, the tableview cells and animation both slides up and animation hides behind the navigation bar. How can I keep the animation on screen until it is completed and then slide it up to disappear from the screen?

image not found !!!

2016-06-16 17:04:24.126 SouWang[99009:1017324] Could not load the "circle" image referenced from a nib in the bundle with identifier "org.cocoapods.PullToMakeSoup"
2016-06-16 17:04:24.127 SouWang[99009:1017324] Could not load the "shadow" image referenced from a nib in the bundle with identifier "org.cocoapods.PullToMakeSoup"
2016-06-16 17:04:24.128 SouWang[99009:1017324] Could not load the "cover" image referenced from a nib in the bundle with identifier "org.cocoapods.PullToMakeSoup"
2016-06-16 17:04:24.128 SouWang[99009:1017324] Could not load the "pan" image referenced from a nib in the bundle with identifier "org.cocoapods.PullToMakeSoup"
2016-06-16 17:04:24.129 SouWang[99009:1017324] Could not load the "carrot" image referenced from a nib in the bundle with identifier "org.cocoapods.PullToMakeSoup"
2016-06-16 17:04:24.129 SouWang[99009:1017324] Could not load the "potato" image referenced from a nib in the bundle with identifier "org.cocoapods.PullToMakeSoup"
2016-06-16 17:04:24.130 SouWang[99009:1017324] Could not load the "water" image referenced from a nib in the bundle with identifier "org.cocoapods.PullToMakeSoup"
2016-06-16 17:04:24.130 SouWang[99009:1017324] Could not load the "pea" image referenced from a nib in the bundle with identifier "org.cocoapods.PullToMakeSoup"
2016-06-16 17:04:24.131 SouWang[99009:1017324] Could not load the "Flames0001" image referenced from a nib in the bundle with identifier "org.cocoapods.PullToMakeSoup"

Cocoapod update problems.

Currently trying to upgrade from v1.0 to v1.1. When I try do a build, I get the following error: Could not build module 'PullToMakeSoup'. I am trying to import into an Objective-C controller. When I inspect the selectors, it does reveal the appropriate -Swift.h file, but the build continues to fail. I am using use_frameworks! in my .Podfile.

Any ideas or suggestions? I have tried to clean, rebuild, and clear out Derived Data to no avail.

viewDidAppear

Hi, thanks for such wonderful animation.

I think we need to mention that it only work when the size is determined. Like in viewDidAppear as in the example project

override func viewDidAppear(animated: Bool) {
        super.viewDidAppear(animated)

        tableView.addPullToRefresh(PullToMakeSoup(), action: {
            let delayTime = dispatch_time(DISPATCH_TIME_NOW,
                Int64(5 * Double(NSEC_PER_SEC)))
            dispatch_after(delayTime, dispatch_get_main_queue()) { [unowned self] in
                self.tableView.endRefreshing()
            }
        })
    }

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.