iOS Slide Menu View based on Google+, iQON, Feedly, Ameba iOS app. It is written in pure swift.

Overview

SlideMenuControllerSwift

Platform Language License Issues Downloads

iOS Slide View based on iQON, Feedly, Google+, Ameba iPhone app.

sample

Installation

CocoaPods

pod 'SlideMenuControllerSwift'

Carthage

if iOS8 or later, Carthage is supported

  • Add github "dekatotoro/SlideMenuControllerSwift" to your Cartfile.
  • Run carthage update.

for more info, see Carthage

Manually

Add the SlideMenuController.swift file to your project.

Usage

Setup

Add import SlideMenuControllerSwift in your file

In your app delegate:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

    // create viewController code...

    let slideMenuController = SlideMenuController(mainViewController: mainViewController, leftMenuViewController: leftViewController, rightMenuViewController: rightViewController)
    self.window?.rootViewController = slideMenuController
    self.window?.makeKeyAndVisible()    

    return true
}

Storyboard Support

  1. Inherit SlideMenuController and put UIViewController in a storyboard.
  2. Override awakeFromNib, then instantiate any view controllers
class ContainerViewController: SlideMenuController {

    override func awakeFromNib() {
        if let controller = self.storyboard?.instantiateViewControllerWithIdentifier("Main") {
            self.mainViewController = controller
        }
        if let controller = self.storyboard?.instantiateViewControllerWithIdentifier("Left") {
            self.leftViewController = controller
        }
        super.awakeFromNib()
    }

}

If you want to use the custom option, please set them before calling the init method, like so:

SlideMenuOptions.leftViewWidth = 50
SlideMenuOptions.contentViewScale = .50
...

You can access from UIViewController

self.slideMenuController()?

or

if let slideMenuController = self.slideMenuController() {
    // some code
}

add navigationBarButton

viewController.addLeftBarButtonWithImage(UIImage(named: "hoge")!)
viewController.addRightBarButtonWithImage(UIImage(named: "fuga")!)

open and close

// Open
self.slideMenuController()?.openLeft()
self.slideMenuController()?.openRight()

// close
self.slideMenuController()?.closeLeft()
self.slideMenuController()?.closeRight()

monitor the states of menu, you can use SlideMenuControllerDelegate use this:

func leftWillOpen()
func leftDidOpen()
func leftWillClose()
func leftDidClose()
func rightWillOpen()
func rightDidOpen()
func rightWillClose()
func rightDidClose()

Requirements

Requires Swift4.0 and iOS 9.0 and ARC. If you are developing in the Swift1.1 ~ 3.2, please use branch of swift1.1 ~ 3.
If you want to use even iOS8.0, please to import the code directly.
If you want to use objective-c even iOS6.0, plesea use SlideMenuControllerOC.

Features

  • Highly customizable
  • Complete example

Contributing

Forks, patches and other feedback are welcome.

Creator

SlideMenuControllerSwift

Yuji Hato Blog

SlideMenuControllerOC

Pluto Y Blog Sing Weibo

License

SlideMenuControllerSwift is available under the MIT license. See the LICENSE file for more info.

