Let use this code after application start (replace window.rootViewController) :
let slideMenuController = SlideMenuController(mainViewController: mainViewController, rightMenuViewController: rightMenuViewController)
window.rootViewController = slideMenuController
mainViewController. viewDidAppear is call twice on iOs 10 because SlideMenuController .viewWillLayoutSubviews is called more than once and its implementation is strange : each time it uses setUpViewController which calls addChildViewController.
To my point of view, it's not a good practice to call addChildViewController on the same child several times (this duplicates viewController life cycle events). Is there a good reason for this, or is this a bug ?
Let use this code after application start (replace window.rootViewController) :
mainViewController. viewDidAppear
is call twice on iOs 10 becauseSlideMenuController .viewWillLayoutSubviews
is called more than once and its implementation is strange : each time it usessetUpViewController
which callsaddChildViewController
.To my point of view, it's not a good practice to call
addChildViewController
on the same child several times (this duplicates viewController life cycle events). Is there a good reason for this, or is this a bug ?