I have a main Viewcontroller and a Child Viewcontroller.
I realized that when closing the Childviewcontroller like:
self.dismissViewControllerAnimated(true, completion: {
self.dismissViewControllerAnimated(true, completion: nil);
});
it will just dismiss the child viewcontroller and I can see the mainview controller. No other code is processed
if I close the child viewcontroller with a notification to the main viewcontroller :
self.dismissViewControllerAnimated(true, completion: {
NSNotificationCenter.defaultCenter().postNotificationName("refreshtextviewer_with_bookmark", object: nil);
self.dismissViewControllerAnimated(true, completion: nil);
});
then my refreshtextviewer_with_bookmark() function is called in the main viewcontroller and in parallel the standard viewDidLoad() is also called.
Is it normal behaviour, that in this case the viewDidLoad() is called after dismissing the child viewcontroller ? Is there a way to prevent this ?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire