Skip to content

Instantly share code, notes, and snippets.

@behdaad
Last active October 15, 2018 15:24
Show Gist options
  • Save behdaad/05592de9ff1e98e19e83b3d3bab090a3 to your computer and use it in GitHub Desktop.
Save behdaad/05592de9ff1e98e19e83b3d3bab090a3 to your computer and use it in GitHub Desktop.
swift snippet
class SplashInteractor: OnboardingIntractor {
// MARK: - Properties
var presenter: SplashPresenterProtocol!
var splashRouter: SplashRouterProtocol! {
return router as? SplashRouterProtocol
}
weak var viewController: SplashViewControllerProtocol!
var startTime: Date = Date()
// MARK: - Methods
override func configFetched(config: Config) {
if needsForcedUpdate() {
return
}
super.configFetched(config: config)
}
override func navigateToBeforeRide() {
if startTime.timeIntervalSinceNow < -1.0 {
animateToTopView()
} else {
let oneSecondLater = startTime.timeIntervalSinceNow + 1
Timer.scheduledTimer(timeInterval: oneSecondLater, target: self, selector: #selector(animateToTopView))
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment