Last active
October 15, 2018 15:24
-
-
Save behdaad/05592de9ff1e98e19e83b3d3bab090a3 to your computer and use it in GitHub Desktop.
swift snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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