Giter VIP home page Giter VIP logo

ssstackedpageview's Introduction

SSStackedPageView

Inspired by Passbook App and Reminders App for iOS 7, this is designed to have a stacked page view that uses reusable pages for efficiency. Easily scroll through UIImageViews, UIViews or your custom View with this one do-it-all class.

SSStackedPageView uses a scroll view to manage through your large list of views. By either selecting or dragging the view up, you divide the stack and highlight that view. Each view is customized to the length of the SSStackedPageView. For efficiency, I make use of a reusable array of pages so that scrolling is fast and beautiful.

####Implementation:

This class has the delegate SSStackedViewDelegate that has the following methods:

///method for setting the current page at the index
- (UIView*)stackView:(SSStackedPageView *)stackView pageForIndex:(NSInteger)index;

///total number of pages to present in the stack
- (NSInteger)numberOfPagesForStackView:(SSStackedPageView *)stackView;

///handler for when a page is selected
- (void)stackView:(SSStackedPageView *)stackView selectedPageAtIndex:(NSInteger) index;

All three are required to create the stacked view. The first stackView:pageForIndex is most similar to tableView:rowForIndexPath: in that you'll want to presen tthe view that will be presented for that index. Next is the somewhat trivial numberOfPagesForStackView: which simply informs the StackedPageView how many elements to expect (and how many times stackView:pageForIndex is called).

Lastly, we have stackView:selectedPageAtIndex: method which will be your handler for when the page is selected.

Known Bugs:

  • Rotation brings odd results when pages are reused. Please Fork and Pull request if you find a solution or other bugs.

####Installation:

It's a CocoaPod! You have the choice to fork/clone the project, or you install via Podfile:

pod 'SSStackedPageView', '~> 0.0'

Thanks, and Enjoy!

ssstackedpageview's People

Contributors

plenipotentss avatar

Watchers

James Cloos avatar Kunal Sood 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.