SSASideMenu icon indicating copy to clipboard operation
SSASideMenu copied to clipboard

Call of custom views from menu generating errors

Open chrsp opened this issue 8 years ago • 3 comments

Hi. I'm trying to call my View from LeftMenu:

  func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {

    tableView.deselectRowAtIndexPath(indexPath, animated: true)

    switch indexPath.row {
    case 0:
      sideMenuViewController?.contentViewController = UINavigationController(rootViewController: ProfileMgmtViewController())
      sideMenuViewController?.hideMenuViewController()
      break

But always when I click on the option 0 (first line) from LeftMenu I get stuck here:

captura de tela 2016-06-06 as 11 50 31

My ProfileMgmtViewController class:

import UIKit

class ProfileMgmtViewController: UIViewController {

  @IBOutlet weak var bgImageContainerView: UIView!
  @IBOutlet weak var userBgImg: UIImageView!
  @IBOutlet weak var userImg: UIImageView!
  @IBOutlet weak var segmentedTabs: UISegmentedControl!

  @IBOutlet weak var userDocsTableView: UIView!
  @IBOutlet weak var userAddressesTableView: UIView!
  @IBOutlet weak var userContactsTableView: UIView!

  override func viewDidLoad() {
    super.viewDidLoad()

    title = "Meus Dados"

    navigationItem.leftBarButtonItem = UIBarButtonItem(image: UIImage(named: "menu"), style: .Plain, target: self, action: #selector(SSASideMenu.presentLeftMenuViewController))

    userImg.layer.cornerRadius = userImg.frame.size.width / 2
    userImg.clipsToBounds = true

    userImg.layer.borderWidth = 1
    userImg.layer.borderColor = (UIColor.whiteColor()).CGColor

    //userBgImg.backgroundColor = UIColor.greenColor()
    userBgImg.backgroundColor = UIColor(patternImage: userImg.image!)

    let blurEffect = UIBlurEffect(style: .Light)
    let blurView  = UIVisualEffectView(effect: blurEffect)
    blurView.frame = userBgImg.bounds
    userBgImg.addSubview(blurView)

    userDocsTableView.hidden = false
    userAddressesTableView.hidden = true
    userContactsTableView.hidden = true
  }

  // MARK: - Actions
  @IBAction func indexChanged(sender: UISegmentedControl) {
    switch segmentedTabs.selectedSegmentIndex
    {
    case 0:
      userDocsTableView.hidden = false
      userAddressesTableView.hidden = true
      userContactsTableView.hidden = true

    case 1:
      userDocsTableView.hidden = true
      userAddressesTableView.hidden = false
      userContactsTableView.hidden = true

    case 2:
      userDocsTableView.hidden = true
      userAddressesTableView.hidden = true
      userContactsTableView.hidden = false

    default:
      break;
    }

  }

Is that an error?

chrsp avatar Jun 06 '16 14:06 chrsp

i'm also facing same issue please provide solution for this error it would be great help ...

lakshminarayanaIOS avatar Jun 07 '16 10:06 lakshminarayanaIOS

So.... there's no solution?

chrsp avatar Jun 29 '16 13:06 chrsp

I'm using this library https://github.com/SSA111/SSASideMenu When it is used as it is, it works. However, I'm implementing this for my overall app, I mean in every ViewController, I want to use the same side bar menu, that must appear on the click of Menu bar button item. Due to spare navigation problems I guess, is not working on navigation from one control to other.

On the front view controller it is working, but if I move to some other new controller that is having his own navigation controller, on I move by clicking sidebar menu items and segue to a controller embedded in navigation controller, it does not show sidebar menu.

i-asimkhan avatar Sep 23 '16 04:09 i-asimkhan