Giter Club home page Giter Club logo

swift3.0-xjdragerdemo's Introduction

swift3.0-XJDragerDemo

swift3.0完美侧滑 https://github.com/lishengbing/swift3.0-XJDragerDemo

oc版本链接: https://github.com/lishengbing/XJDragViewController

XJDmain

XJDmain

核心父类: XJDragerViewController

使用说明 01-创建一个主控制器继承自XJDragerViewController即可

注意点: 01-以后在主控制器上添加自定义控件的时候,需要添加到mainView上,而不是添加到view上即可 如:demo中XJViewController中使用同理

02-添加左侧控制器的时候:1-加到leftView上即可 2-需要添加一行代码: //左边添加需要添加这一句: addChildViewController(leftVc)

代码演示:

extension XJViewController { fileprivate func setupUI() { // 01-注意: 只要继承自我的类:XJDragerViewController,以后所有加在view上的视图控件都统统加到mainView上就可以了 mainView.addSubview(navView) navView.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: 64) navView.leftBtn.addTarget(self, action: #selector(leftClick(btn:)), for: .touchUpInside)

// 02-增加左边控制器:同理:左边都是统统加在leftView上就可以了 let leftVc = XJLeftViewController(kTargetRight: kTargetRight) leftView.addSubview(leftVc.view) leftVc.view.frame = CGRect(x: 0, y: 0, width: kTargetRight, height: UIScreen.main.bounds.size.height) // 03-注意:左边添加需要添加这一句 addChildViewController(leftVc) }

@objc fileprivate func leftClick(btn : UIButton) { leftPanClick(btn: btn) } }

友情链接:

swift版本链接 github链接: https://github.com/lishengbing/XJQRCodeToolDemo

链接: https://github.com/lishengbing/swift3.0-XJDragerDemo

my.oschina.com链接: https://my.oschina.net/shengbingli/blog/787809

swift3.0-xjdragerdemo's People

Contributors

lishengbing avatar

Watchers

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