swift3.0完美侧滑
Swift
Latest commit c297c66 Nov 21, 2016 @lishengbing 2
Permalink
Failed to load latest commit information.
swift3.0-侧滑完美 123 Nov 21, 2016
.DS_Store 添加说明 Nov 21, 2016
LICENSE Initial commit Nov 21, 2016
README.md 2 Nov 21, 2016

README.md

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