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

Please add OneMore way to add LeftViewController and RightViewController #192

Open
dineshprabu-s opened this issue May 12, 2022 · 3 comments

Comments

@dineshprabu-s
Copy link

Currently, we have segue flow only to add Left and Right ViewController, think about people who don't use storyboard in projects
please add init with left and right viewcontroller or make the set method as public for both left and right viewcontroller

@arturdev
Copy link
Collaborator

It is pretty easy to do that in code..
In the viewDidLoad of your AMSlideMenuMainViewController do the following

class MainContainerViewController: AMSlideMenuMainViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        let leftMenuVC = storyboard?.instantiateViewController(withIdentifier: "LeftMenuVC") //Any view controlelr
        let leftMenuSegue = AMLeftMenuSegue(identifier: "leftMenu", source: self, destination: leftMenuVC!)
        leftMenuSegue.perform() //manually perform this segue
    }
}

@dineshprabu-s
Copy link
Author

dineshprabu-s commented May 12, 2022

AMRightMenuSegue class is not accessible
please declare it as open and Can't able add contentView to superview without Storyboard segue

`func setupContent() {
guard let segueName = contentSegueName else { return }
contentView.frame = view.bounds
view.addSubview(contentView)

    performSegue(withIdentifier: segueName, sender: self)
}` 

As said earlier we can't implement AMSlideView in a project which has no storyboard  

@arturdev
Copy link
Collaborator

oh my bad. WIll make it open for the rightMenuSegue as well

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

No branches or pull requests

2 participants