Git Product home page Git Product logo

wmpagecontroller's Introduction

WMPageController

Platform License CocoaPods Version

An easy solution to page controllers like NetEase News

Overview




And you can easily change styles by setting `menuViewStyle` property: ```objective-c pageController.menuViewStyle = WMMenuViewStyleLine; ``` ## Swift Version Click here: https://github.com/wangmchn/WMPageController-Swift

What's New

  • Now page controller has a cache policy and scroll much more fluently!
  • Add itemMargin and itemsMargins to custom margin between each item, viewFrame to custom controller.view's frame.
  • Add values and keys properties which can help pass values to childControllers through KVC.
  • If items width didn't fill the screen width, WMPageController will calculate width and add gap between each item automatically;
  • Adjust views and frames when device's orientation changed;
  • Set the property itemsWidths to have Different Width! Like @[@(100),@(80),@(50).....];

Basic use

First Drag files in red frame to your project.

Then,create an controller that extends from WMPageController.I recommend to use

- (instancetype)initWithViewControllerClasses:(NSArray *)classes 
                               andTheirTitles:(NSArray *)titles;

to init the controller.Here are two important porperties

classes :contains the classes of view controller, you can put obj in like [UITableViewController class];
titles  :Each View controller's title to show in the menu view at the top of the view;

To have a custom page controller,please set the properties in WMPageController ,They are: titleSize, titleColor, menuHeight, pageAnimatable, menuBGColor, menuItemWidth,rememberLocation,and also itemsWidths.

Pod

pod 'WMPageController'

Note

You can put every controller in WMPageController,But if you want have a UICollectionViewController in, please have an attention to UICollectionViewController's init method.
You should override the - init to give UICollectionViewController a UICollectionViewLayout. Here is an example:

- (instancetype)init {
    // init layout here...
    self = [self initWithCollectionViewLayout:layout];
    if (self) {
        // insert code here...
    }
    return self;
}

License

This project is under MIT License. See LICENSE file for more information.

wmpagecontroller's People

Contributors

wangmchn avatar jeeliu avatar litt1e-p avatar

Watchers

 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.