How to stop responding to a shake before a button is pressed?

前端 未结 1 1965
情深已故
情深已故 2021-01-27 08:31

i am currently making a iPhone app, and a animation reacts to a small shake, this is my code:

static BOOL SJHShaking(UIAcceleration* last, UIAcceleration* curren         


        
1条回答
  •  深忆病人
    2021-01-27 09:30

    Just have a variable that gets set when they press the button. Then in the method that determines whether a shake has taken place, first check whether the button has been clicked.

    For example, in the didAccelerate method, you could first check if the button had been pressed, and if not, just return.

    0 讨论(0)
提交回复
热议问题