UIView removeFromSuperview
-
26-09-2019 - |
Question
The removeFromSuperview method actually pulls off the image very quickly, is there a way to remove it in a animated fashion. thanks
Solution
OTHER TIPS
If you're targeting iOS4 (code snippet from UIView docs):
[UIView animateWithDuration:0.2
animations:^{ table.alpha = 0.0; }
completion:^(BOOL finished){ [table removeFromSuperview]; }];
1) insert your new subview (index of 0 so it's hidden) onto the view stack.
[window insertSubview:myNewView atIndex:0];
2) Then animation the view out (straight from the docs) is:
[UIView animateWithDuration:0.2
animations:^{ view.alpha = 0.0; }
completion:^(BOOL finished){ [view removeFromSuperview]; }]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow