MMDrawerController icon indicating copy to clipboard operation
MMDrawerController copied to clipboard

How to change centerviewcontroller based on the selection of sidemenu option?.

Open BugFinder27 opened this issue 8 years ago • 1 comments

BugFinder27 avatar Aug 03 '17 09:08 BugFinder27

Hi there, maybe I can suggest you a way around to solve your needs.

  1. You can create a handler when clicking on the table view cell e.g:
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        let model = self.items[(indexPath as NSIndexPath).row] as! LBDMenuModel;
    
        if (model.Id == "-1") {
            dashboardService.showMaps();
        } else if (model.Id == "-2") {
            dashboardService.getFavorites();
        } else {
            if (model.Id != "") {
                dashboardService.getDashboardPlaces(Int(model.Id));
            }
        }
        closeDrawer();
}
  1. Then by using implementing that handler on your center view controller, you can navigate to your desired view controller e.g
class LBDDashboardViewController: UIViewController, ILBDDashboardView {
...

func showMaps() {
        performSegue(withIdentifier: "dashboard_map_sid", sender: self);
}
}

From my perspective this is not a bug. Give it a go and let me know further

paramadharmika avatar Sep 28 '17 15:09 paramadharmika