Skip to content

badgevalue disappears if I change viewcontroller using pushViewController #32

@tattva20

Description

@tattva20

For some strange reason if I change from screen A to screen B using a slidemenu with the pushViewController instruction the badgeValue disappears, but if I turn off animations it stays there.

This is the method I'm using.

func openViewControllerBasedOnIdentifier(_ strIdentifier:String){
let destViewController : UIViewController = self.storyboard!.instantiateViewController(withIdentifier: strIdentifier)

let topViewController : UIViewController = self.navigationController!.topViewController!

if (topViewController.restorationIdentifier! == destViewController.restorationIdentifier!){
    print("Same VC")
} else {
    var numeroProductos = String(Carrito.numProd)

    self.navigationController!.pushViewController(destViewController, animated: true)


  }
}

If instead of using .pushViewController I perform a normal segue this doesn't happen, in either case I load the badgeValue again on viewDidLoad. Any ideas? I'm using swift 3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions