Giter Club home page Giter Club logo

btnavigationdropdownmenu's People

Contributors

andrevasilev avatar bclymer avatar bkrastev avatar dx avatar farshidce avatar frostover avatar ilyailya avatar justindhill avatar kriskelly avatar lookfirst avatar naoyashiga avatar ninjarz avatar phambatho avatar readmecritic avatar rickerbh avatar rishabhtayal avatar skywinder avatar thorin-grab avatar tuanphung avatar vortec4800 avatar zkrige 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  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

btnavigationdropdownmenu's Issues

Separator color

Hi,

Why is my first separator light (compared to your gif)? Also, how do I change the separator color altogether?

Thanks!

Menu is hidden behind the viewcontroller

I have one ViewController in a NavigationController where the menu is not working. Other viewcontrollers are working as aspected. Not sure what happens yet but Reveal shows me this:

screen shot 2015-11-30 at 12 53 09

And the fix was to add the menuWrapper to the navigationController and not to the window (#251).

    // Add Menu View to container view
    //window.addSubview(self.menuWrapper) //COMMENT THIS
    self.navigationController?.view.addSubview(self.menuWrapper) //FIX

I tried to reproduce in a sample project but no luck, think my project changes or uses the keywindow.

Any idea? And does the fix seems to be ok?

call from UISplitViewController

Hi, i an using two storyboards, one for iphone and one for ipad (this one is always in landscape). I`m changing line 218+ from BTNavigationDropDownMenu, checking if my UINavigationController has a parent UISplitViewController, and changing the menuWrapperBounds origin x based on the masterViewController (my menu) frame.

It worked, but i had to split my masterViewController size by 2 and i cant understand why this is needed, can you help me please?

the code:

 var menuWrapperBounds = window.bounds


        if let uISplitViewController = navigationController.parentViewController as? UISplitViewController {

            let splitWidth = uISplitViewController.viewControllers[0].view.bounds.size.width
            menuWrapperBounds.origin.x = splitWidth / 2 // why the /2 is needed?
           // menuWrapperBounds.size.width = menuWrapperBounds.size.width - splitWidth

        }

Without changing the width:
image

Chaging the width without the /2
image

Chaging the width with the /2
image

titleView is going outside the navigation bar !!

Hi just wanted to mention that in 6 and 5s i'm noticed that the title view is outside the bar

so I had to edit the line to be like this:
// Set frame
let frame = CGRectMake(0, 0, titleSize.width + (self.configuration.arrowPadding + self.configuration.arrowImage.size.width)*2, self.navigationController!.navigationBar.frame.height-12)

-12 at the end is my addition. Of course this is very lazy and can break in other layouts but anyway i felt i need to report this.

Appear overtop tab bar controller

When your navigation controller is embedded inside a tab bar controller, the dropdown overlay doesn't appear overtop the tab bar.

Version 1.9, still crashes on init

Looks like the fix for the old issue where the line "self.navigationController = UIApplication.sharedApplication().keyWindow?.rootViewController?.topMostViewController?.navigationController" was nil on init, was fixed by letting programmer pass in their own navigationController.

However, I'm noticing that the line "let window = UIApplication.sharedApplication().keyWindow!" crashes as well. In my app, there is nothing set to keyWindow.

Adding new items after initialized?

Is there an easier way to add new items for the dropdown menu after it has been initialized?
Right now I'm recreating it but I'm experiencing crashes when doing this?

Crash on init

I can't get the drop down menu to work, it keeps crashing as soon as it starts loading. It crashes at the point where it creates the frame in the "init" function. I am using Xcode 6.4 with iOS 8.

Here's my code:

import UIKit
import CVCalendar
import BTNavigationDropdownMenu

class RosterViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, UITextFieldDelegate {

@IBOutlet weak var menuButton:UIBarButtonItem!
@IBOutlet weak var tableView: UITableView!
@IBOutlet weak var calendarView: CVCalendarView!
@IBOutlet weak var menuView: CVCalendarMenuView!

var menuViewNav: BTNavigationDropdownMenu!

override func viewDidLoad() {
    super.viewDidLoad()

    tableView.delegate = self
    tableView.dataSource = self
    tableView.tableFooterView = UIView()

    let items = ["Most Popular", "Latest", "Trending", "Nearest", "Top Picks"]
    menuViewNav = BTNavigationDropdownMenu(title: "Hey", items: items)
    menuViewNav.didSelectItemAtIndexHandler = {(indexPath: Int) -> () in
        print("Did select item at index: \(indexPath)")
    }
    self.navigationItem.titleView = menuViewNav

    if self.revealViewController() != nil {
        menuButton.target = self.revealViewController()
        menuButton.action = "revealToggle:"
        self.view.addGestureRecognizer(self.revealViewController().panGestureRecognizer())
    }
}

How to manually set selected cell

I am using the menu to send NSNotifications to a navigation controller, where selecting a cell chooses which view controller to navigate to. In order to make this possible, each view controller has it's own instance of BTNavigationDropdownMenu.

This means that navigating to a new view controller instantiates a new dropdown menu, so the checkmark is always on the first cell. I'd like to be able to manually select which cell has the checkmark.

Is this currently possible?

menu arrow image changes are not applied ever

When setting the arrowImage after creating the menu, it never actually tries to set the menuArrow image view image field to the newly assigned image.

Also the size of the image is forced to being a weird aspect ratio of 12/7, seems like the arrow image icon frame should be square, makes it easier to get an icon into it without looking weird.

Dismiss Menu when changing views

Thank you for this great menu. It works very well.

My only issue is I use it in "ViewController2". When the menu is displayed, the user can push the "back" button to unwind to "ViewController1", and the menu remains the displayed in "ViewController1"

It does not cause any crashes or generate errors/warnings. It just looks odd.

Thank You Again,
Paul

Can't call BTNavigationDropdownMenu

Maybe something I'm doing wrong, but I can't call BTNavigationDropdownMenu from my ViewController. Noob on here, so let me know what code you need to see to help diagnose.

How to check which menu item is selected?

I would like to check which item is selected in the menu.

Something like....

let p = self.navigationDropDown!.selectedIndex

I'm aware I could change the library directly - but I'm using Pods so would much prefer this was built into the library native.

Possible?

Cheers!

Bug in UpdateItems

When you call updateItems after initialise;
for example items = [] in viewDidLoad and you make http request to get your items and fill items finally updateItems new filled items array.

I solve problem change this line at line 261

self?.setMenuTitle("\(items[indexPath])")
to
self?.setMenuTitle("\(self!.tableView.items[indexPath])")

Run Time Error on Xcode Version 7.1.1 (7B1005)

no errors during compile or in editor but when you go to a view that trys to instantiate the menu...you get a run time error as follows:
2015-12-10_20-08-59 btnavigationdropdownmenu
2015-12-10_20-08-59 btnavigationdropdownmenu2

Since i am totally new to Swift and Xcode, i do not know how to give any further information about errors such as logs. If i can help tell me what to do.

Thank you for sharing your code and expertise.

unexpectedly found nil while unwrapping an Optional value

"direct field offset for BTNavigationDropdownMenu.BTNavigationDropdownMenu.(configuration in _2FD11A7176F1278EC9F8CADD0C8AF5A3) : BTNavigationDropdownMenu.BTConfiguration"

Over and Over again facing this issue.Whenever trying to initialize this issue occures.

to use the menu to instantiate other view controllers

As it is, the control is using only one viewController. How would I use the control so that when i select a row in it, I instantiate another view controller. I'm doing it this way:

        ...
        print("Did select item at index: \(indexPath)")
        let vc = self.storyboard?.instantiateViewControllerWithIdentifier(self.items[indexPath])

        self.presentViewController(vc!, animated: true, completion: nil)
    }

and it does work. it brings up a vc with the identifier as is labelled in the storyboard except i lose the navigation bar along with the menu when i select any other viewController except the one that's embedded in a navigationController.

I've tried embedding all the VC's in their own navigationControllers but nothing.
I've tried copying all the 'menuView' code into each of the viewController's classes but I still don't get the menu when I select a different viewController.

Assist me please? *sorry if its kind of a noob question. I'm only just learning Swift. Thanks!

Too many menu items

For many menu items, some are hidden, can not scroll up and touch down.
iOS 9.3 / iPhone6

DropdownMenu leaks memory

Hi,

i create a function which will create the DropdownMenu.
Every time i run this function 2mb of ram will get lost.

if i open a view like in you example close it an reopen it 5-10mb of ram are lost.

hope you understand what i mean.

i think it has something to do with "closures and strong reference cycle",
but i didn´t find the error.

Thanks.

IsShown property.

Please make isShown property public and reachable, because sometimes you really need to know is menu open right now or not.

Rotate Problem and Scrolling

Hi,
i have found two issue for this fantastic DropDownMenu.

  1. If the menu is opened and i rotate the device (from portrait to landscape) there are problems. If the menu is opened and i rotate the device (from landscape to portrait) the navigation bar disappears.

simulator screen shot 29 dic 2015 20 29 38
simulator screen shot 29 dic 2015 20 29 57

  1. If the list contains many elements the scroll doesn't work

Thanks in advance.

All of a sudden... fatal error: unexpectedly found nil while unwrapping an Optional value

Love this library. Been using it for a while now, but after upgrading cocoapods and reinstalling all the pods, I know am hitting a strange error. Nothing else has changed, but this is now the issue I'm seeing:

cell.checkmarkIcon.hidden = (indexPath.row == selectedIndexPath) ? false : true

Running XCode 7.3.1 and the latest BTNavigationDropdownMenu

Any idea why this is happening? It could certainly be me, but I haven't been able to solve it for some time. Thanks!

kane

How to close programatically?

@PhamBaTho Is there a way to close the menu programatically? When I press my rightBarButtonItem with the menu opens, it remains open, I would like to close it in my Action.

Thanks!

Alternate scope initialization

Something like...

let menuView = BTNavigationDropdownMenu()

let items = ["Foo", "Bar"]

override func viewDidLoad() {
     super.viewDidLoad()
     menuView = BTNavigationDropdownMenu(navigationController: self.navigationController, title: "Main Menu", items: items)
}

This would help with keeping the navigation title static, as the menuView could re-initialize in viewDidAppear()

CellTitle is too many characters

So I've been looking a bit at this library and it does exactly what I need/want so I'd like to use it. However, I've noticed that it does not truncate labels that are too large. So for instance I can have a text like "this is a very long text and will most likely not fit" as a cell and it will just keep on going out of its bounds and run over the icon and through my navigationbar as well. Is there a way to prevent this?

Here is a print screen of what I'm describing

How to disable dragging menu to down?

When I click on arrow, my menu opens, but when I drag it down it stretches. How can I disable it? Just fixed size, without stretching down after opening? Thanks!

UIAccessibility

Hello,

Your navigation dropdown menu is very cool. I use it on a new application. A lot of my future user are blind people. I may implement UIAccessibility. It not a hard work.

I'm using your code via cocoa pod. This my question how to set UIAccessibility for menu title and menu item.

regards
seb

How to center

Hi @PhamBaTho,

I noticed that the title is not always centered depending on the device (iPhone 5s vs iPhone 6).

Do you have any tip?

Issues with new release of Xcode Version 7.1.1 (7B1005)

17 errors occur when loading this code in the above version of Xcode. The first four are:
1 Invalid redeclaration of 'BTNavigationDropdownMenu'
2 Cannot invoke 'BTConfiguration' with no arguments
3 'BTTableView' is ambiguous for type lookup in this context
4 Invalid redeclaration of 'BTConfiguration'

Unfortunately, since i am just now learning SWIFT, i cannot offer corrections or suggestions. Thank you for sharing your code for others.

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.