I am using Xcode 9.2 and Swift 4.0, and I am looking for a legal and modern way to draw a dynamically changing interface for an iOS application. For example, please look at these photos (if the blue view is hidden or disappears, then the red view should occupy the entire screen):

And the next question, I want it to move smoothly, like an animation. So the question is, what technologies exist to implement a dynamically changing interface for iOS?
I will be grateful for any help, answer or advice.
EDIT: I'm looking for a way to create design and hardness of any type. I mean the right, modern technology.
An example of my current design:

. , .