Git Product home page Git Product logo

punchscrollview's People

Contributors

lexrus avatar tapwork 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

punchscrollview's Issues

Does not work when added in a xib file.

Because all of the setup is done in initWithFrame:, if created in a xib, nothing gets initialized correctly. Need to add - (void)awakeFromNib and init things.

punchScrollView does not work in UINavigationController

I tried to use punchScrollView in UINavigationController (based on your Example project). When I clicked the Next Page button and got a "EXC BAD_ACCESS" crash.

beak point at " [self loadPages];"

  • (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
    {
    [self loadPages];
    }

Thanks in advance!

Issue with numberOfLazyLoadingPages

Hi, I'm using this repository in my app. In the app I created an interface shows user information using PunchScrollView. In each page of the scrollview, I add 16 "user info cards" as subviews, and 16 buttons(invisible, with UIButtonTypeCustom) above each "user info cards", like this:
1 - 2 - 3 - 4
5 - 6 - 7 - 8
9 -10-11-12
13-14-15-16

The default numberOfLazyLoadingPages is 0, which will make the scrollview load page1 and page2 at beginning, then as user go to page2, the scrollview loads page3, etc...

In my app, page1 and page2 works fine, but in page3, the right most buttons (like the No.4, No.8, No.12, No.16) won't work.
So I tried to set the numberOfLazyLoadingPages to 1, then page1, page2 and page3 works fine, and the right most buttons in page4 still won't work.
And as I change the numberOfLazyLoadingPages to 2, 3, 4...20, the pages loaded at beginning works fine, the late-loaded pages will have bad right-most-buttons.

I like this repository, but I'm a new iOS developer, so I still don't know why this happens.
Hope you may know something helpful, thanks!

issue when reloadData

Hi! I found bug when trying to display different data (defined by segmented button) in the one PunchScrollView.

Steps to reproduce:
1 -(NSInteger)punchscrollView:(PunchScrollView *)scrollView numberOfPagesInSection:(NSInteger)section must return >2.
2 scroll to the not first page.
3 reload with -(NSInteger)punchscrollView:(PunchScrollView *)scrollView numberOfPagesInSection:(NSInteger)section returned 0.
4 reload with -(NSInteger)punchscrollView:(PunchScrollView *)scrollView numberOfPagesInSection:(NSInteger)section returned more than 2.
5. nothing will be displayed.

My propose to fix (lines with changes marked with '!!!'):

  • (void)pageIndexChanged
    {
    NSInteger newPageIndex = NSNotFound;

    [self loadPages];

    if (direction_ == PunchScrollViewDirectionHorizontal)
    {
    CGFloat pageWidth = self.pageSizeWithPadding.width;
    !!! newPageIndex = floor(self.contentOffset.x) / ((floor(pageWidth)==0)?(1):(floor(pageWidth)));
    // was newPageIndex = floor(self.contentOffset.x) / floor(pageWidth); and then we have divide by zero !
    }
    else if (direction_ == PunchScrollViewDirectionVertical)
    {
    CGFloat pageHeight = self.pageSizeWithPadding.height;
    !!! newPageIndex = floor(self.contentOffset.y) / ((floor(pageHeight)==0)?(1):(floor(pageHeight)));
    }
    ...
    }

please add semantic version tags

Thank you for sharing this repo.

I want to add <PunchScrollView> to the CocoaPods package manager repo.

CocoaPods is a tool for managing dependencies for OSX and iOS Xcode projects and provides a central repository for iOS/OSX libraries. This makes adding libraries to a project and updating them extremely easy and it will help users to resolve dependencies of the libraries they use.

However, <PunchScrollView> doesn't have any version tags. I’ve added the current HEAD as version 0.0.1, but a version tag will make dependency resolution much easier.

Semantic version tags (instead of plain commit hashes/revisions) allow for resolution of cross-dependencies.

In case you didn’t know this yet; you can tag the current HEAD as, for instance, version 1.0.0, like so:

$ git tag -a 1.0.0 -m "Tag release 1.0.0"
$ git push --tags

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.