detect Swipe gesture in UIWebview

前端 未结 4 1629
走了就别回头了
走了就别回头了 2021-01-14 15:54

I am new to iPhone developer,

I made epub reader and loaded each page of epub in my webview

What i want to is, when user does

4条回答
  •  有刺的猬
    2021-01-14 16:40

    I don't think that swipe gestures offer support for the kind of behavior you are aiming at, but you can easily accomplish it by doing the following:

    1. on the first swipe, set a flag and start a timer; for the rest do nothing;

    2. on the second swipe,

      a. if the timer has fired (when firing, the timer reset the flag), do as per point 1.

      b. is the timer has not fired (the flag is still set), then do you action and cancel the timer.

    You might event think of defining a subclass of UISwipeGestureRecognizer to encapsulate all this behavior.

提交回复
热议问题