Code Monkey home page Code Monkey logo

Comments (6)

ejpusa-zz avatar ejpusa-zz commented on August 24, 2024

It's wrapped in a NavigationController, can you just drag a button out? Drop it, and should be there. Double check colors and if you have setup autolayouts, and change things, all view elements can get super out of wack. Just updates those constraints. Your button should show up.

from enswiftsidemenu.

FrancisBaileyH avatar FrancisBaileyH commented on August 24, 2024

@bcbucs13 did you have any luck implementing the back button?

from enswiftsidemenu.

bcbucs13 avatar bcbucs13 commented on August 24, 2024

I moved the menu to the top right rather than the top left and the back bottom started showing up

from enswiftsidemenu.

bakomchik avatar bakomchik commented on August 24, 2024

Hi, i found solution.
i just change setContentViewController function in ENSideMenuNavigationController
for pushing viewController into stack :

    public func setContentViewController(contentViewController: UIViewController) {
        self.sideMenu?.toggleMenu()
        switch sideMenuAnimationType {
        case .None:
            self.viewControllers = [contentViewController]
            break
        default:
            contentViewController.navigationItem.hidesBackButton = true
          //self.setViewControllers([contentViewController], animated: true)
            self.pushViewController(contentViewController, animated: true)
            break
        }

    }

I'm new in IOS development,
therefore i have question for @evnaz :
Does that code above is correct way to add back button?

from enswiftsidemenu.

ncerezo avatar ncerezo commented on August 24, 2024

The setContentViewController method replaces the current view controller, from that controller you can push and pop other controllers in the navigation stack. That's why the code uses setViewControllers.
If you push the controller you're adding that controller, meant to replace the whole stack, on top of the stack.

The only way, as far as I know, of making the back button show up is to place the side menu on the right, and of course the menu button on the right of the navigation bar.
If you put any button on the left, the navigation bar can't show the back button, since a navigation bar can only have two buttons: one on the left, another in the right.
If you leave the left one empty, the navigation bar uses that place for the back button automatically.

More over, in recent iOS releases the swipe gesture also performs the back operation, so putting the menu on the left side would also block that feature.

If you don't like the default behavior you can always make the navigation bar hidden and create your own navigation bar. Some apps, like Amazon for example, use that approach.
I prefer to stick to the given behavior, even with its shortcomings, since the user has no need to learn how your app works: it works like the rest of the device apps.

from enswiftsidemenu.

djdance avatar djdance commented on August 24, 2024

I can insert and use Back button even in left-case menu, but I can not dismiss view. Why? it just does nothing

@IBAction func t(_ sender: Any) {
    //toggleSideMenuView()
    dismiss(animated: true, completion: nil)
}

from enswiftsidemenu.

Related Issues (20)

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.