Open iOS-dev-avinash opened 6 years ago
I think you could change the logic such that there is a time trigger. This means that in your ViewController where you invoke SwiftyOnboard, you want to have a function that watches for time and chagnes to the next indexed page. Look at the delegate methods in the example to see how it works for the continue on slide.
If you are going to change underlying behavior as well, it is best if you don't use the pod but use a manual copying of the main files.
@avikhairgavepatil
You can implement this like this:
Define variables like this:
let numberOfPages = 5
let swiftyOnboard: SwiftyOnboard!
Timer.scheduledTimer(withTimeInterval: 3.0, repeats: true) { (timer) in
let currentPage = self.swiftyOnboard.currentPage
if currentPage >= numberOfPages {
timer.invalidate()
} else {
self.swiftyOnboard.goToPage(index: currentPage + 1, animated: true)
}
}
Maybe you need to disable user swiping by setting shouldSwipe
to false
as you're changing the page using Timer
.
i want to use auto slide in every 3 second