I am a new ios developer. I want to create an ios app where i want to add two view.At first when app start then first view will show. There will be a button . When tap on button then the second view is show on the screen from left to right and Not full screen but half part on the screen.
How can i do that.
Thanks in advance.
I am a new ios developer. I want to create an ios app where
Share
It’s actually quite easy with the help of UIView’s animateWithDuration wrapper. If you are unfamiliar with blocks, this is also an excellent learning opportunity.
First, declare two UIView objects in the .h and define the method you want to hook up to the button:
Now in the .m, define your action (notice it’s return type changes to void, but it’s signature stays the same):
This should animate the frame of the first view to take up half of the screen, and then animate the second view to sort of fly in and take up the other half. Make sure to hook up that IBAction to a button in a XIB before you run it though.