All Projects → Azuritul → Azdropdownmenu

Azuritul / Azdropdownmenu

Licence: mit
A simple dropdown menu component for iPhone

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Azdropdownmenu

Easydropdown
A lightweight library for building beautiful styleable <select> elements
Stars: ✭ 337 (+70.2%)
Mutual labels:  menu, dropdown
Tippyjs React
React component for Tippy.js (official)
Stars: ✭ 1,081 (+445.96%)
Mutual labels:  menu, dropdown
Dropdownmenu
DropDownMenu for Android,Filter the list based on multiple condition.
Stars: ✭ 815 (+311.62%)
Mutual labels:  menu, dropdown
Menu
The most customizable menu for macOS apps.
Stars: ✭ 84 (-57.58%)
Mutual labels:  dropdown, menu
Yndropdownmenu
✨ Awesome Dropdown menu for iOS with Swift 5.0
Stars: ✭ 1,259 (+535.86%)
Mutual labels:  menu, dropdown
react-native-panel
A Customizable React Native Panel for Android and iOS
Stars: ✭ 35 (-82.32%)
Mutual labels:  dropdown, menu
V Tooltip
💬 Easy tooltips, popovers, dropdown for Vue
Stars: ✭ 2,109 (+965.15%)
Mutual labels:  dropdown, menu
clicky-menus
Simple click-triggered navigation submenus. Accessible and progressively enhanced.
Stars: ✭ 76 (-61.62%)
Mutual labels:  dropdown, menu
Igldropdownmenu
An iOS drop down menu with pretty animation and easy to customize.
Stars: ✭ 1,218 (+515.15%)
Mutual labels:  menu, dropdown
Tippyjs
Tooltip, popover, dropdown, and menu library
Stars: ✭ 9,433 (+4664.14%)
Mutual labels:  menu, dropdown
Accordion
Silky-smooth accordion widgets with no external dependencies.
Stars: ✭ 32 (-83.84%)
Mutual labels:  dropdown, menu
Bootstrap Dropdown Hover
Bootstrap based responsive mulltilevel dropdown navigation menu with fascinating animations
Stars: ✭ 115 (-41.92%)
Mutual labels:  menu, dropdown
react-native-select-pro
React Native dropdown (select) component developed by Mobile Reality
Stars: ✭ 79 (-60.1%)
Mutual labels:  dropdown, menu
Vue Stripe Menu
Creating a navigation menu with animations like on Stripe
Stars: ✭ 266 (+34.34%)
Mutual labels:  menu, dropdown
ContextMenuSwift
A better version of iOS 13 Context Menu
Stars: ✭ 162 (-18.18%)
Mutual labels:  dropdown, menu
Kpdropmenu
KPDropMenu is an Objective-C port of HADropDown With Additional features
Stars: ✭ 50 (-74.75%)
Mutual labels:  menu, dropdown
Dropdownmenukit
UIKit drop down menu, simple yet flexible and written in Swift
Stars: ✭ 246 (+24.24%)
Mutual labels:  menu, dropdown
Easydropdown
💧 Fantastic dropdown in Swift
Stars: ✭ 254 (+28.28%)
Mutual labels:  menu, dropdown
Ember Select Box
🔠 A faux select box for Ember apps
Stars: ✭ 60 (-69.7%)
Mutual labels:  menu, dropdown
Custom Reactjs Dropdown Components
Custom dropdown components for ReactJS
Stars: ✭ 110 (-44.44%)
Mutual labels:  menu, dropdown

AZDropdownMenu

Build Status Version License Platform Language

AZDropdownMenu is a simple dropdown menu component that supports Swift.

Screenshots

Code used in the screencast are included in the bundled sample project.

screencast

Demo Project

To run the demo project, clone the repo with git clone https://github.com/Azuritul/AZDropdownMenu.git, and run pod install from the Example directory first.

Requirements

  • iOS 8 or above
  • Xcode 8 or above
  • Swift 3

Installation

AZDropdownMenu is available through CocoaPods. To install it, simply add the following line to your Podfile:

use_frameworks!
pod 'AZDropdownMenu'

Use version 1.1.2 if you don't need Swift 4 support.

Usage

Declare an array of texts that are served as the item in the menu.

let titles = ["Action 1", "Action 2", "Action 3"]

Then pass the array to the initializer

let menu = AZDropdownMenu(titles: titles)

Set up so that the UIBarButtonItem is asso

ated with a function that shows the menu

let button = UIBarButtonItem(image: UIImage(named: "menu_image"), style: .Plain, target: self, action: "showDropdown")
navigationItem.leftBarButtonItem = menuButton

Calling public func showMenuFromView(view:UIView) can then show the menu.

func showDropdown() {
    if (self.menu?.isDescendantOfView(self.view) == true) {
        self.menu?.hideMenu()
    } else {
        self.menu?.showMenuFromView(self.view)
    }
}

The handler public var cellTapHandler : ((indexPath:NSIndexPath) -> Void)? would be called when menu item is tapped. So place code in here to do whatever you want. For example

menu.cellTapHandler = { [weak self] (indexPath: NSIndexPath) -> Void in
    self?.navigationController?.pushViewController(controller, animated:true)
}

Create menu with icons

Pass in a AZDropdownMenuItemData in the initializer: public init(dataSource:[AZDropdownMenuItemData]) and you are good to go.

Take a look at the sample project in this repository to get more usage of the library.

Configurable options

Currently AZDropdownMenu can be customized with the following properties. More will come in the future.

  • itemHeight Row height of the menu item. Default is 44.
  • itemColor The background color of the menu item. Default is white.
  • itemFontColor The text color of the menu item. Default is black.
  • itemFontSize Font size of the menu item. Default is 14.0
  • itemFont Font used in the menu. Default is 'Helvetica'
  • itemAlignment The alignment of the menu item. Default is left-aligned.
  • itemSelectionColor The background color of the menu item while it is tapped. Default is gray.
  • overlayAlpha The transparency for the background overlay. Default is 0.5
  • overlayColor Color for the background overlay. Default is black.
  • menuSeparatorStyle The separator of the menu. Default is single line.
  • menuSeparatorColor The color of the separator. Default is light gray.
  • itemImagePosition The position of image in the menu. Can be positioned before or after the text. Default is .Prefix.
  • shouldDismissMenuOnDrag If set to true, menu would be dismissed on drag. Default value is false.

Version

  • 1.1.3

    • Update for Swift 4 syntax
  • 1.1.2

    • Update for Swift 3 syntax
  • 1.1.1

    • Update for Swift 2.2's #selector syntax
  • 1.1.0

    • Added shouldDismissMenuOnDrag option, menu would be dismissed on drag if this option is enabled
    • Modified the sample project with an example using UITableView.
    • Added gesture handler for the menu.
    • Extract config struct to a separate file
    • Update readme.
  • 1.0.0

    • Added itemImagePosition option, now can configure the icon position.
    • Changed icon sets and its corresponding location in the sample project.
    • Modified sample project's appearance a little bit.
    • Modified sample project's structure.
    • Added CHANGELOG.md
  • 0.6.1

    • Update readme
  • 0.6.0

    • Now can use icons in the menu.
    • Added configuration options: menuSeparatorColor, itemFont
  • 0.5.3

    • Now can configure item's background color while tapped

Credit

Author

Chris Wu (Azuritul), [email protected]

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].