PageMenu / PageMenu

A paging menu controller built from other view controllers placed inside a scroll view (like Spotify, Windows Phone, Instagram)
BSD 3-Clause "New" or "Revised" License
5.27k stars 900 forks source link

fix issue #71 :: viewWillAppear is loaded before viewDidLoad #480

Closed suindong closed 5 years ago

suindong commented 5 years ago

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.

suindong commented 5 years ago

I found there is another bug for this issue, so closed