GithubHelp home page GithubHelp logo

mdzahedhossain / shviewpagerexample Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shabib87/shviewpager

0.0 1.0 0.0 397 KB

A simple view pager for iOS. Compatible with iOS 6.0 or later.

License: MIT License

Objective-C 100.00%

shviewpagerexample's Introduction

SHViewPagerExample

  • A simple view pager for iOS. Compatible with iOS 6.0 or later.

##SHViewPager

version 1.0, compatible with iOS 6.0 or, later

Created by shabib hossain on 5/15/14.

Copyright (c) 2014 shabib hossain. All rights reserved.

  • This software is licenced under MIT licence. Please check LICENCE.md for more details.

##How to use:

Take the SHViewPager.h, SHViewPager.m and SHViewPagerController.h, SHViewPagerController.m and add them to your project. You can either, make your desired UIViewController class a subclass of SHViewPagerController or, create the SHViewPager in your code and subview it or, you can outlet it in your xib file. The SHViewPager needs it's datasource and delegate protocol to be implemented. Three datasource methods are required and others are optional.

The required datasource methods are:

// total number of pages to be displayed by the controller
- (NSInteger)numberOfPagesInViewPager:(SHViewPager *)viewPager;
// the viewcontroller that will contain the pages, in most of the cases it will be the same viewcontroller that is acting as the datasource and delegate
// i.e. return value will be 'self'
- (UIViewController *)containerControllerForViewPager:(SHViewPager *)viewPager;
// the viewcontroller that is to be shown as as a page in the pager
- (UIViewController *)viewPager:(SHViewPager *)viewPager controllerForPageAtIndex:(NSInteger)index;

To display the contents, you need to call the instance method reloadData in your desired method block, typically in viewDidLoad.

-Example:

- (void)viewDidLoad
{
    [super viewDidLoad];
    // your code
    [viewPager reloadData];
}

Happy coding :)

Shabib Hossain

May 16, 2014

shviewpagerexample's People

Contributors

shabib87 avatar pirocso avatar

Watchers

Md Zahed Hossain 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.