what method will called when we start to rotate device and after it finished

后端 未结 5 734
抹茶落季
抹茶落季 2021-02-01 16:54

i want to detect a rotation process on ipad programmatically. In this case i want to set a boolean into yes, when the rotation will begin, and set it false after the rotation di

5条回答
  •  有刺的猬
    2021-02-01 17:10

    From Apple Docs:

    Sent to the view controller just before the user interface begins rotating.

    - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
    

    Sent to the view controller after the user interface rotates:

    - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
    

    See more here: UIViewController Class Reference -> Responding to View Rotation Events

    ATTENTION: This is deprecated, see this post

提交回复
热议问题