NinaPagerView

Github星跟蹤圖

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);
}

Change Log

v1.6.3

Bug fixes.

v1.6.2

Updated codes for iOS 11,and other improvements.

v1.6.0

Add ninaChosenPage and reload data function.

v1.5.3

Add topTabScrollHidden function.

v1.5.1

Add custom topTab menus function,custom your own topTab!

v1.4.8

Add nina_scrollEnabled and nina_autoBottomLineEnable functions to NinaPagerView,meanwhile try to fix KVO crash in some conditions.

v1.4.6

Fix a bug may cause NinaPagerView in wrong location.

v1.4.5

Fix scrollsToTop conflict issue.

v1.4.3

Add properties for setting colors,now you just set frame,titleArray and vcsArray in init method.

v1.4.2

Add properties for setting topTab's height and title font,what's more,able to set toptab whole underline hidden.

v1.4.1

Fix some bugs and now you need not set navigationBar.translucent to NO,NinaPagerView will do it.

v1.4.0

Change numerous macro definitions to NinaPagerView's properties.More flexible to use NinaPagerView in different situations.

v1.3.0

Add NinaDefaultPageIndex in UIParameter.h to select default page.

v1.2.0

Add LoadWholePage in parameter.h that you can set YES to load all controllers or views at the same time.
New delegate method for NinaPagerView to get current page easily.

v1.1.2

Optimize two-line title and details in SlideBlock.

v1.1.1

NinaSlideBlock support two-line display in NinaPagerView.

v1.1.0

Support navigationBarHidden situation,now you can select navigationBar hidden or not.

v1.0.0

Improves some codes,meanwhile brings some changes for the framework,wish you like it:)
(1) Add a new NinaPagerStyle:NinaPagerStyleStateNormal,it's a style which not has bottomline or sliderblock.You can choose it if needed.
(2) Creating Arrays in Example is changed,more clearly!
(3) TopTab height fasten to 40,if you wanna to change it,please set it in UIParameter.h.
(4) In NinaPagerStyleSliderBlock,now you can set block's cornerRadius by setting in UIParameter.h.

v0.9.1

Add some parameters to toptab's bottomline or slider,now you can set their width and height to the project.

v0.8.1

Fix topTab vertical-scroll in some conditions.

v0.8.0

New selection of topTab style,now you can choose NinaPagerStyleBottomLine and NinaPagerStyleSlideBlock as gifs showed.

v0.7.0

If you think vcs is not comfortable for your project, you can use view arrays to built.Just put views into array~

v0.6.0

Support long-length title.

v0.5.2

You can set titleSize for title animation(compare to origin title),command range between 1 and 1.5.If don't set this,default scale is 1.15.

ninaPagerView.titleScale = 1.5;

v0.5.0

If you wanna create VCs by IB or code by yourself, you can put VCs into array.You can create them like the Example codes.

Licence

This project uses MIT License.

主要指標

概覽
名稱與所有者RamWire/NinaPagerView
主編程語言Objective-C
編程語言Objective-C (語言數: 3)
平台
許可證MIT License
所有者活动
創建於2016-01-23 06:27:50
推送於2020-05-26 03:19:41
最后一次提交2020-05-26 11:19:40
發布數43
最新版本名稱1.6.3 (發布於 2018-06-28 18:14:42)
第一版名稱0.0.1 (發布於 )
用户参与
星數546
關注者數14
派生數70
提交數251
已啟用問題?
問題數0
打開的問題數0
拉請求數0
打開的拉請求數0
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?