The fastest zero-tap iOS menu.

Overview

PRs Welcome Carthage compatible Version iOS 9.0+ Swift 4.0+ License CocoaPods Twitter URL

⚡️ Quicklook

The fastest zero-tap iOS menu

CariocaMenu is a simple, elegant, fast navigation menu for your iOS apps.

🏆 Features

  • Accessible from a single swipe of the left/right screen edge
  • Accessible with a tap on the indicator
  • Customisable menu indicator
  • Menu Item supports image & emoji/text
  • Boomerang mode
  • Supports rotation (Full AutoLayout)
  • Supports iPhone X & the Notch !
  • Complete Technical Documentation

📝 Requirements

  • AutoLayout
  • iOS 9.0+
  • Swift 4.0

📢 Communication

  • If you need help, use Stack Overflow. (Tag 'CariocaMenu')
  • If you'd like to ask a general question, use Stack Overflow.
  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.
  • If you use the control, contact me to mention your app on this page.

📲 Installation

CocoaPods

CariocaMenu is now available on CocoaPods. Simply add the following to your project Podfile, and you'll be good to go.

use_frameworks!

pod 'CariocaMenu', '~> 2.0.1'

Carthage

Carthage is a decentralised dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate CariocaMenu into your Xcode project using Carthage, specify it in your Cartfile:

github "arn00s/cariocamenu"

Run carthage to build the framework and drag the built CariocaMenu.framework into your Xcode project.

Manually

If you prefer, you can integrate CariocaMenu into your project manually.

Just Drag&Drop all the files under Sources/ into your project.


💻 Usage

Preparing your menu controller

To create and display your menu, you'll need to create a custom CariocaController (UITableViewController & CariocaDataSource)

This will define your menu settings & appearance. Check DemoMenuContentController.swift for code sample.

Creating your menu

For the complete code, check MainViewController.swift.

if let controller = self.storyboard?.instantiateViewController(withIdentifier: "DemoMenu")
    as? CariocaController {
      addChildViewController(controller)
      carioca = CariocaMenu(controller: controller,
                            hostView: self.view,
                            edges: [.right, .left],
                            delegate: self,
                            indicator: CariocaCustomIndicatorView()
                            )
      carioca.addInHostView()
}

Managing rotation

To be able to manage the rotation of the menu, you'll need to forward the rotation event to your menu instance.

override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
  coordinator.animateAlongsideTransition(in: self.view, animation: nil, completion: { [weak self] _ in
    self?.carioca?.hostViewDidRotate()
  })
}

Creating your custom indicator

Here's the simplest custom indicator. Feel free to check the CariocaIndicatorConfiguration extension for more customisation possibilities.

class CariocaCustomIndicatorView: UIView, CariocaIndicatorConfiguration {
  ///This will use the basic shape, and change the color to black.
  var color: UIColor = UIColor.black
}

Boomerang

A boomerang always comes back to it's original place. By default, the boomerang is set to none. It means that the menu will stay where the user let it.

The other boomerang options are :

  • horizontal : The indicator will return always on the original edge.
  • vertical : The indicator will return always on the original Y position. It may switch from Edge.
  • originalPosition : The indicator will always come back to it's original position

👨‍💻 TODO

  • Add a check for the edges at the initialisation. (Only .left & .right are allowed)
  • Add UI Tests
  • Add a live tutorial to indicate users how to get the most of this menu

⚠️ Known issues

Check the (GitHub issues)

🤔 FAQ

😍 Why should I use CariocaMenu?

You're starting a new iOS app, and you want to innovate on the user experience.

🇧🇷 Why the name CariocaMenu?

I didn't want to use the same naming convention that EVERYONE uses. I could have named it ASSuperCoolMenu, but it sucks. A Carioca is someone who lives in Rio de Janeiro 🇧🇷 . I lived there for two months, and this idea was born while I was there.

🤙🏼 Contact

❤️ Contributions

This is an open source project, feel free to contribute!

  • Open an issue.
  • Propose your own fixes, suggestions and open a pull request with the changes.

See all contributors

Project generated with SwiftPlate

📝 License

CariocaMenu is released under the MIT license. See LICENSE for details.

