A simple customizable side menu written in SwiftUI.

Related tags

Menu NSideMenu
Overview

NSideMenu

Description

A simple customizable side menu written in SwiftUI.

Give a Star!

Feel free to request an issue on github if you find bugs or request a new feature. If you find this useful, please give it a star to show your support for this project.

Example

Example

Installation

Copy this url: https://github.com/itisnajim/NSideMenu.git then in Xcode project, select File > Add Packages... and past it in the input with the placeholder 'Search or Enter package URL'

Usage

In your content view body add NSideMenuView like the code below:

    @StateObject var options = NSideMenuOptions()
    var body: some View {
        NSideMenuView(options: options){
            Menu{
                YourMenuView()
            }
            Main{
                YourMainView()
            }
        }
    }

Customization

You can Customize NSideMenuView via NSideMenuOptions initializer or through the object

    options = NSideMenuOptions(style: .normal, side: .leading, width: 220, showSkeletonStack: false, skeletonStackColor: .white, cornerRaduisIfNeeded: 16, rotaionDegree: 8,
    onWillClose: {
        print("menu:onWillClose!")
    }, onWillOpen: {
        print("menu:onWillOpen!")
    }, onDidClose: {
        print("menu:onDidClose!")
    }, onDidOpen: {
        print("menu:onDidOpen!")
    })
    // or
    options.style = .slideAbove
    ...

NSideMenuOptions Properties

  • style: Presentation Style, of type enum with cases: normal, scale, slideAbove, slideAside and rotate, default: normal.
  • side: Menu side, of type enum with cases: leading and trailing, default: leading.
  • width: Menu content container width, of type CGFloat, default: 186.
  • showSkeletonStack: Main view content Skeleton Stack visiblity, of type Bool, default: false.
  • skeletonStackColor: Main view content Skeleton Stack color, of type Color, default: Color(UIColor.systemBackground).
  • cornerRaduisIfNeeded: when style is scale and Menu is visible this property will be applied on the Main view container corners, of type CGFloat, default: 16.
  • rotaionDegree: when style is rotate and Menu is visible this property will be applied on the Main view container rotation degree, of type Double, default: 6.
  • show: Menu view visiblity, of type Bool, default: false.

NSideMenuOptions Methods and Events

  • onWillClose: fired when 'show' property asigned to false or when calling toggleMenu Method.
  • onWillOpen: fired when 'show' property asigned to true or when calling toggleMenu Method.
  • onDidClose: fired when the side menu close animation did finish.
  • onDidOpen: fired when the side menu open animation did finish.
  • toggleMenu(animation: Animation? = .default): this method to toggle the side menu visiblity from open to close or from close to open.
  • showMenu(animation: Animation? = .default): this method to open the side menu
  • hideMenu(animation: Animation? = .default): this method to close the side menu

Author

itisnajim, [email protected]

License

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

You might also like...
A Slide Menu, written in Swift, inspired by Slide Menu Material Design
A Slide Menu, written in Swift, inspired by Slide Menu Material Design

Swift-Slide-Menu (Material Design Inspired) A Slide Menu, written in Swift 2, inspired by Navigation Drawer on Material Design (inspired by Google Mat

Slide-Menu - A Simple Slide Menu With Swift
Slide-Menu - A Simple Slide Menu With Swift

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

EasyMenu - SwiftUI Menu but not only button (similar to the native Menu)
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

Swift-sidebar-menu-example - Create amazing sidebar menu with animation using swift
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

Hamburger Menu Button -  A hamburger menu button with full customization
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

PagingKit provides customizable menu UI. It has more flexible layout and design than the other libraries.
PagingKit provides customizable menu UI. It has more flexible layout and design than the other libraries.

PagingKit provides customizable menu & content UI. It has more flexible layout and design than the other libraries. What's this? There are many librar

A paging view controller with a highly customizable menu ✨
A paging view controller with a highly customizable menu ✨

Getting Started | Customization | Installation Features Parchment lets you page between view controllers while showing any type of generic indicator t

A fully customizable popup style menu for iOS 😎
A fully customizable popup style menu for iOS 😎

Guide Check out the documentation and guides for details on how to use. (Available languages:) English 简体中文 What's a better way to know what PopMenu o

🔻 Dropdown Menu for iOS with many customizable parameters to suit any needs
🔻 Dropdown Menu for iOS with many customizable parameters to suit any needs

MKDropdownMenu Dropdown Menu for iOS with many customizable parameters to suit any needs. Inspired by UIPickerView. Installation CocoaPods MKDropdownM

Comments
  • Unable to tap menu button when set to .normal/.slideAside

    Unable to tap menu button when set to .normal/.slideAside

    First of all, thanks for this great component, saved me a lot of time!

    I've encountered a problem when style is set to .normal or .slideAside - I'm unable to tap a button in navigationBar to open the menu again. It works fine with .slideAbove.

    I'm using Xcode 13.2 and iOS 15.2.

    How to reproduce

    1. Use Example app
    2. Run in Simulator
    3. Change style to normal or slideAside (in the app menu)
    4. Close the menu (tap X)
    5. You're not able to tap button to open the menu again

    I guess it could be some layer covering half of the view? Let me know if you need anything to debug (video?), I'm happy to help!

    opened by xergic 2
  • iOS 13 Support

    iOS 13 Support

    Changes made to add support:

    • Adds a View extension function to use edgesIgnoringSafeArea if on iOS 13, and ignoreSafeArea otherwise
    • Also marks getToolbarItemPlacement function as only available on iOS 14+
    opened by mazjap 0
Releases(1.0.1)
Owner
Hey, I'm Najim I'm a web and mobile developer, In the meantime, I do some open source libraries 📦
null
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
Animated side menu with customizable UI

Side Menu Animated side menu with customizable UI. Made in Yalantis. Check this project on dribbble. Check this project on Behance. Requirements iOS 7

Yalantis 2.7k Sep 13, 2022
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 Sep 5, 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 703 Aug 21, 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 Sep 9, 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 281 Aug 25, 2022
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 Sep 22, 2022
Simple side option menu with clean code princibles

SwiftUISideMenu Simple side option menu with clean code princibles.

Mehmet Karanlık 12 May 23, 2022
iOS 7/8 style side menu with parallax effect.

RESideMenu iOS 7/8 style side menu with parallax effect inspired by Dribbble shots (first and second). Since version 4.0 you can add menu view control

Roman Efimov 7.2k Sep 17, 2022
Library provides easy to implement variation of Android (Material Design) Floating Action Button for iOS. You can use it as your app small side menu. 🌶

RHSideButtons ?? Library provides easy to implement variation of Android (Material Design) Floating Action Button for iOS. You can use it as your app

Robert Herdzik 166 May 3, 2022