Skip to content

Call of custom views from menu generating errors #54

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

Open
chrsp opened this issue Jun 6, 2016 · 3 comments
Open

Call of custom views from menu generating errors #54

chrsp opened this issue Jun 6, 2016 · 3 comments

Comments

@chrsp
Copy link

chrsp commented Jun 6, 2016

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?

@lakshminarayanaIOS
Copy link

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

@chrsp
Copy link
Author

chrsp commented Jun 29, 2016

So.... there's no solution?

@i-asimkhan
Copy link

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.

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

3 participants