Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use the drop down from the navigation bar's top right side #125

Open
ayushmandey97 opened this issue Jul 1, 2017 · 6 comments
Open

Comments

@ayushmandey97
Copy link

screen shot 2017-07-01 at 3 48 43 pm

So the bar button item having ". . ." is where I want the dropdown to happen, instead of the title.
Any ideas as to how to accomplish this?

@PhamBaTho
Copy link
Owner

@ayushmandey97 currently the feature you're requesting is not supported. But I do want it because the rightButtonBarItem is also a part of navigation view. Thanks.

(just out of curious, why do you close this interesting feature request?)

@ayushmandey97
Copy link
Author

ayushmandey97 commented Jul 6, 2017

Actually I was able to find a way to do that, so I closed it. My bad.

So this is how I did it:

  1. Drag a UIView to the right side of the navigation bar. And create an outlet to it named "navOptionView".

screen shot 2017-07-06 at 2 18 56 pm

  1. Use this code snippet to make it work like I wanted it to.
//Setting the toolbar for dropdown menu
let menuView = BTNavigationDropdownMenu(title: ". . .",  items: items as [AnyObject])
self.navOptionView.customView = menuView
menuView.didSelectItemAtIndexHandler = {[weak self] (indexPath: Int) -> () in
      print("Did select item at index: \(indexPath)")
}

@ayushmandey97 ayushmandey97 reopened this Jul 6, 2017
@PhamBaTho
Copy link
Owner

Nice workaround. Thanks for sharing 👍

@ayushmandey97
Copy link
Author

No problem. Just one more thing, incase someone implements this till the feature is ready.
Inside the BTNavigationDropdownMenu.swift file, comment out the following line.

func setMenuTitle(_ title: String) {
        //self.menuTitle.text = title
}

This is so that the ". . ." button doesn't change every time you select an option.

@djayhsu
Copy link

djayhsu commented Oct 10, 2017

@ayushmandey97 Another option is to just set menuView.shouldChangeTitleText = false

@ivanJovanovik
Copy link

Can I use Image ( three dots ) for right bar button and make dropdown ?

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

No branches or pull requests

4 participants