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 use auto slide onboarding? #29

Open
iOS-dev-avinash opened this issue Aug 21, 2018 · 2 comments
Open

how to use auto slide onboarding? #29

iOS-dev-avinash opened this issue Aug 21, 2018 · 2 comments

Comments

@iOS-dev-avinash
Copy link

i want to use auto slide in every 3 second

@monkeywithacupcake
Copy link

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.

Apple Wait docs

@hemangshah
Copy link

@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.

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