- 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
}()
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)
}