>>What occurs when you return to Portrait ? Do open and close work properly again ?If an orientation change has never occurred then the animation works fine. As soon an an orientation occurs then the new orientation will experience this issue (see below) Application starts in portrait mode and first animation attempt is in portrait mode Portrait = open animation works / close animation works Landscape = open animation works / close animation messed up Portrait = open animation works / close animation works Landscape = open animation works / close animation works Application starts in portrait mode, then I toggle to landscape mode and then first animation attempt is performed in landscape mode Landscape = open animation works / close animation messed up Portrait = open animation works / close animation works Landscape = open animation works / close animation messed up Portrait = open animation works / close animation worksApplication starts in landscape mode and first animation attempt is in landscape mode Landscape = open animation works / close animation works Portrait = open animation works / close animation messed up Landscape = open animation works / close animation works Portrait = open animation works / close animation messed up Application starts in landscape mode, then I toggle to portrait mode and then first animation attempt is performed in portrait mode Portrait = open animation works / close animation messed up Landscape = open animation works / close animation works Portrait = open animation works / close animation messed up Landscape = open animation works / close animation works>>Could you detail [the constraints] ?dataView constraints are pretty basic: Align Top to safe area = 20 Align Bottom to safe area = 20 Align Leading to safe area = 16 Align Trailing to safe area = 16>>What is the problem you want to avoid ?The issue is when the viewWillLayoutSubviews( ) function is been processed before the animation in the CloseView( ) function has completed. When I click the CloseButton, then the CloseView( ) function is called and the UIView_Animate( ) function (line 44 above) is called. This function should animate the dataView by moving it from "origin.x = 16 to origin.x" = "self.getScreenSize().width + 100". When the viewWillLayoutSubviews( ) function fires before the animation completes then the dataView "Align Leading to safe area = 16" constraint setting is set again, thus moving the dataView back to origin.x =16 while the animation is active, thus messing up the animationMy thoughtsI thought I would simply remove the constraints from the dataView "View" so the viewWillLayoutSubviews( ) function would no longer reposition the dataView when the animation is active since there would be no constraints to act on anymore. However, all of the other objects(views) which I have inside the dataView (that I did not mention, so I could keep my issue simplified) would all have constraint errors. As a result, I cannot remove the constraints from dataView.
Post
Replies
Boosts
Views
Activity
thanks for your help !