javalnanda / JNDropDownMenu

Swift version of https://github.com/dopcn/DOPDropDownMenu
MIT License
64 stars 8 forks source link

DidSelectRow delegate not works #7

Closed kerimovscreations closed 7 years ago

kerimovscreations commented 7 years ago

I'm using this library with 3 columns, but can't catch did select row delegate. func didSelectRow(at indexPath: JNIndexPath, for forMenu: JNDropDownMenu) { print("selected some") var str = "" switch indexPath.column { case 0: str = cousins[indexPath.row] break case 1: str = categories[indexPath.row] break case 2: str = regions[indexPath.row] break default: str = "" } print(str + " selected") }

kerimovscreations commented 7 years ago

I tried this method in an empty view controller, it worked. But I need this drop down in a container view, it doesn't work inside container view.

kerimovscreations commented 7 years ago

If the drop down content exceeds from container view height, it doesn't respond on select row delegate.

javalnanda commented 7 years ago

Can you share your project or a POC code so that I can investigate the way in which you are implementing it?

kerimovscreations commented 7 years ago

image I'm trying to make such a view. In the right side, I add drop down menu. In a result, if menu content exceeds the height of container view, table view doesn't respond to did select row delegate.

javalnanda commented 7 years ago

Is your Search Filters Fragment View Controller occupying fullscreen? It is hard to judge the final output you are trying to achieve from this. By default, menu occupies the height of its parent view when added to the view controller. But there is an option to pass custom height for the menu based on where you are adding it. That should solve your problem.

kerimovscreations commented 7 years ago

Search Filters Fragment View Controller doesn't occupy full screen, it has fixed 80 height. The menu is shown in full screen, I agree. But if its content becomes more than 80, it doesn't respond to select row delegate. I can create a simple one-page project and give this example.

kerimovscreations commented 7 years ago

Sample Drop Down.zip Here you can look through my case

javalnanda commented 7 years ago

This is kind of odd UI Implementation. Can you share a UI design [shared by your designer] that you are trying to achieve? A View cannot get touch events outside the bounds of its parent view which you are trying to achieve here. You can instead add a menu in the same area where you have container view above the scroll view in the same view controller. I don't see a need for separate container view over there. This is not specific to the drop-down menu but an issue related to UI Implementation.

javalnanda commented 7 years ago

I am closing this issue as this is not a drop-down related issue. It is a basic iOS concept where a touch event cannot be received outside the bounds of its container/parent view.

kerimovscreations commented 7 years ago

image I need to implement Android style - Spinner, to select the filters and search with these filters. I'm also experienced in Android and expected the same functionality from this library. The menu has shadow below itself, and I guessed it has placed over the container view - like alert style view.

javalnanda commented 7 years ago

It is not built the way spinner behaves. You can search for custom PickerView which can give you similar experience as Android's spinner