evgenyneu / Auk

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

Auto scroll stops after changing the images by swiping manually #54

Closed theduman closed 7 years ago

theduman commented 7 years ago

Hi . Thanks for making this great library.I have a problem described in title.Here is my code.

        if let image = UIImage(named: "kampanyaslider1") {
            slider.auk.show(image: image)
        }
        if let image = UIImage(named: "kampanyaslider2") {
            slider.auk.show(image: image)
        }
        if let image = UIImage(named: "kampanyaslider3") {
            slider.auk.show(image: image)
        }
        slider.auk.startAutoScroll(delaySeconds: 3)

Is this expected behaviour? Thank you for you help.

evgenyneu commented 7 years ago

Hello @theduman, good question. Yes, this is expected behaviour. There is special code in the library that stops autoscrolling when user starts scrolling manually. The reason for stopping auto scroll is because it would be interfering with manual scrolling. However, there is a way to start autoscrolling again after the user stopped scrolling, which is described in https://github.com/evgenyneu/Auk/issues/44. Let me know if it helps.

theduman commented 7 years ago

Thank you for your respond @evgenyneu . I tried your solution but unfortunately didnt work.I debugged but when I swipe image manually scrollViewDidEndDragging didn't called.I am using swipe gesture in somewhere else to another UI. Could be any conflict with that?

Edit: What if we add a new swipe gesture to the slider and when swipe detected by UIGestureRecognizer we restart auto scrolling within our own swipe function? Is this possible?

evgenyneu commented 7 years ago

Hmm, did you set scrollView.delegate = self?

I am using swipe gesture in somewhere else to another UI.

What do you mean, sorry?

What if we add a new swipe gesture to the slider and when swipe detected by UIGestureRecognizer we restart auto scrolling within our own swipe function? Is this possible?

I haven't done that but you can try and see if it helps.

theduman commented 7 years ago

I've missed the scrollView.delegate = selfpart it works fine but now page indicator doesnt change.Am I still missing something?

evgenyneu commented 7 years ago

@theduman, oh, one needs to call scrollView.delegate = self once and before accessing the .auk property of the scroll view.

theduman commented 7 years ago

@evgenyneu thank you Its working perfectly now. Thank you for this beautiful library too , keep up the good work.

evgenyneu commented 7 years ago

No worries, all the best