Contents

willAnimateRotation(to:duration:)

Sent to the view controller before performing a one-step user interface rotation.

Declaration

func willAnimateRotation(to toInterfaceOrientation: UIInterfaceOrientation, duration: TimeInterval)

Parameters

  • toInterfaceOrientation:

    The new orientation for the user interface. The possible values are described in Uiinterfaceorientation.

  • duration:

    The duration of the pending rotation, measured in seconds.

Discussion

This method is called from within the animation block used to rotate the view. You can override this method and use it to configure additional animations that should occur during the view rotation. For example, you could use it to adjust the zoom level of your content, change the scroller position, or modify other animatable properties of your view.

By the time this method is called, the interfaceOrientation property is already set to the new orientation, and the bounds of the view have been changed. Thus, you can perform any additional layout required by your views in this method.

See Also

Deprecated methods