tapwork / punchscrollview Goto Github PK
View Code? Open in Web Editor NEWPunchScrollView is a iOS ScrollView framework which works like the UITableView
License: MIT License
PunchScrollView is a iOS ScrollView framework which works like the UITableView
License: MIT License
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.
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];"
Thanks in advance!
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!
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)));
}
...
}
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.