ExpandingMenu is menu button for iOS written in Swift.

Related tags

Menu ExpandingMenu
Overview

ExpandingMenu

CI Status Version License Platform

demo

ExpandingMenu is written in Swift.

Requirements

  • iOS 8.0+
  • Xcode 10.0+
  • Swift 3.x+

Installation

CocoaPods

You can install CocoaPods with the following command:

$ gem install cocoapods

To integrate ExpandingMenu into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'ExpandingMenu', '~> 0.4'
end

Then, run the following command:

$ pod install

Carthage

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

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

github "monoqlo/ExpandingMenu" ~> 0.4

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

Manually

  1. Download and drop /ExpandingMenufolder in your project.
  2. Congratulations!

Usage

import ExpandingMenu

let menuButtonSize: CGSize = CGSize(width: 64.0, height: 64.0)
let menuButton = ExpandingMenuButton(frame: CGRect(origin: CGPoint.zero, size: menuButtonSize), image: UIImage(named: "chooser-button-tab")!, rotatedImage: UIImage(named: "chooser-button-tab-highlighted")!)
menuButton.center = CGPoint(x: self.view.bounds.width - 32.0, y: self.view.bounds.height - 72.0)
view.addSubview(menuButton)

let item1 = ExpandingMenuItem(size: menuButtonSize, title: "Music", image: UIImage(named: "chooser-moment-icon-music")!, highlightedImage: UIImage(named: "chooser-moment-icon-music-highlighted")!, backgroundImage: UIImage(named: "chooser-moment-button"), backgroundHighlightedImage: UIImage(named: "chooser-moment-button-highlighted")) { () -> Void in
            // Do some action
        }

・・・

let item5 = ExpandingMenuItem(size: menuButtonSize, title: "Sleep", image: UIImage(named: "chooser-moment-icon-sleep")!, highlightedImage: UIImage(named: "chooser-moment-icon-sleep-highlighted")!, backgroundImage: UIImage(named: "chooser-moment-button"), backgroundHighlightedImage: UIImage(named: "chooser-moment-button-highlighted")) { () -> Void in
            // Do some action
        }
        
menuButton.addMenuItems([item1, item2, item3, item4, item5])

Customize

ExpandingMenuButton

// Bottom dim view
menuButton.bottomViewColor = UIColor.redColor()
menuButton.bottomViewAlpha = 0.2

// Whether the tapped action fires when title are tapped
menuButton.titleTappedActionEnabled = false

// Menu item direction
menuButton.expandingDirection = .Bottom
menuButton.menuTitleDirection = .Right

// The action when the menu appears/disappears
menuButton.willPresentMenuItems = { (menu) -> Void in
    print("MenuItems will present.")
}

menuButton.didPresentMenuItems = { (menu) -> Void in
    print("MenuItems will present.")
}
        
menuButton.willDismissMenuItems = { (menu) -> Void in
    print("MenuItems dismissed.")
}

menuButton.didDismissMenuItems = { (menu) -> Void in
    print("MenuItems will present.")
}

// Expanding Animation
menuButton.expandingAnimations = [] // No animation

menuButton.expandingAnimations = CustomAnimationOptions.all.symmetricDifference(.menuButtonRotate)

// Folding Animation
menuButton.foldingAnimations = .all

menuButton.foldingAnimations = [.MenuItemMoving, .MenuItemFade, .MenuButtonRotation]

ExpandingMenuItem

// Title
item.title = "text"
item.titleColor = UIColor.redColor()

// Title margin to menu item
item.titleMargin = 4

Author

monoqlo, [email protected]

License

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

