UIBarButtonItem-Badge icon indicating copy to clipboard operation
UIBarButtonItem-Badge copied to clipboard

badgevalue disappears if I change viewcontroller using pushViewController

Open tattva20 opened this issue 8 years ago • 1 comments

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

tattva20 avatar Jan 07 '17 01:01 tattva20

Same Problem to me also

ewavestech avatar Jan 11 '17 07:01 ewavestech