evgenyneu / Auk

An image slideshow for iOS written in Swift.
MIT License
278 stars 44 forks source link

click response #2

Closed Mor4eza closed 9 years ago

Mor4eza commented 9 years ago

hi. i have 3 image loaded from web how i can detect which image is tapped?! i'm beginner in iOS programming. thanks

evgenyneu commented 9 years ago

Hi, here is what you need to do to add an image tap handler to the scroll view.

  1. In the Storyboard drag a Tag Gesture Recognizer into your scroll view.
  2. Show assistant editor with your view controller code.
  3. Do the control-drag from the tap gesture recognizer in the storyboard into your view controller code.
  4. A dialog will appear, change the Connection to action and enter the name of the method.
  5. This method will be called when the scroll view is tapped. Use the auk.currentPageIndex property of your scroll view to get the index of the current page.

I have updated the demo app with the tap example.

Adding a connection for tap handler
evgenyneu commented 9 years ago

@zigool did my solution work for you?

Mor4eza commented 9 years ago

yes you solved my problem! thanks man

evgenyneu commented 9 years ago

Cool, I am glad it worked for you.