Comments
  • Animation option not found

    Animation option not found

    when I installed Xcode 10 and swift 4.2 this issue appeared

    Pods/ExpandingMenu/ExpandingMenu/Classes/ExpandingMenuButton.swift:78:62: Type 'UIView.AnimationOptions' has no member 'Default'

    opened by AbdoElabd 8
  • Make it appear down instead of up

    Make it appear down instead of up

    Hi

    Possible to change the appearance of the sub button items downwards instead of upwards?

    That is, the main button is at the top and when clicked, buttons appear in one column from top..

    opened by LiveRock 4
  • Issues with xcode 10/Swift 4.2

    Issues with xcode 10/Swift 4.2

    Hello,

    I just updated to Xcode 10 beta, and I am seeing 41 issues that prevent be from building the project. In Xcode 9.4.1 with a deployment target of iOS 11.4, I'm not seeing these issues.

    Do you have any plans on updating this module, or do I need to jump ship?

    Thanks, David

    opened by dcosel86 2
  • Can't run carthage update build

    Can't run carthage update build

    carthage update --platform iOS --verbose *** Fetching ExpandingMenu *** Checking out ExpandingMenu at "0.3.1" *** Skipped building ExpandingMenu due to the error: Dependency "ExpandingMenu" has no shared framework schemes for any of the platforms: iOS

    opened by Cunqi 2
  • Pod version 0.3 is not installing

    Pod version 0.3 is not installing

    Hi, I'm trying to add pod 'ExpandingMenu', '~> 0.3' to my project but getting an error:

    None of your spec sources contain a spec satisfying the dependency: ExpandingMenu (~> 0.3).

    When I remove the version number, it always installs 0.2. My project is in Swift 3 so 0.2 asks me to convert. I'm guessing something is not up to date with your pod spec?

    Thank you!

    opened by kseniya-hydric 2
  • Cocoapods install issue

    Cocoapods install issue

    Hello, I have an issue while installing the pod. When I try to install the cocoapods, I get the following error:

    [!] /usr/bin/git clone https://github.com/monoqlo/ExpandingMenu.git /var/folders/ls/g04xq0yn4nj89q29xynn9h2w0000gn/T/d20160621-11755-4i7chp --template= --single-branch --depth 1 --branch 0.1.3
    
    Cloning into '/var/folders/ls/g04xq0yn4nj89q29xynn9h2w0000gn/T/d20160621-11755-4i7chp'...
    fatal: unable to access 'https://github.com/monoqlo/ExpandingMenu.git/': Could not resolve host: github.com
    

    Do you have any idea how to solve this issue?

    Thank you.

    Best wishes, Murat Yaşar

    opened by muratyasarr 2
  • make it customizable

    make it customizable

    Hi - first of all: Great project - it would really help me in my project.

    It would be great if you could make it more customizable for the end users. E.g. I would like to have a transparent bottomViewColor and I would like to change the color of the menu titles.

    What do you think?

    opened by ogezue 2
  • Added @objc for Swift 4 compatibility

    Added @objc for Swift 4 compatibility

    I am using ExpandingMenu as Cocoa Pod in my Objective C project. After upgrading XCode to version 9 I could not use ExpandingMenu: There was no compatibility with Swift 4.0 All methods and properties were missing in file ExpandingMenu-Swift.h

    I have found solution - adding prefixes @objc to all public methods and properties. After that I could successfully build and run my application.

    Could you please add Swift 4 compatibility to ExpandingMenu?

    opened by ValentinStrazdin 1
  • Typo In README.md Example Code

    Typo In README.md Example Code

    Typo In README.md Example Code

    There is a small error in the example code in the README.md under "Customize" -> "ExpandingMenuButton".

    exclusiveOr should be symmetricDifference in

    menuButton.enabledExpandingAnimations = AnimationOptions.All.exclusiveOr(.MenuItemRotation)

    Thank you for writing this library! 👍

    opened by dingwilson 1
  • Handle rotation well

    Handle rotation well

    This control doesn't work well with rotation for several reasons

    a) The coordinates for it are hardcoded (I think it should support autolayout, which is raised by another person already) b) The control should update some internal things (like a frame of bottom alpha view) when parent view is rotated.

    opened by vronin 1
  • Can I stop rotation of subitems?

    Can I stop rotation of subitems?

    @monoqlo Thank you for your help.

    I have received your message for fix background color.

    I need one to use it. Can you add option to stop ration of sub menus? (+ button is ok).

    opened by Ying1986 1
  • Change menu item image on tap

    Change menu item image on tap

    Hello,

    I'm trying to change the menu item image after tapping on it, but I can't seem to find a way to do it. Is it possible to do that? or is there any workaround that I should do to make it happen?

    Thanks a lot.

    opened by ahmadmabrouk 1
  • Margin between menu button and first item

    Margin between menu button and first item

    Hello, awesome work on the menu.

    I have an issue with the margin between the menu button and the first item. This gap is causing a menu item to be off the screen. Suggestions? Thank you IMG_C1377ED6DC2D-1

    opened by xs6615 0
  • App crashes after manual setup for 4.2 support

    App crashes after manual setup for 4.2 support

    I had the old version of code using the manual setup and now I have updated it with support 4.2 I have just replaced old code in ExpandingMenuButton.swift and ExpandingMenuItem.swift with the new code.

    And the app crashes on line :

    self.expandingSoundPath = Bundle(url: Bundle(for: ExpandingMenuButton.classForCoder()).url(forResource: "ExpandingMenu", withExtension: "bundle")!)?.path(forResource: "expanding", ofType: "caf")

    Error is >> Fatal error: Unexpectedly found nil while unwrapping an Optional value

    @monoqlo Kindly revert soon as I had updated the code to release my app with newer version.

    Thank you.

    opened by Rahulrvarma22 2
Releases(0.4.0)
Owner
null
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
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
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 Nov 14, 2022
This is a simple Mac Catalyst example showcasing how to build a dropdown menu toolbar button using AppKit.

CatalystToolbarMenuButton This is a simple Mac Catalyst example showcasing how to build a dropdown menu toolbar button using AppKit. There are ways to

Steven Troughton-Smith 24 Dec 8, 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
Slide-Menu - A Simple Slide Menu With Swift

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

Kirill 0 Jan 8, 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
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 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
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
The elegant yet functional dropdown menu, written in Swift, appears underneath the navigation bar to display a list of defined items when a user clicks on the navigation title.

Introduction The elegant yet functional dropdown menu, written in Swift, appears underneath the navigation bar to display a list of defined items when

Tho Pham 2.7k Dec 28, 2022
Animated top menu for UITableView / UICollectionView / UIScrollView written in Swift

Persei Animated top menu for UITableView / UICollectionView / UIScrollView written in Swift! Made in Yalantis. Check this project on Dribbble Check th

Yalantis 3.4k Dec 14, 2022
UIKit drop down menu, simple yet flexible and written in Swift

DropDownMenuKit DropDownMenuKit is a custom UIKit control to show a menu attached to the navigation bar or toolbar. The menu appears with a sliding an

Quentin Mathé 258 Dec 27, 2022
Menu controller with expandable item groups, custom position and appearance animation written with Swift. Similar to ActionSheet style of UIAlertController.

Easy to implement controller with expanding menu items. Design is very similar to iOS native ActionSheet presentation style of a UIAlertController. As

Anatoliy Voropay 22 Dec 27, 2022
Rotating circle menu written in Swift 3

Swift-CircleMenu A rotating circle menu written in Swift 3. Features Gesture based rotation Configurable rotatability High customisability Simple intu

Shoaib Ahmed 123 Jul 29, 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