Giter Site home page Giter Site logo

qmathe / dropdownmenukit Goto Github PK

View Code? Open in Web Editor NEW
303.0 303.0 38.0 113 KB

UIKit drop down menu, simple yet flexible and written in Swift

License: Other

Swift 93.60% Objective-C 1.67% Ruby 4.73%
control dropdown dropdown-menu ios menu navigation navigation-bar popup swift tableview ui uikit

dropdownmenukit's People

Contributors

grifas avatar ngheungyu avatar qmathe avatar rico237 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dropdownmenukit's Issues

DropDownMenu Title is overlapping

screen shot 2017-05-30 at 5 32 24 pm

I am using your framework. I have an issue though. My drop down menu title is overlapping with the right bar buttons. How to solve this issue?

Inheritance is forbidden

required public init?(coder aDecoder: NSCoder) {
	    fatalError("init(coder:) has not been implemented")
	}

wtf? I want to create a cell with xib file but I can't because of this useless code

issue when working with MBProgressHUD

on cell.menuAction selector like this:
func choose(_ sender: AnyObject) {
titleView.toggleMenu()
showHud();
hideHud();
}
and the dropMenu animation will be strange.

Pod Build fails with current version of Swift

Integrated the framework via Cocoapods. When I build my project this framework lists 20 or so errors. Would love to use this library, could you guys take a look and build it with the latest Xcode and Swift, and update the pod spec to use the latest version? Thanks. @qmathe @grifas

Use in Objective-C code?

I have a project which combines both swift and objective-c code. How to import it into objective-C code correctly - it can't find the path?

spam on DropDownTitleView

When i quickly multiple tap DropDownTitleView it seem to create a thing. where u need to multiple tap in order to get it to drop down?

Broken cocoapods

You specified "swift 4.2" in podspec but in the same time by default the pod install command ignores master and downloads branch for "4.1"

The Dropdownmenu won't scroll when too many items

I'm using this array with 19 items on it, some items are then listed outside of the iphone screen and the menu don't scroll so users can't reach the 19th elements of my array ...

["Alimentaire","Artisanat","Bien-être","Décoration","E-commerce","Distribution","Hôtellerie","Immobilier","Informatique","Métallurgie","Médical","Nautisme","Paramédical","Restauration","Sécurité","Textile","Tourisme","Transport","Urbanisme"]

The code I used to dynamically load array into your menu from your demo project

`func prepareNavigationBarMenu(_ currentChoice: String) {
navigationBarMenu = DropDownMenu(frame: view.bounds)
navigationBarMenu.delegate = self

	let toutesCat = ["Alimentaire","Artisanat","Bien-être","Décoration","E-commerce","Distribution","Hôtellerie","Immobilier","Informatique","Métallurgie","Médical","Nautisme","Paramédical","Restauration","Sécurité","Textile","Tourisme","Transport","Urbanisme"]
    var catCells : Array<DropDownMenuCell>
    catCells = []
    
    for string in toutesCat  {
        
        let cell = DropDownMenuCell()
        cell.textLabel!.text = string
        cell.menuAction = #selector(ViewController.choose(_:))
        cell.menuTarget = self
        if currentChoice == cell.textLabel!.text {
            cell.accessoryType = .checkmark
        }
        
        catCells.append(cell)
    }
    
    navigationBarMenu.menuCells = catCells
    navigationBarMenu.selectMenuCell(catCells.first!)
	
	// If we set the container to the controller view, the value must be set
	// on the hidden content offset (not the visible one)
	navigationBarMenu.visibleContentOffset =
		navigationController!.navigationBar.frame.size.height + statusBarHeight()

	// For a simple gray overlay in background
	navigationBarMenu.backgroundView = UIView(frame: navigationBarMenu.bounds)
	navigationBarMenu.backgroundView!.backgroundColor = UIColor.black
	navigationBarMenu.backgroundAlpha = 0.7
}`

Screenshot :

simulator screen shot on iPhone 7+

hide when choose a cell

Hi,

Where it's best to close the DropDownMenu when you have selected a item Cell? Now you have to select the titleView or the Menubackground

Swift 3

it'd be cool to have a swift 3 version, if you have any interest to create a branch i would like to help with that.

Check for empty cells is missing from pod install version in DropDownMenu class

Hello,

Thanks for nice lib.
Yesterday I have faced following issue.
In the GitHub version in master branch I have noticed that in DropDownMenu.swift file line 156 there is if statement for checking empty cell case before scrolling tableview:

	contentView.frame.size.height = menuView.frame.height

	// Reset scroll view content offset after rotation
	if menuView.visibleCells.isEmpty {
			return
		}
	menuView.scrollToRow(at: IndexPath(row: 0, section: 0), at: .top, animated: false)

But when I have pod install on my project I notice that this statement is missing from source code and it cause exception at runtime when DropDownMenu does not have any cell.

Could you please help me get last version via pod install?

My podfile is:
pod 'DropDownMenuKit'

Error retrieving icon from bundle

Hi,

in some cases this pod can raise an error (and cause a crash) when retrieving an icon from the xcassets file.

This happens when you subclass DropDownTitleView, therefore the pod can't retrieve the bundle in which the icon is supposed to be and finally crashes trying to unwrap a nil value.

The fix is very easy: DigitalGoal-Ltd@e98532c

Default selecting a row.

Don't know whether this is related to the repository itself, however i believe that this feature would be useful.

i've tried with following code, but does not seem to work.

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)

    let rowToSelect = IndexPath.init(row: 0, section: 0)

    navigationBarMenu.menuView.selectRow(at: rowToSelect, animated: false, scrollPosition: .none)

    // Calling manually to the delegate method
    navigationBarMenu.tableView(navigationBarMenu.menuView, didSelectRowAt: rowToSelect)
}

Creating Sections

Hi

Just wondering if it is possible to create sections with section headers like in a UITableView?

Thanks

Menu and container not released

Variable 'container' in DropDownMenu.swift (line 23) is strong reference, therefore when container is removed from view hierarhy it maintains referenced by DropDownMenu and can not be destroyed.
Solution: make container weak reference and perform necessary checks in methods show, hide and visibleContentOffset.didSet

Drop Down Menu does not work in a popup

I have a issue when using the drop down menu in pop up and choosing a cell: I get the following error:

screen shot 2017-08-24 at 4 10 31 pm

Could you please provide a solution for it? Thank you in advance

Title view collapses on the size of the first item.

Hello, I've got an issue with the DropDownTitleView, it seems to fix it's size to the first assigned text.

Even when constructing the view with a way to large frame I run into the same issue:

DropDownTitleView(frame: CGRect(x: 0, y: 0, width: 400, height: 40))

Images say more than words:

Do you have a recommendation how to solve this issue?

And a big thank you for the work you have put into this UI component.

Table view not filled

Hi,
I fetch my data asynchronously and I fill the menuCells once I have it. My issue is the table view is not filled or may be is not displayed.

Have you a solution ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.