/PXRotatorView

An auto rotating carousel view based on iCarousel

Primary LanguageObjective-CMIT LicenseMIT

PXRotatorView

CI Status Version License Platform

ScreenShot

screenshot

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

First you need to subclass PXRotatorBaseViewModel and implement carousel:viewForItemAtIndex:reusingView: method in where you customize your own view.

Then create a viewModel and set your data source.

Finally create a rotatorView and bind to your viewModel.

You may add a custom pageControl to your rotatorView. I implement one, you can modify it or write your own.

    DKRotatorDemoViewModel *viewModel = [DKRotatorDemoViewModel new];
    viewModel.displayItems = [@[@"Hello",@"Nice",@"to",@"meet",@"you!"] mutableCopy];
    
    PXRotatorView *rotatorView = [[PXRotatorView alloc] initWithFrame:self.view.frame];
    rotatorView.interval = 1;
    [self.view addSubview:rotatorView];

    [rotatorView bindViewModel:viewModel];
    [rotatorView addDefaultPageControl];
    [rotatorView updatePageControl];

Requirements

iCarousel

Installation

PXRotatorView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "PXRotatorView"

Author

drinking, pan49@126.com

License

PXRotatorView is available under the MIT license. See the LICENSE file for more info.