Git Product home page Git Product logo

cfpagesvc's Introduction

image

**.成都冯成林原创,请支持原创,谢谢 --- Charlin Feng

CFPagesVC

Professional Multi controller management Framework based on Swift




Explain:

Multi controller management based on CFPagesVC,Use CFPagesVC You can easily show your custom controller. Here's another version of the OC that I wrote before. CorePagesView: https://github.com/nsdictionary/CorePagesView.

The difference between these two versions is that CorePagesView is based on OC, the use of Scrollview is complete, while the CFPagesVC is based on Swift, and the clever use of CollectionView.




Function display


#### No NavigationController, no TabbarController ![image](./CFPagesVC/show1.gif)



Has NavigationController, no TabbarController

image



No NavigationController, has TabbarController

image



Has NavigationController, has TabbarController

image



More menu items need to be displayed and not to worry about it.

image



Dynamic calculation of menu length.

image



Code page jump control

image

Use



1.Obtain an instance

  let pagesVC = CFPagesVC.getInstance()



2.Data using Closure transfer model

        var titles: [String] = ["已下单","订单","这个是用户的历史订单","库存信息","Massage","所有的订单信息"]
        
        for i in 0..<titles.count{
            
            let orderVC = OrderListVC(nibName: "OrderListVC", bundle: nil)
            
            orderVC.index = i
            
            let pm = CFPagesVC.PagesDataModel(pageVC: orderVC, desc: titles[i])
            
            pageDataModels.append(pm)
        }
        
        pagesVC.pageDataModels = pageDataModels



3. Custom configuration

The default is fully automatic calculation, if you are willing, you can also configure, such as specifying the width and spacing, specify the spacing between the two sides of Scrollview, etc.

    /**  Custom configuration  */
    let configModel = CFPagesVC.PagesConfigModel(useStaticWidthWithBarViewH: 60, leftInset: 40, rightInset: 80, staticWidth: 100)
    pagesVC.pageConfigModel = configModel

Here are two models for you to choose, one is based on the length of the text automatically calculate the length of the menu text, you can specify additional width. The other one is set wide, you can also add additional width.
This class PagesConfigModel is in the CFPagesVC namespace, and he has these properties you can customize:
>.barViewH --- Height of menu bar.
>.leftInset --- The Scrollview menu's left inset.
>.rightInset --- The Scrollview menu's right inset.
>.useStaticWidth --- Use fixed width.
>.barViewH --- Height of menu bar.
>.staticWidth --- Fixed width value of fixed width.
>.btnExtraWidth --- Extra width of menuBtn.



If you want to configure auto width, use

init(useAutoWidthWithBarViewH barViewH: CGFloat,leftInset: CGFloat,rightInset: CGFloat, btnExtraWidth: CGFloat)

If you want to configure the fixed width, use the

init(useStaticWidthWithBarViewH barViewH: CGFloat,leftInset: CGFloat,rightInset: CGFloat, staticWidth: CGFloat)




Life cycle

By using collectionview,CFPagesVC has a strict logical life cycle in managing your custom controller. Inside custom controller, the process of life cycle is printed in console to show the process of switching .


License

This project is made available under the MIT license. See LICENSE.txt for details.




**及西部地区朋友请加


#### 特别群:请西部省市朋友实名加入组织。其他地区朋友请添加2-4群:谢谢。
【西部区域】西部大开发群号: 473185026 -追赶北上广!为振兴西部IT而努力!
热烈欢迎**西部各省市的从事iOS开发朋友实名进群!本群为是聚集西部零散开发者,大家齐心协力共进退!

【全国可加】四群: 347446259
新开,可加!欢迎全国朋友加入组织

【全国可加】三群: 474377358
新开,可加!欢迎全国朋友加入组织

【全国可加】二群: 369870753
WORNING: 已爆满,加不上了

【全国可加】一群:163865401
WORNING: 已爆满,加不上了




Thanks

在此感谢成都iOS开发_Charlin QQ一群小伙伴提供的非常非常热心的英文“改错”帮助,感谢你们!loving you~

.成都-任添糖
.薛定谔的猫
.成都-Eval
.上海-Momo

cfpagesvc's People

Contributors

charlinfeng avatar

Watchers

James Cloos 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.