GithubHelp home page GithubHelp logo

Comments (10)

thihaaung6245 avatar thihaaung6245 commented on July 21, 2024

Try to add this code in your view controller's viewDidLoad() which will be display after login successful

self.slideMenuController()?.openRight()

from slidemenucontrollerswift.

lazarte avatar lazarte commented on July 21, 2024

This is the flow.

  • NavigationController
    • LoginController
      • SlideMenuController

from slidemenucontrollerswift.

thihaaung6245 avatar thihaaung6245 commented on July 21, 2024

Would u mind sharing your sample project on dropbox or some cloud storage and see if i can fix

from slidemenucontrollerswift.

lazarte avatar lazarte commented on July 21, 2024

same with this one

#45

from slidemenucontrollerswift.

lrojas94 avatar lrojas94 commented on July 21, 2024

My app uses the same structure (kind of) What I did was add a navigationController as the mainViewController of the SlideMenuController. Having that done, you can choose to put buttons, open the LeftViewController or whatever you want, and also change viewControllers using the navigationController's presentViewController. That work's for me so far. The project's at work (which I will attend to on Monday), if you need to, I can show you a bit of code. Sorry, dont have a mac at home.

from slidemenucontrollerswift.

alecsechechel avatar alecsechechel commented on July 21, 2024

Hi maybe this help

// MARK: - UICollectionViewDelegate
func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
    dataKedzoh?.setSubdomain(companies[indexPath.row].subdomain)
    dataKedzoh?.getUserInfo()
    let vc = createMenuView()
    self.presentViewController(vc, animated: true, completion: nil)
}

// MARK: - Create menu
func createMenuView() -> SlideMenuController {

    let mainViewController = kStoryboard.instantiateViewControllerWithIdentifier("TakeLesson") as! TakeLessonViewController
    let leftViewController = kStoryboard.instantiateViewControllerWithIdentifier("LeftViewController") as! LeftViewController
    let nvc: UINavigationController = UINavigationController(rootViewController: mainViewController)

    leftViewController.mainViewController = nvc
    let slideMenuController = SlideMenuController(mainViewController:nvc, leftMenuViewController: leftViewController)

    return slideMenuController
}

and next screen
// MARK: - View Controller Cycle
override func viewDidLoad() {
super.viewDidLoad()
self.setNavigationBarItem()
}

from slidemenucontrollerswift.

ded avatar ded commented on July 21, 2024

when setting leftViewController.mainViewController = nvc I get mainViewController is not a property of leftViewController

from slidemenucontrollerswift.

ded avatar ded commented on July 21, 2024

btw, I was able to remove that one line altogether and it worked fine.

from slidemenucontrollerswift.

yusufonderd avatar yusufonderd commented on July 21, 2024

I have same issue. Can you find any solution ? @lazarte

from slidemenucontrollerswift.

Neeraj204 avatar Neeraj204 commented on July 21, 2024

@ded @yusufonderd try this code:

    @IBAction func onBtnLoginClick(_ sender: Any) {

    let mainViewController = self.storyboard?.instantiateViewController(withIdentifier: "HomeViewController") as! HomeViewController
    let leftViewController = self.storyboard?.instantiateViewController(withIdentifier: "MenuViewController") as! MenuViewController
    let nvc: UINavigationController = UINavigationController(rootViewController: mainViewController)
    
    leftViewController.homeViewController = nvc
    let slideMenuController = SlideMenuController(mainViewController:nvc, leftMenuViewController: leftViewController)
    slideMenuController.automaticallyAdjustsScrollViewInsets = true
    slideMenuController.delegate = self
    self.navigationController?.pushViewController(slideMenuController, animated: true)

      }

from slidemenucontrollerswift.

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.