Convert Figma logo to code with AI

matghazaryan logoAMSlideMenu2

Sliding Menu for iOS (Left and Right menus). Multiple storyboards and XIBs support.

1,199
194
1,199
20

Top Related Projects

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

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

iOS 7/8 style side menu with parallax effect.

A UIViewController subclass for presenting side view controllers inspired on the FaceBook and Wunderlist apps, done right !

A Control Center-esque control with blurred background and toggle animations.

Animated side menu with customizable UI

Quick Overview

AMSlideMenu2 is an iOS library that provides a customizable sliding menu interface for iOS applications. It allows developers to create side menus that can be revealed by swiping from the edge of the screen or tapping a menu button, similar to popular navigation patterns in many mobile apps.

Pros

  • Easy to implement and integrate into existing iOS projects
  • Highly customizable, allowing developers to adjust the look and feel of the menu
  • Supports both left and right side menus
  • Smooth animations and gestures for a polished user experience

Cons

  • Limited documentation and examples available
  • Not actively maintained (last update was several years ago)
  • May require additional work to ensure compatibility with the latest iOS versions
  • Lacks some advanced features found in more modern menu libraries

Code Examples

  1. Initializing the slide menu:
let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let leftMenuViewController = mainStoryboard.instantiateViewController(withIdentifier: "LeftMenuViewController")
let rightMenuViewController = mainStoryboard.instantiateViewController(withIdentifier: "RightMenuViewController")
let contentViewController = mainStoryboard.instantiateViewController(withIdentifier: "ContentViewController")

let slideMenuController = AMSlideMenuMainViewController(leftMenuViewController: leftMenuViewController, rightMenuViewController: rightMenuViewController, contentViewController: contentViewController)
  1. Opening the left menu programmatically:
slideMenuController.openLeftMenu()
  1. Customizing menu appearance:
slideMenuController.leftMenu?.slideMenuOptions.contentViewScale = 0.8
slideMenuController.leftMenu?.slideMenuOptions.leftMenuWidth = 250
slideMenuController.leftMenu?.slideMenuOptions.animationDuration = 0.3

Getting Started

  1. Add the AMSlideMenu2 files to your Xcode project.
  2. Import the library in your view controller:
import AMSlideMenu2
  1. Create a subclass of AMSlideMenuMainViewController and override the necessary methods:
class MySlideMenuViewController: AMSlideMenuMainViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        // Customize your slide menu here
    }
    
    override func leftMenuViewController() -> UIViewController? {
        return storyboard?.instantiateViewController(withIdentifier: "LeftMenuViewController")
    }
    
    override func rightMenuViewController() -> UIViewController? {
        return storyboard?.instantiateViewController(withIdentifier: "RightMenuViewController")
    }
}
  1. Set your MySlideMenuViewController as the root view controller of your app's window.

Competitor Comparisons

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

Pros of SlideMenuControllerSwift

  • Written in Swift, providing better performance and safety features
  • More recent updates and active maintenance
  • Supports both left and right slide menus

Cons of SlideMenuControllerSwift

  • Less customization options compared to AMSlideMenu2
  • Requires iOS 9.0 or later, potentially limiting compatibility with older devices

Code Comparison

SlideMenuControllerSwift:

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

AMSlideMenu2:

AMSlideMenuMainViewController *mainVC = [[AMSlideMenuMainViewController alloc] initWithLeftMenuViewController:leftMenuVC rightMenuViewController:rightMenuVC];
self.window.rootViewController = mainVC;
[self.window makeKeyAndVisible];

Both libraries offer similar implementation methods, but SlideMenuControllerSwift uses Swift syntax, while AMSlideMenu2 uses Objective-C. SlideMenuControllerSwift provides a more concise and modern approach to implementing slide menus in iOS applications.

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

Pros of SideMenu

  • More active development and maintenance
  • Better documentation and examples
  • Supports both Swift and Objective-C

