qmathe / dropdownmenukit Goto Github PK
View Code? Open in Web Editor NEWUIKit drop down menu, simple yet flexible and written in Swift
License: Other
UIKit drop down menu, simple yet flexible and written in Swift
License: Other
The title says it all.
Thank you.
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
on cell.menuAction selector like this:
func choose(_ sender: AnyObject) {
titleView.toggleMenu()
showHud();
hideHud();
}
and the dropMenu animation will be strange.
UIViewAnimationOptions' has been renamed to 'UIView.AnimationOptions'
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?
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?
The dropdown menu is not clickable and looks much smaller on iOS 11 devices.
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"
Hello
I've translated the readme into Russian. Could you please add a link to it into readme?
http://gargo.of.by/dropdownmenukit/
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 :
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
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.
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'
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
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)
}
Hi, I have tried to use "titleView.menuDownImageView.tintColor = UIColor.white" but it didn't work. The color was still black. Any other ideas to change it?
the version where there is up and down arrows and also the segment where you select what you want to sort on? Its spot on what I'm looking for.
Thanks
Hi
Just wondering if it is possible to create sections with section headers like in a UITableView?
Thanks
In my case UITabBarController
is root. So if I add this control into inner navigation bar then it won't overlay UITabBar
and UITabBarController
is still clickable
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
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.
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 ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.