As I want to display number of menus on a left side of a screen just like following-it is a new Facebook application.when you click on bar shown as a red square around it,th
You can use InteractiveSideMenu library. It supports interactive opening/closing menu. It supports interactive opening/closing menu and following customization:
You should use 3 basic ViewControllers for creating subclasses for implementing your side menu.
MenuContainerViewController
is a host for menu and content viewsMenuViewController
is a container for menu viewMenuItemContentControlller
is a container for content that corresponds menu itemTo setup your side menu you shoud do 3 things:
MenuViewController
and assing it to menuViewController
propertycontentViewControllers
propertyselectContentViewController(_ selectedContentVC: MenuItemContentViewController)
Here is an example of setup Host controller.
import InteractiveSideMenu
class HostViewController: MenuContainerViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.menuViewController = self.storyboard!.instantiateViewController(withIdentifier: "NavigationMenu") as! MenuViewController
self.contentViewControllers = contentControllers()
self.selectContentViewController(contentViewControllers.first!)
}
private func contentControllers() -> [MenuItemContentViewController] {
//here is instantiation of content view controllers
}
}
You can find more details in the example here.