the reason that viewWillAppear is loaded before viewDidLoad is PageMenu call willMove(toParent:) before access the view controller's view, and according to apple's document (https://developer.apple.com/documentation/uikit/uiviewcontroller/1621381-willmove), they say:
"When your custom container calls the addChild(_:) method, it automatically calls the willMove(toParent:) method of the view controller to be added as a child before adding it."
so we can remove the willMove(toParent:) and fix this problem.
the reason that viewWillAppear is loaded before viewDidLoad is PageMenu call willMove(toParent:) before access the view controller's view, and according to apple's document (https://developer.apple.com/documentation/uikit/uiviewcontroller/1621381-willmove), they say: "When your custom container calls the addChild(_:) method, it automatically calls the willMove(toParent:) method of the view controller to be added as a child before adding it." so we can remove the willMove(toParent:) and fix this problem.