- Top, Left, Bottom and Right side positioning
- Easy to use, fully customisable, added slide menus without needing to write tons of code
- Enable to toggle slide menu with a button action.
- Keeps track of x, y point while dragging slide menu.
- Supports continuous swiping between side menus on 4 sides in a single gesture.
Add the MultiSlideMenuViewController.swift to your project manually (drag & drap the file into your project).
- Please add a file subclassed of
MultiSlideMenuViewController
class ViewController: MultiSlideMenuViewController {
- Initialize
SlideMenuView
with position and bounds, then pass the views to thesuper.setupSlideMenus(views: )
. That's all!
// Sets up left slide menu
let sideMenu = SlideMenuView(position: .Left, bounds: view.frame)
sideMenu.backgroundColor = .yellow
super.setupSlideMenus(views: [sideMenu])
It's specifing the slide menu is Left
position, the view size is view.frame
and background color is yellow
.
It's fully customisable!
- Create subview of
SlideMenuView
class - You can add code in the
override func draw(_ rect: CGRect)
for your custom UI
import UIKit
class CustomSlideMenu: SlideMenuView {
override func draw(_ rect: CGRect) {
super.draw(rect)
// your code here for the custom UI...
}
}
See the code or sample gif for more info.
You can call show()
or hide()
for toggle the views.
For the hide()
function, please check here
or the show()
, you can check from here
You can see the sample gif.
Tracking the current position is also important if you like to implement specific action in the specific timing. There are some override functions to recognize the events.
func willShow(point: CGPoint)
func didShow(point: CGPoint)
func willDisappear(point: CGPoint)
func didDisappear(point: CGPoint)
func startDragging(point: CGPoint)
func continueDragging(point: CGPoint)
func endDragging(point: CGPoint)
Your can override there functions that keeps track of x, y position while dragging
See the code or sample gif for more info.
Your can override the functions func getPresentingSlideWithPoint(slideMenu: point: )
See the code or sample gif for more info.
iOS 8+
Swift 3.0+
Xcode 8.0+
This project is available under the MIT license. See the LICENSE file for more info.