Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touch Event #18

Open
flyingmate opened this issue Apr 5, 2016 · 9 comments
Open

Touch Event #18

flyingmate opened this issue Apr 5, 2016 · 9 comments

Comments

@flyingmate
Copy link

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)")
}
@evgenyneu
Copy link
Owner

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.

@mrsnax
Copy link

mrsnax commented May 28, 2016

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

@evgenyneu
Copy link
Owner

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

@bertadevant
Copy link

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 :)

@evgenyneu
Copy link
Owner

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.

@alfazeeweb
Copy link

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

@evgenyneu
Copy link
Owner

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

@alfazeeweb
Copy link

@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

@evgenyneu
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants