Fantastic dropdown in Swift

Overview

Dropdowns

❤️ Support my app ❤️

❤️ ❤️ 😇 😍 🤘 ❤️ ❤️

Dropdown in Swift

Version License Platform Swift

Usage

Dropdowns provides the quickest way to present a dropdown in your app. It is very lightweight, just provide a list of items and the action closure you want to handle.

Basic

Dropdowns works by showing a child UIViewController as a dropdown from a TitleView. The most common use case is to show from a UINavigationController, in that sense, you can just create a list of items, and provide to TitleView.

let items = ["World", "Sports", "Culture", "Business", "Travel"]
let titleView = TitleView(navigationController: navigationController!, title: "Menu", items: items)
titleView?.action = { [weak self] index in
  print("select \(index)")
}

navigationItem.titleView = titleView

Customization

Dropdowns uses TableController by default, to show list of items in a UITableView. You can customise to show anything you want by using contentController.

let contentController = TableController(items: items, initialIndex: 0)
let dropdown = DropdownController(contentController: contentController, navigationController: navigationController)

Configuration

You can also customise many aspects of Dropdowns via Config

Config.List.DefaultCell.Text.color = UIColor.redColor()

Installation

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

pod 'Dropdowns'

Dropdowns is also available through Carthage. To install just write into your Cartfile:

github "onmyway133/Dropdowns"

Dropdowns can also be installed manually. Just download and drop Sources folders in your project.

Author

Credit

Contributing

We would love you to contribute to Dropdowns, check the CONTRIBUTING file for more info.

License

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

Comments
  • Add intial index parameter to 'TitleView'

    Add intial index parameter to 'TitleView'

    At the present, one can set an initial index with the use of a 'TableController'. Unfortunately, it is set privately in a 'DropdownController' and the 'dropdown' property set in the 'TitleView' cannot be changed because of it's reference in the 'action' block that would not be called properly if the 'dropdown' property is changed after initialization.

    This was the easiest way to allow the 'initial index' functionality at the present.

    opened by Tokuriku 2
  • Fix error

    Fix error "Unexpected duplicate tasks" when using Xcode new build system

    Ensures images are not included in "Compile Sources" build phase by adding .swift extension to the podspec source_files:

    s.ios.source_files = 'Sources/**/*.swift'
    

    Otherwise images appear both in the Sources and in the resources bundle, which causes the new build system to complain about "Unexpected duplicate task":

    Dropdowns-before

    After merging, please git tag 3.1.1 and then pod trunk push.

    Thanks!

    opened by yonat 0
  • Memory Leak on Background

    Memory Leak on Background

    Hi There,

    When I enter in background mode my app crashes due memory leak. I Comment the following code:

    let titleView = TitleView(navigationController: nav, title: company.company_name, items: companies)
                titleView?.button.label.textColor = .white
                titleView?.button.arrow.image = titleView?.button.arrow.image?.withRenderingMode(.alwaysTemplate)
                titleView?.button.arrow.tintColor = .white
                titleView?.action = { [weak self] index in
                  print("select \(index)")
                    let company_name = companies[index]
                    let company = user.companies.filter({ $0.company_name == company_name }).first
                    self?.selectedCompany = company
                    titleView?.button.label.textColor = .white
                    titleView?.button.arrow.image = titleView?.button.arrow.image?.withRenderingMode(.alwaysTemplate)
                    titleView?.button.arrow.tintColor = .white
                    AppSessionManager.shared.retrieveProducts = false
                    AppSessionManager.shared.retrieveOrders = false
                    NotificationCenter.default.post(name: NSNotification.Name(rawValue: "companyChange"), object: nil)
                }
                navigationItem.titleView = titleView
    

    Now my app does not have memory leaks. What could be happening?

    Best regards

    opened by alfredolucomav 0
  • background colour

    background colour

    hi, i am trying to change the color of the view that is behind the tableview that is now set to some sort of green (the view that u see when u scroll down). is there a way to do that?

    opened by arielsend 0
  • app dies on orientation changing

    app dies on orientation changing

    So. I integrated Dropdowns into my project and it worked fine until I started to work on landscape orientations. Every time I try to change orientation of simulator or even real device - app freezes forever and takes 100% cpu. Was hard for me to detect what part of app does actually crash it, but after all I found that without Dropdowns app doesn't show that bug

    opened by VladimirBrejcha 0
Releases(3.1.0)
Owner
Khoa
Check my apps https://onmyway133.com/apps
Khoa
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
An elegant dropdown for iOS written in Swift.

UIDropDown An elegant dropdown for iOS written in Swift. Overview UIDropDown allows you to pick an option in a table just like dropdowns in web. It co

Isaac Gongora 87 Mar 30, 2022
A simple dropdown menu component for iPhone

AZDropdownMenu AZDropdownMenu is a simple dropdown menu component that supports Swift. Screenshots Code used in the screencast are included in the bun

Wu 194 Nov 14, 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
JNDropDownMenu - Easy to use TableView style dropdown menu.

Overview Swift version of https://github.com/dopcn/DOPDropDownMenu Easy to use TableView style dropdown menu. Setup The only thing you

Javal Nanda 65 Jun 27, 2021
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 (Drawer) in Swift

AKSwiftSlideMenu Slide Menu (Drawer) in Swift 5.0 Why to use a library everytime? Let's create our own Slide Menu in Swift 5.0 I have uploaded a video

Ashish Kakkad 281 Jan 5, 2023
⭕️ CircleMenu is a simple, elegant UI menu with a circular layout and material design animations. Swift UI library made by @Ramotion

CIRCLE MENU Simple, elegant UI menu with a circular layout and material design animations We specialize in the designing and coding of custom UI for M

Ramotion 3.4k 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
Interactive view transition to display menus with flowing and bouncing effects in Swift

FlowingMenu FlowingMenu provides an interactive transition manager to display menu with a flowing and bouncing effects. The Objective-C countepart is

Yannick Loriot 975 Dec 21, 2022
Our Guillotine Menu Transitioning Animation implemented in Swift reminds a bit of a notorious killing machine.

GuillotineMenu.swift Inspired by this project on Dribbble Also, read how it was done in our blog Requirements iOS 8.0+ Xcode 10 Swift 5.0 (v 4.1+) Swi

Yalantis 2.9k Dec 13, 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
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 Swift implementation of RESideMenu

SSASideMenu is a reimplementation of romaonthego/RESideMenu in Swift. A iOS 7/8 style side menu with parallax effect. ###Usage func application(

Sebastian 600 Oct 16, 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
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
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
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