How to implement viewing inputs and outputs on iPhone?

I would like to implement a view sliding effect, similar to the view animation presented by presentModalViewController, but the view is only shown to close half the screen.

I went like this:

1) Right before the view will be displayed and displayed, addSubview is a child view. Place it so that it does not look in the beginning.

2) Call the method on the subview view controller to execute the Core Animation code to enter it.

Doing the above does not seem to work (nothing happens - the view just appears in its original location). Adding a view ahead of schedule in viewDidLoad will also not work. Ideally, I would like the code to have the same requirement as presentModalViewController - which requires you to instantiate the view controller at the point where you need to enable the view and animate it.

It would be nice if you could specify a pointer or code to animate the view in / out.

+3
source share
3 answers

ViewTransitions Apple dev. , . , " " ... .

+2

viewController viewController.

+2

, , 2. - , , .

If what you are trying to do is an automatic animation (no user interaction). I believe that you need to: set the frame representing the final position to the sliding view. Do this in the animation block. Play with duration, curve animation, etc.

0
source

Source: https://habr.com/ru/post/1711443/


All Articles