项目作者: RockinGarg
项目描述 :
Slide out Menu Customisable with PanGesture and TableView
高级语言: Swift
项目地址: git://github.com/RockinGarg/Slide-Menu-Drawer.git
- 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
private lazy var sideMenuVCObject: SideMenuVC =
{
// Instantiate View Controller
let viewController = self.storyboard?.instantiateViewController(withIdentifier: "SideMenuVC") as! SideMenuVC
// Add View Controller as Child View Controller
self.addChildViewController(viewController)
return viewController
}()
Adding Object as A Subview
private func add(asChildViewController viewController: UIViewController, baseView: UIView)
{
// Configure Child View
viewController.view.frame = CGRect(x: 0, y: 0, width: baseView.frame.size.width, height: baseView.frame.size.height)
// Add Child View Controller
addChildViewController(viewController)
viewController.view.translatesAutoresizingMaskIntoConstraints = true
// Add Child View as Subview
baseView.addSubview(viewController.view)
// Notify Child View Controller
viewController.didMove(toParentViewController: self)
}
Output ScreenShots
