Git Product home page Git Product logo

gbinfinitescrollview's People

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

gbinfinitescrollview's Issues

productPurchased:product.productIdentifier can't be captured when demo run and scroll view page index == 0

I added IAP function in - (NSInteger)numberOfPagesInInfiniteScrollView:(GBInfiniteScrollView *)infiniteScrollView, like below

- (GBInfiniteScrollViewPage *)infiniteScrollView:(GBInfiniteScrollView *)infiniteScrollView pageAtIndex:(NSUInteger)index;
{
    . . . . . . Original Demo Code Omitted. . . . . . 

    // added for IAP
    if (index == 0) {
        SKProduct * product = (SKProduct *) [_products objectAtIndex:0];
        BOOL productPurchased = [[SSIAPHelper sharedInstance] productPurchased:product.productIdentifier];
        if (productPurchased) {
            NSLog(@"BOOL is %hhd", productPurchased);
        } else
            NSLog(@"BOOL is %hhd ", productPurchased);
        if (productPurchased) {
            UIAlertView * purchasedAlert = [[UIAlertView alloc] initWithTitle:@"Purchased"
                                                                 message:nil delegate:self
                                                       cancelButtonTitle:@"OK"
                                                       otherButtonTitles:nil];
            purchasedAlert.tag = 100;
            [purchasedAlert show];
        } else {
            UIAlertView * notPurchasedAlert = [[UIAlertView alloc] initWithTitle:@"NOT Purchased"
                                                                 message:nil delegate:self
                                                       cancelButtonTitle:@"Buy"
                                                       otherButtonTitles:@"Cancel", nil];
            notPurchasedAlert.tag = 200;
            [notPurchasedAlert show];
        }
    }
}

Run the demo the first time, definitely, will show NOT Purchased alert view to remind purchase, then buy it. Then sliding to left direction or right and then sliding back to page index == 0, will show Purchased alert view. So, IAP is implemented correctly.

After pressing iPhone Home key, and killing the demo process, then run the demo again, page index == 0 is going to be presented. But, NOT Purchased alert view is also popping out. Putting NSLog there shows productPurchased:product.productIdentifier not get successfully.

The second thing is, tap the Cancel, then sliding to left or right direction, and then sliding back to index == 0, it's popping out the Purchased alert view!

Oops, looks product.productIdentifier can't be retrieved when showing page at index is 0! Do you know why it is? How to fix this?

Appreicated a lot in advance!

pageAtIndex picking up wrong object for page index 0

Hi. I've an NSArray of custom objects i'm using, each of which contains a pointer to either an ALAssets URL or NSURL of photo on the internet. If i

setPageIndex:0
(or do nothing, which i believe defaults the pageIndex to 0)

the first time i call reloadData, the second image in the array gets pulled. This only happens when the pageIndex is 0. My workaround is currently to set the page index to 1, reloadData, then set it to 0 and reloadData

[self.photosInfiniteScrollView setPageIndex:1];
[self.photosInfiniteScrollView reloadData];
[self.photosInfiniteScrollView setPageIndex:0];
[self.photosInfiniteScrollView reloadData];

What i've observed is that with pageIndex:0, a call to reloadData never ends up calling my pageAtIndex method, because of code in GBInfiniteScrollView.m:

  • (GBInfiniteScrollViewPage *)pageAtIndex:(NSUInteger)index
    {
    GBInfiniteScrollViewPage *page = nil;

    NSUInteger visibleIndex = [self.visibleIndices indexOfObject:[NSNumber numberWithUnsignedInteger:index]];

    if (visibleIndex != NSNotFound) {
    page = [self.visiblePages objectAtIndex:visibleIndex];
    } else if (self.infiniteScrollViewDataSource &&
    [self.infiniteScrollViewDataSource respondsToSelector:@selector(infiniteScrollView:pageAtIndex:)]) {
    page = [self.infiniteScrollViewDataSource infiniteScrollView:self pageAtIndex:index];
    }

    return page;
    }

visibleIndex != NSNotFound evaluates to true, so it just pulls objectAtIndex:visibleIndex

That's as far as i've gotten with it; i'm posting now thinking maybe you'll see something sooner than I will, but in the meantime I have the workaround in place, while also trying to understand your code better to further debug it.

Memory management

I'm trying to add more than 500 views in the whole GBInfiniteScrollView.
The views contains just UILabels(No UIImageViews).
I'm getting a crash when reached approximately the 80th view.
Is there any possibility to update the lib to well manage memory leaks?

Thank you very much.

GBInfiniteScrollViewPageStyleImage

I have set the direction to GBAutoScrollDirectionRightToLeft with GBInfiniteScrollViewPageStyleImage, the problem is that when I scroll horizontally it bounces vertically by 20 pixels (the size of the status bar).

Here is my setup:

self.autoScrollDirection = GBAutoScrollDirectionRightToLeft;
self.infiniteScrollView = [[GBInfiniteScrollViewWithPageControl alloc] initWithFrame:self.myView.frame];
self.infiniteScrollView.infiniteScrollViewDataSource = self;
self.infiniteScrollView.infiniteScrollViewDelegate = self;
self.infiniteScrollView.debug = self.debug;
self.infiniteScrollView.verboseDebug = verboseDebug;
self.infiniteScrollView.interval = 4.0f;
self.infiniteScrollView.pageIndex = 0; //131 199 228
self.infiniteScrollView.autoScrollDirection = self.autoScrollDirection;
self.infiniteScrollView.scrollDirection = GBScrollDirectionHorizontal;
self.infiniteScrollView.pageControlViewContainer.hidden = YES;
[self.myView addSubview:self.infiniteScrollView];

