I have a game, and i want to remove an obstacle. But when i do this, the view is completely refreshing itself. But I want the other subviews to stay, where they where.
To remove this subview I use:
obstacles.removeFromSuperview()
Then it disappears on the screen, but after that all other subviews are set to their original Position..
is there another method, or do i have to save the positions and after reloading set it back again? wouldn't that look bad and buggy?
Btw, when i added my view to subview, it was a let. don't know if its important..
If the other subviews move it means that their position depends on the view you removed. Working with auto layout take into account that removeFromSuperview
removes any constraints that refer to the view you are removing (or to its children).