Comments
  • Many items in menu blows the app.

    Many items in menu blows the app.

    [x] There is no issue opened before about this. [x] Issue is reproduceable in demo project.

    What did I do?

    • Downloaded the demo project.
    • Wanted to check how it works with many menu items, so I copy pasted default menus 3 times. (4 times menu items at the end.) Change nothing else.
    • Ran on iPhone 6s with iOS 11.2.1

    What happened?

    • CaroicaGestureManager.swift file, panned(yLocation:, edge:, state:, fromGesture:)method, line 76
    • let yRange: ClosedRange<CGFloat> = 20.0...frameHeight - container.menuHeight
    • Fatal error occured: Thread 1: Fatal error: Can't form Range with upperBound < lowerBound.
    • Reason: With 4x menu items, container.menuHeight became greater than frameHeight I suppose.
    bug 
    opened by anelad 10
  • Pin Shape color and MenuBackground BlurEffect overrides added

    Pin Shape color and MenuBackground BlurEffect overrides added

    Hey there!

    In my project I need to have different color theme for menu than the default one. So for better extensibility and reusability those 2 are required.

    @arn00s please review once you'll have a chance And btw menu is awesome :) found couple bugs -> will contribute to that later. Thanks.

    opened by keblodev 6
  • iconMargins mixing up fix

    iconMargins mixing up fix

    As of 2.0.1 iconMargins is not working (properly) because here constrains are assumed to be arranged in "CSS order":

    private func applyMarginConstraints(margins: (top: CGFloat, right: CGFloat, bottom: CGFloat, left: CGFloat)) {
    	iconConstraints[0].constant = margins.top
    	iconConstraints[1].constant = margins.right
    	iconConstraints[2].constant = margins.bottom
    	iconConstraints[3].constant = margins.left
    	setNeedsLayout()
    }
    

    by in reality they are arranged differently:

    func makeAnchorConstraints(to superview: UIView) -> [NSLayoutConstraint] {
    	return [self.topAnchor.constraint(equalTo: superview.topAnchor),
    		self.rightAnchor.constraint(equalTo: superview.rightAnchor),
    		self.leftAnchor.constraint(equalTo: superview.leftAnchor),
    		self.bottomAnchor.constraint(equalTo: superview.bottomAnchor)]
    }
    

    (note how left and bottom are misplaced)

    Furthermore, (because of how iOS resolving constants in constraints depending on anchors order) left and bottom should be negative to achieve desired result.

    So, this PR contains fix for those issues and cleanup of some duplicating code (addSubview, create constraints, addConstraints)

    opened by Katsz 4
  • Menu uses too much memory

    Menu uses too much memory

    What did I do?

    • Downloaded the demo project and ran it on iPhone 6s with iOS 11.2.1 without any modification.
    • Travelled between content pages many times. (Not to be a prick, just to present the menu to my collegues.)

    What happened?

    • Memory usage gone beyond 150 MB.

    Any ideas?

    I traced the memory usage while travelling between pages. I saw 2 things.

    • WebView data is not released when you go to another page.
    • MapView data is released but not completely when you go to another page.

    I don't know if these are issues about the menu, or something else, but false alarm better than no alarm :]

    bug 
    opened by anelad 3
  • Unknown error in the app after I did like example demo ?

    Unknown error in the app after I did like example demo ?

    *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[test.MainViewController cariocaMenuDidSelect:indexPath:]: unrecognized selector sent to instance 0x7ffa48e00be0'

    this happen when ever I click on cell for the menu.

    opened by Mohammed-Elias 2
  • .left .right active menu state collision fix

    .left .right active menu state collision fix

    collision is easy to detect when having cariocaMenu?.boomerang = .verticalAndHorizontal

    and while in app using menu:

    1. Swipe from right to open menu -> menu appears on the .left as expected
    2. Then swipe from left to open menu -> menu appears on the .right as expected
    3. Then swipe from the right again to open menu -> menu appears on the .right again which is WRONG. Expected behavior: menu should appear on the .left -> same as in step 1.

    Collision was happening due to check in hideMenu() which was setting openingEdge property which was already set before in gestureTouched() -> which makes next time when gestureTouched() gets fired again -> the menu view's state is not being updated to correct one cuz openingEdge always equals to .right and newEdge also equals .right in this scenario

    opened by keblodev 2
  • Fix delegate and showIndicator() visibility inside CariocaMenu class

    Fix delegate and showIndicator() visibility inside CariocaMenu class

    1. Make a delegate in CariocaMenu class to be public to make it possible to set a delegate outside of the demo project, i.e. in a user's app utilizing this POD.
    2. Make CariocaMenu.showIndicator() method public to make it possible to initialize the initial position and style of the indicator in a user's app utilizing this POD.
    opened by chupakabr 2
  • Rotation Bug

    Rotation Bug

    The library doesn't handle well when rotating the screen.

    Steps to reproduce

    • In portrait mode (Unlock rotation)
    • Open the menu
    • Scroll to About
    • Open the menu again
    • Rotate to landscape

    Expected result

    • The Menu Centered in landscape mode

    Actual Results

    • The Menu is half visible. (If you play it a couple of time, the menu button will disappear)
    opened by emptyway 2
  • icon is too big

    icon is too big

    Hey! I am trying to apply icon instead of emoji but the problem is that the icon is way too big. This is how I add icon:

    var menuItems: [CariocaMenuItem] = [
            CariocaMenuItem("Test1", .icon(UIImage(named: "test1Icon")!)),
            CariocaMenuItem("Test2", .icon(UIImage(named: "test2Icon")!))
        ]
    

    This is the output:

    screen shot 2018-03-13 at 02 05 07

    My icon is 15x15

    opened by MaeseppTarvo 1
  • Dismiss Viewcontroller

    Dismiss Viewcontroller

    Hey, I am trying to dismiss presented ViewController but instead on dismissing, it goes to Carioca's default viewcontrollerViewController. My initial ViewController is UINavigationController but I do not think that is an issue. Is it a bug or I am stupid?

    And this is how I present:

    let emptyViewController = EmptyViewViewController.fromStoryboard()
    present(emptyViewController, animated: true, completion: nil)
    
    question 
    opened by MaeseppTarvo 1
  • Question: Has this library been ported to android or is there a similar looking library for android?

    Question: Has this library been ported to android or is there a similar looking library for android?

    Firstly, thank you for an awesome library! Great work! It would be great to have a similar library for android.

    Has this library been ported to android or is there a similar looking library for android that you're aware of?

    opened by hu55a1n1 1
  • Demo project doesn't work on iOS 13

    Demo project doesn't work on iOS 13

    I tried to run the Demo project, but it does not respond to pan gesture in the menu, could you check this? just try to run it :) Very thanks, I may use this library on the app I'm developing, and once then, I'll give you the link ❤️

    opened by hussc 0
Releases(1.1)
Owner
momo
a mix of design and development.
momo
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
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

Boisney Philippe 90 Oct 17, 2020
Slide-Menu - A Simple Slide Menu With Swift

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

Kirill 0 Jan 8, 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
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
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
iOS Slide Menu View based on Google+, iQON, Feedly, Ameba iOS app. It is written in pure swift.

SlideMenuControllerSwift iOS Slide View based on iQON, Feedly, Google+, Ameba iPhone app. Installation CocoaPods pod 'SlideMenuControllerSwift' Carth

Yuji Hato 3.3k Dec 29, 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 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
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 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

Cali Castle 1.5k Dec 30, 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 Dec 29, 2022
✨ Awesome Dropdown menu for iOS with Swift 5.0

The eligible dropdown menu for iOS, written in Swift 5, appears dropdown menu to display a view of related items when a user click on the dropdown menu. You can customize dropdown view whatever you like (e.g. UITableView, UICollectionView... etc)

Kyle Yi 1.3k Dec 26, 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 Dec 28, 2022
RadialMenu is a custom control for providing a touch context menu (like iMessage recording in iOS 8) built with Swift & POP

RadialMenu Looking for help? For $150/hr I'll help with your RadialMenu problems including integrating it into your project. Email [email protected] t

Brad Jasper 297 Nov 27, 2022
Context menu similar to the one in the Pinterest iOS app

VLDContextSheet A clone of the Pinterest iOS app context menu. Example Usage VLDContextSheetItem *item1 = [[VLDContextSheetItem alloc] initWithTitle:

Vladimir Angelov 173 Mar 28, 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
🔻 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

Max Konovalov 531 Dec 26, 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