Comments
  • viewWillAppear is not calling for mainViewController

    viewWillAppear is not calling for mainViewController

    Dear guys. Thank you for your library. I like to use it in my projects. However after update to version 3.0.2 I see that viewWillAppear is not calling for my mainViewController that I use for SlideMenuController instance. mainViewController is a subclass of UINavigationController. Could you please tell me why it happened? I see that now in version 3.0.2 the following code was commented inside viewWillAppear: self.mainViewController?.viewWillAppear(animated) Probably it is the reason. But I cannot understand why this line of code was commented. Thank you in advance.

    opened by RomanPodymov 13
  • I download demo project and have a lot of errors.

    I download demo project and have a lot of errors.

    Hello, can u help me why its done. I download your test project and can't build it cause 18 errors SlideMenuControllerSwift.swift file. Its only not work for me or anything else is the problem?

    opened by PetyaxD 13
  • Trigger `viewWillAppear` on mainViewController when SlideMenuController appears on screen

    Trigger `viewWillAppear` on mainViewController when SlideMenuController appears on screen

    viewWillAppear isn't called on the initial mainViewController, so trigger it when SlideMenuController's view will appear.

    When the main view controller is replaced while SlideMenuController is on screen, all callbacks work as expected.

    opened by s0meone 12
  • Cannot archive project

    Cannot archive project

    screen shot 2017-04-21 at 4 25 36 pm Hi, Please help me out, I use your lib in my project, when I build directly to my device, it works fine. Then I archive project, it show these errors. Please check and tell me soon. Thank you very much
    opened by gauuni 11
  • Changing root of SlideMenuController

    Changing root of SlideMenuController

    I'm using this SlideMenuController. But I want it to start from my ShopHome screen. And in my app my root/initial VC is Login page. When I use the below code it goes directly to ShopHome. But instead I want my app to start from Login and then menu on ShopHome screen. I tried changing root to my LoginVC but then menu doesn't work when I'm on ShopHome page.

    let mainViewController = storyboard.instantiateViewController(withIdentifier: "ShopHomeVC") as! ShopHomeVC
    let rightViewController = storyboard.instantiateViewController(withIdentifier: "RightMenuVC") as! RightMenuVC
    let nvc: UINavigationController = UINavigationController(rootViewController: mainViewController)
    
    let slideMenuController = SlideMenuController(mainViewController: nvc, rightMenuViewController: rightViewController)
    self.window?.rootViewController = slideMenuController
    self.window?.makeKeyAndVisible()`
    
    opened by iOS-Ahytech 10
  • Import from cocoapods

    Import from cocoapods

    When i get the SliderMenuControllerSwift from cocoapods, i can't use it since the imports doesnt work. Im am able to "Import SlideMenuControllerSwift" but i dont have any method SlideMenuController(mainViewController: mainViewC ... can you have a look at it?

    opened by ivangodfather 9
  • ViewControllers

    ViewControllers

    Hi! I'm really stuck with customizing. Could you make a very light example of this menu, which toggle between different views? This helps me a lot to discover Swift. Thank you very much

    opened by kinott 9
  • LeftPanGesture will not work after rotate. Use init(mainViewController: UIViewController, leftMenuViewController: UIViewController)

    LeftPanGesture will not work after rotate. Use init(mainViewController: UIViewController, leftMenuViewController: UIViewController)

    If SlideMenuController.init(mainViewController: UIViewController, leftMenuViewController: UIViewController), after device rotate ,the method that isRightOpen() always be true. So, handleLeftPanGesture(panGesture: UIPanGestureRecognizer) will not work correctly.

    My workaround:

    1. SlideMenuOptions.rightPanFromBezel = false
    2. Use SlideMenuController.init(mainViewController: UIViewController, leftMenuViewController: UIViewController, rightMenuViewController: UIViewController). The rightMenuViewController just set UIViewController().
    opened by Leoshu 8
  • Migration to Swift 3

    Migration to Swift 3

    I think that we can consider a migration to Swift 3 as soon as possible, creating a new branch for this.

    In this way, with the GM of Xcode 8 in autumn we are ready for this transition.

    enhancement 
    opened by pmusolino 6
  • Change MainViewController with MainTableViewController

    Change MainViewController with MainTableViewController

    Hi dekatotoro, congratulations for excellent work! Just a question. I'm new in swift and in iOS programming ...so sorry for idiot question. If i want change (into your sample app) MainViewController with a TableViewController?

    I've tried to do this replacing MainViewController with MainTableViewController but i've an correct error in appdelegate here: leftViewController.mainViewController = nvc

    Please can you help me?

    Thanks a lot and best Regards

    opened by mitsus 6
  • Problem when using segue back navigation item

    Problem when using segue back navigation item

    Let me say clear for the issue. 1.I was using "Main View Controller" for displaying data with images using Table View 2.In order to display the data with detail,i created "Detail View Controller" and make Navigation Embedded to "Main View Controller" to create segue for "Detail View Controller". 3.I disabled the your slide out at "Detail View Controller" because i don't want to.I only want to display Slide out at "Main View Controller" So these are my program status

    [issue]After I clicked "Back" key or swiped left gesture to come back to "Main View Controller" from "Detail View Controller",my slide out using left gesture is stopped working at "Main View Controller".Only the slide gesture is stopped working.But,when i click navigation bar item that you created to appear slide out view controller,it appear.

    Please Help!!!I am using it in my automobile project

    opened by thihaaung6245 6
  • iOS - No such module SlideMenuControllerSwift

    iOS - No such module SlideMenuControllerSwift

    Greetings.

    After hours in forums, most of them point out to your repository for SlideMenuControllerSwift but the solution still eludes me.

    Upon the owner request, I just pulled out an archived app developed by a 3rd party hoping to make it run.

    After debugging some minor errors, Im stuck with the warning: "iOS - No such module SlideMenuControllerSwift".

    After a long reading and educating myself around CocoaPods, It was installed but I cant circumvent this issue.

    Any possibility of having you troubleshoot it with me?

    Keep in mind I'm a self taught programmer in progress.

    Best regards.

    SlideMenuControllerSwift compiler error

    opened by sochinza 2
  • I can't change side menu name in if else statement

    I can't change side menu name in if else statement

    I need to show Login/signup if a user is not login the app if the user login the app needs to show Logout inside the menu??? How can i do this thing in SlideMenuControllerSwift

    opened by aravindiOSdev 0
Releases(2.2.0)
Owner
Yuji Hato
Software Engineer Server, web, Android, iOS https://twitter.com/dekatotoro
Yuji Hato
Slide-Menu - A Simple Slide Menu With Swift

Slide Menu!! Весь интерфейс создан через код

Kirill 0 Jan 8, 2022
iOS Slide Menu Controller. It is written in pure swift.

SlideMenuController Requirements iOS 9+ Installation SlideMenuController is available through CocoaPods. To install it, simply add the following line

Myung gi son 40 Jan 16, 2022
Slide Menu (Drawer) in Swift

AKSwiftSlideMenu Slide Menu (Drawer) in Swift 5.0 Why to use a library everytime? Let's create our own Slide Menu in Swift 5.0 I have uploaded a video

Ashish Kakkad 281 Jan 5, 2023
Simple side/slide menu control for iOS, no code necessary! Lots of customization. Add it to your project in 5 minutes or less.

▤ SideMenu If you like SideMenu, give it a ★ at the top right of this page. SideMenu needs your help! If you're a skilled iOS developer and want to he

Jon Kent 5.4k Dec 29, 2022
This is a spring slide menu for iOS apps - 一个弹性侧滑菜单

LLSlideMenu This is a spring slide menu for iOS apps 一个弹性侧滑菜单 弹性动画原理借鉴该项目中阻尼函数实现 Preview 预览 Installation 安装 pod 1.pod 'LLSlideMenu', '~> 1.0.6'

Li Lei 590 Dec 7, 2022
SwiftySideMenu is a lightweight and easy to use side menu controller to add left menu and center view controllers with scale animation based on Pop framework.

SwiftySideMenu SwiftySideMenu is a lightweight, fully customizable, and easy to use controller to add left menu and center view controllers with scale

Hossam Ghareeb 84 Feb 4, 2022
Swift-sidebar-menu-example - Create amazing sidebar menu with animation using swift

 SWIFT SIDEBAR MENU EXAMPLE In this project I create a awesome side bar menu fo

Paolo Prodossimo Lopes 4 Jul 25, 2022
EasyMenu - SwiftUI Menu but not only button (similar to the native Menu)

EasyMenu SwiftUI Menu but not only button (similar to the native Menu) You can c

null 10 Oct 7, 2022
Hamburger Menu Button - A hamburger menu button with full customization

Hamburger Menu Button A hamburger menu button with full customization. Inspired by VinhLe's idea on the Dribble How to use it You can config the looks

Toan Nguyen 114 Jun 12, 2022
A paging menu controller built from other view controllers placed inside a scroll view (like Spotify, Windows Phone, Instagram)

Unfortunately, life gets in the way sometimes and I won't be able to maintain this library any longer and upgrade this library to where it needs to be

null 5.2k Dec 31, 2022
A menu based on Medium iOS app.

Medium 1.8.168 menu in Swift. That is still one of my favorite menus because that is easy to use and looks beautiful.

Hiroki Nagasawa 322 May 28, 2022
A swift library based on the various options menu in material design in Android

KTOptionMenu Description KTOptionMenu is a swift library based on the various options menu in material design in Android that allows you to easily cre

null 1 Jul 21, 2022
Menu with a circular layout based on Macaw

FanMenu Easily customizable floating circle menu created with Macaw We are a development agency building phenomenal apps. Usage Create UIView in your

Exyte 716 Dec 5, 2022
adb-tools-mac is a macOS menu bar app written in SwiftUI for common adb tools.

adb-tools-mac is a macOS menu bar app written in SwiftUI for common adb tools.

Naman Dwivedi 930 Jan 2, 2023
A simple side menu for iOS written in Swift.

ENSwiftSideMenu A lightweight flyover side menu component for iOS with the UIDynamic's bouncing animation, UIGestures and UIBlurEffect. Allows you to

Evgeny Nazarov 1.8k Dec 21, 2022
iOS Interactive Side Menu written in Swift.

Interactive Side Menu A customizable, interactive, auto expanding and collapsing side menu for iOS written in Swift. Here are some of the ways Interac

Handsome 706 Dec 15, 2022
ExpandingMenu is menu button for iOS written in Swift.

ExpandingMenu ExpandingMenu is written in Swift. Requirements iOS 8.0+ Xcode 10.0+ Swift 3.x+ Installation CocoaPods You can install CocoaPods with th

null 454 Dec 7, 2022
A side menu controller written in Swift for iOS

Description SideMenuController is a custom container view controller written in Swift which will display the main content within a center panel and th

Teo 1.2k Dec 29, 2022
Beautiful iOS side menu library with parallax effect. Written in Swift

AKSideMenu AKSideMenu is a double side menu library with parallax effect. Example Project See the contained examples to get a sample of how AKSideMenu

Diogo Autilio 280 Dec 6, 2022