Giter VIP home page Giter VIP logo

pull-to-refresh.rentals-ios's Introduction

Pull-to-Refresh.Rentals-IOS

This project aims to provide a simple and customizable pull to refresh implementation.

Yalantis

Check this [project on Dribbble] (https://dribbble.com/shots/1650317-Pull-to-Refresh-Rentals)
Check this [project on Behance] (https://www.behance.net/gallery/20411445/Mobile-Animations-Interactions)

alt text

#Installing with CocoaPods

pod 'Pull-to-Refresh.Rentals-IOS', '~> 1.0'

#Usage

For a working implementation, Have a look at the Sample Project - sample

  1. Add folder YALSunnyRefreshControll to your project.
  2. Implement header and setup YALSunnyRefreshControl as a property.
  3. Init and associate YALSunnyRefreshControl with your UITableView or UICollectionView.
  4. Add images from Images.xcassets folder in Sample Project.
#import "YALSunnyRefreshControl.h"

@property (nonatomic,strong) YALSunnyRefreshControl *sunnyRefreshControl;

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupRefreshControl];
}

- (void)setupRefreshControl{
    self.sunnyRefreshControl = [YALSunnyRefreshControl new];
    [self.sunnyRefreshControl addTarget:self
                                 action:@selector(sunnyControlDidStartAnimation)
                       forControlEvents:UIControlEventValueChanged];
    [self.sunnyRefreshControl attachToScrollView:self.tableView];
}

- (void)sunnyControlDidStartAnimation{
    // start loading something
}

- (IBAction)endAnimationHandle{
    [self.sunnyRefreshControl endRefreshing];
}

#Customization

To customize drawables you can change:

  • sun.png - Sun image
  • sky.png - background image
  • buildings.png - foreground image

#Compatibility

  • IOS 7-9

Changelog

Version: 1.0

  • Initial Build

Let us know!

We’d be really happy if you send 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

Copyright 2017, Yalantis

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

pull-to-refresh.rentals-ios's People

Contributors

advantis avatar constantinesafronov avatar crespoxiao avatar darthrumata avatar edbaev avatar jvillella avatar maximletushov avatar mrcompoteee avatar serejahh avatar xhzengaib 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  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

pull-to-refresh.rentals-ios's Issues

End animation issue

If I use dragging to stop the animation, next time I refresh the table by dragging, refreshAction selector doesn't fire. However if I use the end refreshing button than subsequent dragging operation works as expected.

Very glitchy

I got the code to work, but the refreshing is very glitchy. Here is a gif of what happens. Is it because I have a tab bar as well? Here is my code https://giphy.com/gifs/hCalFz32FTXWM

`
func setupRefreshControl() {

    self.sunnyRefreshControl = YALSunnyRefreshControl()
    self.sunnyRefreshControl!.addTarget(self, action: "sunnyControlDidStartAnimation", forControlEvents: .ValueChanged)
    self.sunnyRefreshControl!.attachToScrollView(self.tableView)

}

func sunnyControlDidStartAnimation() {

    nameArray = []
    textArray = []
    userArray = []
    latArray = []
    longArray = []
    timeArray = []
    locTextArray = []
    category = []
    eventID = []
    priceArray = []

    getData()

    tableView.reloadData()

    self.sunnyRefreshControl!.endRefreshing()
}`

Full graphic not displaying

I implemented the library and the issue I have is that the graphic doesn't fully display. I can't get to the sun and only half of the buildings are visible, it gets like "stuck". There is a navigation bar and it looks like it doesn't take that into account.

"invalid task" 如何解决

👎 invalid task ('StripNIB /Users/mr/Library/Developer/Xcode/DerivedData/Baby-emqiljxsmwtxceccytunwzjhswit/Build/Products/Debug-iphonesimulator/Pull-to-Refresh.Rentals-IOS/YALSunnyRefreshControl~iphone.nib') with mutable output but no other virtual output node (in target 'Pull-to-Refresh.Rentals-IOS')

