Code Monkey home page Code Monkey logo

mscarouselview's Introduction

MSCarouselView

A carousel that allows for different width, different views, and wrapping.

CarouselViewDemo

A contrived demo of 135 strips of UIViews in a carousel, each representing a color in the rainbow spectrum. Wrapping is enabled for maximum scrolling pleasure.

How to Use

MSCarouselView is designed to be used like apple's UITableView. Customization is accomplished by setting the delegate and dataSource.

There are 3 required dataSource methods

- (NSUInteger) numberOfViewsForCarousel:(MSCarouselView *)carouselView;
- (UIView *) carouselView:(MSCarouselView *)carouselView viewForIndex:(NSUInteger)index;
- (CGFloat) carouselView:(MSCarouselView *)carouselView widthForViewAtIndex:(NSUInteger)index;

and one optional dataSource method that lets you control which the left/right insets that determine which views are to be rendered. (this is especially useful if you choose to have clipsToBounds set to NO)

- (CGFloat) bufferInsetForCarouselView:(MSCarouselView *)carouselView;

and two optional delegate method (the delegate protocol extends UIScrollViewDelegate)

- (BOOL) carouselViewShouldWrap:(MSCarouselView *)carouselView;
- (void) carouselView:(MSCarouselView *)carouselView didTapViewAtIndex:(NSUInteger)index;

License

MSCarouselView is available under the MIT License. See LICENSE for more info.

mscarouselview's People

Contributors

bogardon avatar

Stargazers

Komkrit Kawichai avatar Mark Carpenter avatar Josh Wu avatar

Watchers

Eddie Espinal avatar  avatar James Cloos avatar

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.