Hello Brian, I have a question
At 19:33, you finished the animation with the slide menu. Everything was okay. I clicked the hide button, the menu was gone with animation. However, when I click the open button, the menu view was not shown up.
I did a little bit debug and I found that the animation works only the first time the open button is pressed. After the menu view is hidden by pressing the hide button (it is removed from the superview and from it’s parent view with no animation implemented), if I click the open button again, the animation seems not working.
First open
--------------------------------------
frame 1: (-331.20000000000005, 0.0, 331.20000000000005, 896.0)
Transform with with: 331.20000000000005
frame 2: (0.0, 0.0, 331.20000000000005, 896.0) // It is transform and shown
Second open
--------------------------------------
frame 1: (-331.20000000000005, 0.0, 331.20000000000005, 896.0)
Transform with with: 331.20000000000005
frame 2: (-331.20000000000005, 0.0, 331.20000000000005, 896.0) // Transformation fails since position x is not changed
Third open
--------------------------------------
frame 1: (-331.20000000000005, 0.0, 331.20000000000005, 896.0)
Transform with with: 331.20000000000005
frame 2: (-331.20000000000005, 0.0, 331.20000000000005, 896.0) // Transformation fails since position x is not changed
Everything works fine when the animation is also added to the hide button method
--------------------------------------
frame 1: (-331.20000000000005, 0.0, 331.20000000000005, 896.0)
Transform with with: 331.20000000000005
frame 2: (0.0, 0.0, 331.20000000000005, 896.0) // It is transform and shown
--------------------------------------
frame 1: (-331.20000000000005, 0.0, 331.20000000000005, 896.0)
Transform with with: 331.20000000000005
frame 2: (0.0, 0.0, 331.20000000000005, 896.0) // It is transform and shown
--------------------------------------
frame 1: (-331.20000000000005, 0.0, 331.20000000000005, 896.0)
Transform with with: 331.20000000000005
frame 2: (0.0, 0.0, 331.20000000000005, 896.0) // It is transform and shown
To me, in the first case, since the menuViewController is removed from the superview and form its parent, each time the shown button
is pressed, it should be reconstructed and add it to its parent view (illustrated by frame 1 in the first part), and the animation should be
executed, however, it turns out it is not the case.
Could you give me a hint why this is happening?