Spinner animation not working on iOS11

I have added the refresh control in a tableview. This was working fine in iOS10 but in iOS11 when I programmatically try to refresh there is a stuck in the animation and I have to manually pull the tableview to make it right.
What might be the problem?

Unexpected animation issues

If your data comes from the server very quickly and thus you call endanimation, then unexpected behaviour starts to appear in the animation for the next time you drag. I noticed that there needs to be at least 1 second of waiting time between calling start and end animation methods. otherwise, it gets clunky. I assume this has to do something with internal animation code which lasts for 1 seconds as in the constants. or maybe it's related to something else.

My work around for now, is that I add 1 seconds delay after data returns from the server to avoid this issue.

How to use for swift?

Anyone have any resources on how to use this in swift? Have made the bridging header but can't seem to work. When I try to import the project I run into this error

screen shot 2018-04-07 at 5 03 59 pm

errr...But Why my Xcode can't find xib?

I have done like MarkDown said, and there's a xib file named "YALSunnyRefreshControl" in pods project, but...
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </var/containers/Bundle/Application/2ED50140-FB9E-45B2-9959-B3238547EBFC/CartController.app> (loaded)' with name 'YALSunnyRefreshControl''

I'm a newbie and Best regard for your reply.
Thanks a lot.

it cannot back.

When I add
[self performSelector:@selector(endAnimationHandle) withObject:nil afterDelay:4.0f];
in sunnyControlDidStartAnimation,

and I pull up in 3.9 second, it stop and no back.

Animation not displaying properly for table view in a view

Hey! Awesome animations! I followed the instructions to set this up as the refresh on one of my screens that has a table view on a view. However, the animation isn't displaying properly. Issues #15 and #6 are similar. Any ideas?

I set the top of the tableview equal to the bottom of the top layout guide and it loads half visible as follows:
screen shot 2015-08-08 at 4 33 17 pm

When I pull down on the table view from there it works properly and looks like this:
screen shot 2015-08-08 at 4 33 37 pm

Here's the code I used to implement it:
screen shot 2015-08-08 at 4 43 49 pm

Thanks!!

UIScrollViewDelegate breaks other connection

I think there is no need to set delegate in the YALSunnyRefreshControl.m because I'm using UITableViewDelegate and UITableDataSource in my main View Controller.
When it sets scrollview delegate it also break off the connection between viewController and tableView.

PS: I tried to solve it at this here I think it works fine.

sunnyControlDidStartAnimation method calls multiple times

When user use refresh sunnyControlDidStartAnimation method calls multiple time. And I need to request to webservice only one time because of performance problem. Thats why thought maybe we can call

#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
[self.target performSelector:self.action withObject:nil]; 

at the

- (void)startRefreshing

method for one call?

纯代码

你好 请问有纯代码版本吗?我用xib拖入发现,对单元格的布局产生问题,导致布局混乱

More than once refresh

If use -[addTarget: action: forControlEvents:] in project(the action is some time-consuming operate like request data from network), it will cause the action called repeatedly so the interface will delay to refresh.

Suggest to use block to call refreah action like:
-(void)beginRefreshing {

[self.scrollView setContentInset:UIEdgeInsetsMake(DefaultHeight, 0.f, 0.f, 0.f)];
[self.scrollView setContentOffset:CGPointMake(0.f, -DefaultHeight) animated:YES];
self.forbidContentInsetChanges = YES;

if (self.refreshBlock) {
    self.refreshBlock();
}

}

removeObserver crashes in YALSunnyRefreshControl.m

Original code was:

-(void)dealloc{

    [self removeObserver:self.scrollView forKeyPath:@"contentOffset"];

}

and it crashed, at least, in my Swift project with this error:

Cannot remove an observer <(null) 0x0> for the key path "contentOffset" 

I changed it to:

-(void)dealloc{

    [self.scrollView removeObserver:self.scrollView forKeyPath:@"contentOffset"];

 }

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.