Cons of SideMenu

  • Slightly more complex setup process
  • May require more customization for specific use cases

Code Comparison

AMSlideMenu2:

let slideMenu = AMSlideMenuMainViewController(nibName: "AMSlideMenuMainViewController", bundle: nil)
slideMenu.leftMenu = LeftMenuViewController(nibName: "LeftMenuViewController", bundle: nil)
slideMenu.rightMenu = RightMenuViewController(nibName: "RightMenuViewController", bundle: nil)

SideMenu:

let menu = SideMenuNavigationController(rootViewController: YourMenuViewController())
menu.leftSide = true
SideMenuManager.default.leftMenuNavigationController = menu
SideMenuManager.default.addPanGestureToPresent(toView: self.navigationController!.view)

Both libraries offer similar functionality for implementing slide-out menus in iOS applications. AMSlideMenu2 provides a simpler setup process but has less active development. SideMenu, on the other hand, offers more features and customization options, along with better documentation and support for both Swift and Objective-C. The code comparison shows that SideMenu requires a bit more setup, but it provides more flexibility in terms of menu configuration and presentation.

iOS 7/8 style side menu with parallax effect.

Pros of RESideMenu

  • More customizable appearance with options for background image and blur effects
  • Supports both left and right side menus simultaneously
  • Smoother animations and transitions between menu states

Cons of RESideMenu

  • Less frequently updated, with the last commit being several years old
  • Fewer options for menu item customization compared to AMSlideMenu2
  • Limited documentation and examples available in the repository

Code Comparison

RESideMenu:

RESideMenu *sideMenu = [[RESideMenu alloc] initWithContentViewController:contentViewController
                                                    leftMenuViewController:leftMenuViewController
                                                   rightMenuViewController:rightMenuViewController];
self.window.rootViewController = sideMenu;

AMSlideMenu2:

AMSlideMenuMainViewController *mainVC = [[AMSlideMenuMainViewController alloc] initWithLeftMenuViewController:leftMenuVC
                                                                                      rightMenuViewController:rightMenuVC
                                                                                             centerViewController:centerVC];
self.window.rootViewController = mainVC;

Both libraries offer similar initialization methods, but RESideMenu uses a dedicated RESideMenu class, while AMSlideMenu2 uses a AMSlideMenuMainViewController. RESideMenu's approach may be more intuitive for developers familiar with UIKit patterns.

A UIViewController subclass for presenting side view controllers inspired on the FaceBook and Wunderlist apps, done right !

Pros of SWRevealViewController

  • More actively maintained with recent updates
  • Extensive documentation and examples provided
  • Supports both left and right side menus

Cons of SWRevealViewController

  • Limited customization options for menu appearance
  • Slightly more complex implementation compared to AMSlideMenu2
  • Lacks built-in support for multiple menu types (e.g., drawer, overlay)

Code Comparison

SWRevealViewController:

SWRevealViewController *revealViewController = self.revealViewController;
if (revealViewController) {
    [self.sidebarButton setTarget: self.revealViewController];
    [self.sidebarButton setAction: @selector(revealToggle:)];
    [self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];
}

AMSlideMenu2:

AMSlideMenuMainViewController *mainVC = [AMSlideMenuMainViewController getInstanceForLeftMenu:@"LeftMenuViewController" rightMenu:@"RightMenuViewController"];
self.window.rootViewController = mainVC;
[self.window makeKeyAndVisible];

SWRevealViewController offers a more flexible approach with gesture recognizers, while AMSlideMenu2 provides a simpler setup for basic menu functionality. SWRevealViewController's implementation allows for more granular control over menu behavior, but AMSlideMenu2's approach is more straightforward for quick implementation.

A Control Center-esque control with blurred background and toggle animations.

Pros of RNFrostedSidebar

  • Offers a visually appealing frosted glass effect for the sidebar
  • Lightweight and focused on a single feature (sidebar)
  • Easy to implement with minimal setup required