[self.infiniteScrollView reloadData];

[self.infiniteScrollView startAutoScroll];

Custom page

Hello, whats the best way to custom page view?

  • (GBInfiniteScrollViewPage *)infiniteScrollView:(GBInfiniteScrollView *)infiniteScrollView pageAtIndex:(NSUInteger)index;

must return GBInfiniteScrollViewPage

Need reset page control while reload data

I found that if I setup a GBInfiniteScrollViewWithPageControl in interface builder, the page control will not showing. The reason is that you only setup the page control when the scroll view move to super view or a user scroll the view. I think maybe the better time to setup the page control is when reload data.

Best Regards

Assertion failure when used with Auto Layout on iOS 7

*** Assertion failure in -[GBInfiniteScrollView layoutSublayersOfLayer:], /SourceCache/UIKit_Sim/UIKit-2935.137/UIView.m:8794
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Auto Layout still required after executing -layoutSubviews. GBInfiniteScrollView's implementation of -layoutSubviews needs to call super.'

Tried adding the [super layoutSubviews] at the end of the the layoutSubviews method and it removed the crash, but I'm not sure if that is the solution

Update minimum pod version to 6.1

I tried to update my app to support 6.1, so I added a GBInfiniteScrollView entry in the pod file, but when updating I have this:
The platform of the target Pods (iOS 6.1) is not compatible with GBInfiniteScrollView (1.0) which has a minimum requirement of iOS 7.0.

Can you please update the pod version to support 6.1 ?

Thank you.

Supporting pull down to refresh, or refresh at the last screen

Hi -- I'm trying to get pull-down to refresh work with this library when you are at the first or last page. Any idea how to get this to work? (The standard libraries like UIRefreshControl or SVPullDownToRefresh don't seem to work as-is because I've got my shouldScrollToPreviousPage and shouldScrollToNextPage return False in both these cases)

Thanks!

auto layout support ?

Hi,

I would like to support auto layout in the next release of my app, but it seems that the scroll view doesn't support it... Do you have any directions for me about that ?

Bug when GBInfiniteScrollView in a controller which is invisible.

I create a GBInfiniteScrollView instance on my viewController A, start AutoScroll, there is also a button on it, when I click it to push a new viewcontroller B, wait for a more than 3(default auto scroll duration is 3 seconds) seconds, click back button the show this viewcontrller A, contentView of GBInfiniteScrollView is blank, what's wrong?

Bottom dots

Hi,
Can you please add the possibility to add bottom dots (like in the UIPageController)?

Thank you very much.

iOS6.1 support?

I'm already using your lib in two of my apps. I'd like to know if it's possible that you modify GBInfiniteScollView to support iOS 6.1. That will be ABSOLUTELY perfect.
Thank you very much.

"Add" not instantly

Not sure this is an issue, but it has such situations.

When view of index = 0 is showing, tap "Add", then sliding the view from left to right, which is supposed to show the new last view just added, index = 1000, but still show the old last view of index = 999. Happens same on when showing view of index = 999, then "add", then sliding, what would be seen is the view of index = 0, instead of view of index = 1000.

If view of index = 998 or = 1, then "add", will show the latest added last view correctly.

Reload current page

When I call reloadData or updateData the current page doesn't update.

How can I solve this?

Thanks.

Error scroll direction

line: 466
expected: [self didScrollToPreviousPage];

if (currentContentOffset.x == [self minContentOffsetX]) {
[self previous];
[self didScrollToNextPage];
} else if (currentContentOffset.x == [self maxContentOffsetX]) {
[self next];
[self didScrollToNextPage];
}

Empty view after returning from another view controller.

When I'm returning from another view controller using [self.navigationController popViewController], I found out, that my scrollView is empty. Only after regular delay next page appears from right, as usual. Method -updateData in -viewDidAppear saves me now, but I think, it's not the best way :) Thank you!

fast scrolling

Hi, good control but:

autoscrolling is very fast, how can i change it?
I'm talking about setContentOffset animation duration (not about property "interval")

"startAutoScroll" memory leak

Hi,
I just want to mention that there is a memory leak on the startAutoScroll method, when I do not choose to auto scroll all is working fine with the app memory, by against, the app memory is going like crazy when "[self.infiniteScrollView startAutoScroll];" is enabled.
Can you please check it. Thanks !

NSLog twice if page index is 0

Just run your demo intactly and found page at index = 0 is to NSLog twice

 Infinite[284:60b] Page at index 0
 Infinite[284:60b] Page at index 0

If just this, ok. But if there is UIAlertView that's going to be put on page at index = 0, the alert view will pop out twice.

How to fix this? Thanks!

How to set different time interval during autoscroll?

Tried to pass a NSTimeInterval value to self.infiniScrollView.interval, but it's constant, not changed according to time settings for different scrolling pages.

My intention is to start auto scroll after "auto scroll" button pressed, then it could auto scroll at a flexible time interval which are linked to every scrolling page, because the shown time of every page is dynamic.

How to do that? Thanks!

Swift code

Does anyone have Swift version using of library?

Update this Cocoapod in pods repo

Howdy,

I'm reviewing my Podfile and noticed the GBInfiniteScrollView in the official pod repo is out of date.

Is it lots of work to update the official pod?

This makes this pod easier to discover

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.