Detecting iOS orientation change instantly

后端 未结 6 2172
忘掉有多难
忘掉有多难 2020-12-02 05:38

I have a game in which the orientation of the device affects the state of the game. The user must quickly switch between Landscape, Portrait, and Reverse Landscape orientati

6条回答
  •  时光说笑
    2020-12-02 06:38

    Why you didn`t use

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    

    ?

    Or you can use this

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

    Or this

    -(void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
    

    Hope it owl be useful )

提交回复
热议问题