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

How to keep autoscrolling when the user starts scrolling manually? #44

Closed
riyanpratamap opened this issue Aug 2, 2016 · 3 comments
Closed

Comments

@riyanpratamap
Copy link

Hi,
Is it possible to keep autoscrolling after user start to scroll it manually?

And yes, I'd like to say thank you for your amazing library.

@evgenyneu
Copy link
Owner

evgenyneu commented Aug 2, 2016

Hi @Riyanpratama, thank you for good question and kind words. One can detect the "finger up" event and restart autoscrolling with a scroll view delegate. Here is an example:

class ViewController: UIViewController, UIScrollViewDelegate {
  @IBOutlet weak var scrollView: UIScrollView!

  override func viewDidLoad() {
    super.viewDidLoad()

    scrollView.delegate = self

    scrollView.auk.show(url: "https://bit.ly/auk_image")
    scrollView.auk.show(url: "https://bit.ly/moa_image")
    scrollView.auk.startAutoScroll(delaySeconds: 2)
  }

  func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
    scrollView.auk.startAutoScroll(delaySeconds: 2)
  }
}

Let me know how/if it works for you.

@riyanpratamap
Copy link
Author

It works and you're really kind! Thank you.

@erayalparslan
Copy link

@evgenyneu thank you very much

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

No branches or pull requests

3 participants