ModularSidebarView
ModularSidebarView is a customizable menu for displaying options on the side of the screen for iOS. It is meant to act as a substitute to the usual UINavigation bar items and tool bar items.
Usage
Displaying the SidebarView
First, initialize the SideBarView
Then create some sort of UIButton, UIBarButtonItem or any view with userInteraction enabled. Create the selector and function however you choose.
Dismissing the SidebarView
Simply tap the background view
Or pressing one of the options in the SidebarView will also dismiss on selection if dismissesOnSelection set to TRUE
Adding items to the SidebarView
The SidebarView uses a View-Model approach to laying out items.
You may subclass the default provided classes or conform to the underlying protocol for more customization
Step 1: Creating View-Models
Subclassing the SidebarViewCellModel
, SidebarViewReusableViewSectionModel
and SidebarViewReusableViewModel
Step 2: Creating Views (Cells and ReusableViews)
Subclassing the SidebarViewCell
and SidebarReusableView
Step 3: Inserting the View-Models into the SidebarView
Use these two functions to insert Cell and ReusableView View-Models at desired indexPaths
Example
Extending the SidebarViewDelegate
You may extend the class:
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Requirements
Installation
ModularSidebarView is available through CocoaPods. To install
it, simply add the following line to your Podfile:
Author
ChrishonWyllie, chrishon595@yahoo.com