showSideMenu() no response
Recouse opened this issue · comments
In SideMenuItemContent
added this code:
func openMenu() {
showSideMenu()
}
and:
menuButton.addTarget(self, action: #selector(openMenu), for: .touchUpInside)
But when I click the button there is no response.
Yes, I've added my viewController to an array of contentViewControllers
. In that list my UINavigationController which connected with viewController. In array of contentViewControllers
my UINavigationController's id.
@Recouse Unfortunately, We weren't able to reproduce this issue.
So, could you provide more detailed information about your case? It would be great to see some code examples.
Here is an example https://www.dropbox.com/s/d38804nrngl0lo8/TestApp.zip?dl=1
Hi Firdavs,
UINavigationViewController should adopt SideMenuItemContent
protocol directly, not any other connected controllers:
import UIKit
import InteractiveSideMenu
class NavigationViewController: UINavigationController, SideMenuItemContent {
}
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
title = "Test App"
}
@IBAction func openMenu(_ sender: Any) {
if let navigationViewController = self.navigationController as? SideMenuItemContent {
navigationViewController.showSideMenu()
}
}
}
I've updated the code of your ViewController
file and now menu opens.
Hope, it'll help you.
@okonor Now it works. Thanks.