Git Product home page Git Product logo

ninapagerview's Introduction

image Language Build Status Pod Version Carthage compatible Pod Platform SupportΒ  Pod License
πŸ‡¨πŸ‡³δΈ­ζ–‡ζ–‡ζ‘£θ―΄ζ˜Ž

  • NinaPagerView is a segment easy to page your controllers and views.

Features

  • Low coupling,just create your own viewcontrollers or views,that's it!
  • Load your viewcontrollers or views.Not load at the same time.
  • Just one line codes to finish the mission.
  • Edit everything in TopTab as you wish,you can custom your own views here.
  • Not only fits UIViewController,but also fits UIView.
  • Select NinaPagerStyle as you wish.
  • Easily reload titles and objects(views,controllers and xibs).

Preview

image image image image image

Installation

Drop in the Classes folder to your Xcode project.
You can also use cocoapods or Carthage.

Using CocoaPods

Add pod 'NinaPagerView' to your Podfile and run pod install.

pod 'NinaPagerView'

Using Carthage

Add the following line to your Cartfile:

github "RamWire/NinaPagerView"

Usage

You need add 'NinaPagerView.h'(CocoaPods) or <NinaPagerViewCarthage/NinaPagerViewCarthage.h>(Carthage) to your project.Then load the codes:

NinaPagerView *ninaPagerView = [[NinaPagerView alloc] initWithFrame:pagerRect WithTitles:titleArray WithObjects:objects];
[self.view addSubview:ninaPagerView];

That's all!

Other Settings and Tips

  • Numerous properties in NinaPagerView you can set as you wish.
  • NinaPagerView now supports custom topTab menus.Creating your own views into NinaPagerView!(read the Example notes if you wanna to know more)
  • You can set two necessary Array by following codes(please read the Example notes if you wanna to know more).
NSArray *titles = @[
                    @"Dalian",
                    @"Tokyo",
                    @"New York",
                    @"Los Angeles",
                    @"Kyoto",
                    @"Osaka",
                    @"Auckland",
                    @"Miami",
                    @"Houston"
                  ];
NSArray *objects = @[
                      @"FirstView",
                      @"SecondView",
                      @"ThirdView",
                      @"ForthView",
                      @"FifthView",
                      @"SixthView",
                      @"SeventhView",
                      @"EighthView",
                      @"NinthView",
                    ];
  • If your controller doesn't have navigationBar or you hide the navigationBar,you need set nina_navigationBarHidden to YES.
ninaPagerView.nina_navigationBarHidden = YES;
  • Superior limit of creating controllers or views is 10,if wanna more,please modify MaxNums in NinaPagerView.
  • If you need push to the controller which contains NinaPagerView,please make sure your navigationBar's translucent is NO.You can set like this:
self.navigationController.navigationBar.translucent = NO;
  • If you use controllers way, please make sure add subview in viewWillLayoutSubviews method, it's not work in viewDidLoad method, you can find more in demo.

NinaPagerViewDelegate

Memory Management

  • If you care the vcs causes huge memory,please try NinaPagerViewDelegate delegate,default is load recent 5 vcs,others will dealloc.If you scroll to the dealloc page, it will load again.If you don't use the delegate,default is NO.
- (BOOL)deallocVCsIfUnnecessary {
  return YES;
}

Current Page

  • Get current page and objects by the delegate method, you can code here when you need it.
- (void)ninaCurrentPageIndex:(NSInteger)currentPage currentObject:(id)currentObject lastObject:(id)lastObject {
    NSLog(@"Current page is %li",currentPage);
}

Licence

This project uses MIT License.

ninapagerview's People

Contributors

ramwire avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.