• This repository has been archived on 24/Aug/2020
  • Stars
    star
    295
  • Rank 140,902 (Top 3 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created almost 11 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Block-driven paginated scroll view

THIS PROJECT IS NO LONGER MAINTAINED. HERE ARE SOME SUITABLE ALTERNATIVES:


DRPageScrollView

GIF 1

Features

  • Block-driven page setup.
  • Auto Layout friendly.
  • Page reusability Γ  la UITableView reusable cells.

Installation

CocoaPods

pod 'DRPageScrollView'

Manual

Drag and copy all files in the DRPageScrollView folder into your project.

At a glance

Enabling page reusability

Enabling page reusability is ridiculously simple:

pageScrollView.pageReuseEnabled = YES;

Note: pageReuseEnabled is meant to be set to the desired value before adding any pages to the page scroll view.

Adding a page

Using Auto Layout on the subviews is not compulsory, but it's highly recommended. For the sake of simplicity, the example below doesn't contain Auto Layout code.

[pageScrollView addPageWithHandler:^(UIView *pageView) {
    UIView *squareView = [UIView new];
    squareView.backgroundColor = [UIColor redColor];
    squareView.frame = CGRectMake(50, 50, 100, 100);
    
    [pageView addSubview:squareView];
}];

License

DRPageScrollView is available under the MIT license.