Skip to content
This repository

View left expanded if pullToRefreshViewShouldStartLoading returns NO #8

anecdotesoftware opened this Issue · 1 comment

2 participants

anecdotesoftware Sam Soffes

You need to change the end of the observeValueForKeyPath body so that expanded isn't always passed true, e.g.

BOOL expand = YES;
// Ask the delegate if it's cool to start loading
if ([_delegate respondsToSelector:@selector(pullToRefreshViewShouldStartLoading:)]) {
    if (![_delegate pullToRefreshViewShouldStartLoading:self]) {
        // Animate back to normal since the delegate said no
        newState = SSPullToRefreshViewStateNormal;
                    expand = NO;

// Animate to the new state
[self _setState:newState animated:YES expanded:expand completion:nil];
Sam Soffes soffes closed this issue from a commit
Sam Soffes Don't stay expanded if it doesn't start loading. Fixes #8
If the delegate returns no from `pullToRefreshViewShouldStartLoading:`, don't expand the view.
Sam Soffes soffes closed this in 42d4d63
Sam Soffes
soffes commented

Good call. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.