Auk icon indicating copy to clipboard operation
Auk copied to clipboard

Touch Event

Open flyingmate opened this issue 8 years ago • 9 comments

Hi, I love this library, it's much simpler and clearer than other carousel libraries. I wonder if there is a simple way to handle touch events on each image.

For now, I'm adding a guesturerecognizer to the scrollview and detecting touch events with currentPageIndex. I just wanted to know if there's a more elegant way :)

let gesture = UITapGestureRecognizer(target: self, action: #selector(touchedScrollView))
scrollView!.addGestureRecognizer(gesture)

func touchedScrollView(sender: AnyObject) {
    print("touch \(scrollView!.auk.currentPageIndex)")
}

flyingmate avatar Apr 05 '16 15:04 flyingmate

Hi @flyingmate, thanks for the compliments and good question. No, there is no shortcut of doing that currently unfortunately. Maybe we should create one, something like:

scrollView.auk.didTap = {
  // User has tapped the scroll view
}

Feel free to submit a pull request.

evgenyneu avatar Apr 05 '16 23:04 evgenyneu

@evgenyneu its available when touch indexed slider open the links ?

mrsnax avatar May 28 '16 15:05 mrsnax

Hi @mrsnax, sorry I did not quite understand your question. Can you explain a bit more please?

evgenyneu avatar May 28 '16 21:05 evgenyneu

Hi @evgenyneu I love this library too! I have a couple of questions:

Can you disable the user tap? Meaning can I stop them from changing the slides? I am trying to have the sync to an audio timing so i do not want user Input.

And can you have those slides as FullScreen? for portrait and landscape?

Thanks :)

bertadevant avatar Nov 21 '16 13:11 bertadevant

Hi again, @bertadevant.

One can prevent user from interacting with a view by settings its isUserInteractionEnabled to false.

scrollView.isUserInteractionEnabled = false

Or you can do the same in the storyboard by unchecking the "User Interaction Enabled" property in the Attributes inspector:

user_interaction_enabled_xcode

As for the full screen, I have answered it in #53. Let me know how it goes.

evgenyneu avatar Nov 21 '16 20:11 evgenyneu

How to disable touch event and keep the slide gesture as it is? Make isUserInteractionEnabled false will stop even the slide gesture too.

alfazeeweb avatar Oct 13 '18 10:10 alfazeeweb

Hi @alfazeeweb, could you explain what you want to achieve in more detail? I don't quite understand what you mean.

evgenyneu avatar Oct 13 '18 10:10 evgenyneu

@evgenyneu Thanks for the quick response, I have a table view that contains cells having the scroll view and other data relate to the cell. Now, if a user taps on the cell, the tap is consumed by the scrollview, and the 'didTapTableViewcell' isn't called. Attached is an image of my view:

simulator screen shot - iphone 5s - 2018-10-13 at 15 10 18

alfazeeweb avatar Oct 13 '18 11:10 alfazeeweb

Good question, I do not know how to do this, sorry. Maybe try searching on stackoverflow? Nice app design by the way. :)

evgenyneu avatar Oct 13 '18 11:10 evgenyneu