I have several viewcontrollers which uses pedometer, and reading a value like 100, it goes to another viewcontroller, it still reads the value and display in print()
here's a flow, 1(home) -> 2(game/reads value) -> 3(done/result) -> 1(home)
to jump controllers to controllers,
I'm using this code (I wanted to keep it simple so this is the one that I'm using)
var vee : missionSuccessViewController = storyboard!.instantiateViewControllerWithIdentifier("success") as! missionSuccessViewController
self.presentViewController(vee, animated: true, completion: nil)
But the thing is it keeps saving the value that read in 2 so after going back to 1 and play another game, it now has 2 values, one is 140 and the new one starts with 12 and so on.
It's like they are stacking on top of each other so it causes an error.
Is there anyway that I can make the 2 viewcontroller go away and restart the viewcontroller from 1(home)?
Just like a game, make every viewcontroller disappear and restart.