项目作者: RockinGarg

项目描述 :
Slide out Menu Customisable with PanGesture and TableView
高级语言: Swift
项目地址: git://github.com/RockinGarg/Slide-Menu-Drawer.git
创建时间: 2018-02-05T05:23:07Z
项目社区:https://github.com/RockinGarg/Slide-Menu-Drawer

开源协议:

下载


Slide-Menu-Drawer

  • Add A Side Menu as Subview in any Controller with some Short required Code
  • Used Nptification observers To handle Response
  • Pan Gesture To move a View, TableView as Side Menu

Side Menu Object

  1. private lazy var sideMenuVCObject: SideMenuVC =
  2. {
  3. // Instantiate View Controller
  4. let viewController = self.storyboard?.instantiateViewController(withIdentifier: "SideMenuVC") as! SideMenuVC
  5. // Add View Controller as Child View Controller
  6. self.addChildViewController(viewController)
  7. return viewController
  8. }()

Adding Object as A Subview

  1. private func add(asChildViewController viewController: UIViewController, baseView: UIView)
  2. {
  3. // Configure Child View
  4. viewController.view.frame = CGRect(x: 0, y: 0, width: baseView.frame.size.width, height: baseView.frame.size.height)
  5. // Add Child View Controller
  6. addChildViewController(viewController)
  7. viewController.view.translatesAutoresizingMaskIntoConstraints = true
  8. // Add Child View as Subview
  9. baseView.addSubview(viewController.view)
  10. // Notify Child View Controller
  11. viewController.didMove(toParentViewController: self)
  12. }

Output ScreenShots

simulator screen shot - iphone 8 plus - 2018-02-05 at 12 13 45