pun

PunchScrollView

PunchScrollView is a iOS ScrollView framework which works like the UITableView

Showing:

Popularity

Downloads/wk

0

GitHub Stars

131

Maintenance

Last Commit

2yrs ago

Contributors

2

Package

Dependencies

0

License

MIT

Categories

Readme

PunchScrollView

Build Status Cocoapods Version CocoaPods Platform

PunchScrollView is a little UIScrollView subclass for iOS which works like UICollectionView or UITableView Frameworks.

Easy and fast implementation: delegate, dataSource methods and getter are similar to the UITableView. Use the benefits of the NSIndexPath pattern like you already know it from UITableView or UICollectionView. This allows an easy setup in combination with Core Data.

  • Helpful methods, i.e. jump or scroll to a desired page
  • Avoid boilerplate code
  • Save lots of memory with automatic dequeuing
  • Comes with an Example project to demonstrate the usage
  • Infinite scrolling

Example setup in the ViewController

self.scrollView = [[PunchScrollView alloc] init];
self.scrollView.delegate = self;
self.scrollView.dataSource = self;
self.scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[self.view addSubview:self.scrollView];

#pragma mark - PunchScrollViewDataSource

- (NSInteger)numberOfSectionsInPunchScrollView:(PunchScrollView *)scrollView
{
    return 3;
}

- (NSInteger)punchscrollView:(PunchScrollView *)scrollView numberOfPagesInSection:(NSInteger)section
{
    return 3;
}

- (UIView*)punchScrollView:(PunchScrollView*)scrollView viewForPageAtIndexPath:(NSIndexPath *)indexPath
{
    ExamplePageView *page = (ExamplePageView*)[scrollView dequeueRecycledPage];
    if (page == nil)
    {
      //
      // You could also use PunchScrollview as gallery scrollview - just change the size of the desired view
      //
        page = [[ExamplePageView alloc] initWithFrame:self.view.bounds];
        page.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    }

    page.titleLabel.text = [NSString stringWithFormat:@"Page %@ in section %@", @(indexPath.row), @(indexPath.section)];

    return page;
}


Issues

  • Right now there is an issue when turning to landscape since iOS 8 with infinite scrolling (only in rare cases). Layouting is not right for the visible page.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100