Cons of RNFrostedSidebar

  • Limited customization options compared to AMSlideMenu2
  • Lacks multi-directional slide menu support (left and right)
  • No built-in support for nested menu structures

Code Comparison

RNFrostedSidebar implementation:

RNFrostedSidebar *callout = [[RNFrostedSidebar alloc] initWithImages:images selectedIndices:selectedIndices borderColors:colors];
callout.delegate = self;
[callout show];

AMSlideMenu2 implementation:

AMSlideMenuMainViewController *mainVC = [AMSlideMenuMainViewController initialViewControllerWithMenuViewController:menuVC andContentViewController:contentVC];
self.window.rootViewController = mainVC;

RNFrostedSidebar focuses on creating a visually appealing sidebar with a frosted glass effect, making it ideal for projects that prioritize aesthetics. It's easy to implement but offers limited customization.

AMSlideMenu2 provides more flexibility with support for both left and right slide menus, nested menu structures, and greater customization options. However, it may require more setup and configuration.

Choose RNFrostedSidebar for a quick, visually appealing sidebar implementation, or AMSlideMenu2 for a more feature-rich and customizable slide menu solution.

Animated side menu with customizable UI

Pros of Side-Menu.iOS

  • More visually appealing and modern UI design
  • Smoother animations and transitions
  • Better documentation and example usage

Cons of Side-Menu.iOS

  • Less customization options compared to AMSlideMenu2
  • May require more setup and configuration
  • Limited to side menu functionality only

Code Comparison

AMSlideMenu2:

let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let centerViewController = mainStoryboard.instantiateViewController(withIdentifier: "CenterViewController")
let leftMenuViewController = mainStoryboard.instantiateViewController(withIdentifier: "LeftMenuViewController")
let rightMenuViewController = mainStoryboard.instantiateViewController(withIdentifier: "RightMenuViewController")

Side-Menu.iOS:

let menuLeftNavigationController = UISideMenuNavigationController(rootViewController: YourViewController)
SideMenuManager.default.leftMenuNavigationController = menuLeftNavigationController
SideMenuManager.default.addPanGestureToPresent(toView: self.navigationController!.navigationBar)
SideMenuManager.default.addScreenEdgePanGesturesToPresent(toView: self.navigationController!.view)

Both libraries offer side menu functionality for iOS applications, but they differ in their approach and features. AMSlideMenu2 provides more flexibility and customization options, allowing for both left and right menus. Side-Menu.iOS focuses on a sleek, modern design with smoother animations but may be more limited in terms of customization. The code comparison shows that AMSlideMenu2 requires more manual setup of view controllers, while Side-Menu.iOS uses a more streamlined approach with built-in navigation controllers and gesture recognizers.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

ATTENTION‼️

Starting from v2.0.0 all the APIs are changed. You can find the old version in the AMSlideMenu_ObjC branch.

AMSlideMenu2

Made with ❤️ by matghazaryan .

Supported iOS version: >= 10.0

This is a simple library to create sliding menus!

With this library you can create 3 types of sliding menus:

  1. Slide menu with right menu only.
  2. Slide menu with left menu only.
  3. Slide menu with both left and right menus.

This repo contains project that demonstrate usage of AMSlideMenu .
Works for both iPhone, iPad and macCatalyst.

Installation with CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries installation in your projects.

Podfile

pod "AMSlideMenu", "~> 2.0.1"

Swift Package Manager

You can also use Swift Package Manager to add AMSlideMenu as a dependency to your project. In order to do so, use the following URL:

https://github.com/matghazaryan/AMSlideMenu.git

USAGE

Video Tutorial

CUSTOMIZATION

You can easily customize slide menu by overriding needed methods of AMSlideMenuMainViewController, almost all methods are open.

SCREENSHOTS

Screenshots comming soon!

Author

matghazaryan, matevos14@gmail.com

Ideas

If you have any cool idea you would like to see in this lib or you found a bug please feel free to open an issue :)

Thank You.