Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

DidSelectRow delegate not works #7

Closed
kerimovscreations opened this issue Aug 14, 2017 · 11 comments
Closed

DidSelectRow delegate not works #7

kerimovscreations opened this issue Aug 14, 2017 · 11 comments
Labels

Comments

@kerimovscreations
Copy link

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
Copy link
Author

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
Copy link
Author

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

@javalnanda
Copy link
Owner

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

@kerimovscreations
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Author

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

@javalnanda
Copy link
Owner

javalnanda commented Aug 14, 2017

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants