Last active
June 3, 2019 09:45
-
-
Save harshvishu/97853711b90afd9afbd630d547ffff9a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import Foundation | |
| public typealias CompletionHandler = () -> Void | |
| protocol CountDown: NSObjectProtocol { | |
| // 1 | |
| var timeElapsed: TimeInterval {get set} | |
| var timeLimit: TimeInterval {get set} | |
| // 2 | |
| var isFinished: Bool {get} | |
| var isRunning: Bool {get} | |
| // 3 | |
| /// Executed on completion | |
| var completion: CompletionHandler? {get set} | |
| /// Executed every iteration | |
| var repeatingTask: CompletionHandler? {get set} | |
| // 4 | |
| func start() | |
| func stop() | |
| func reset() | |
| func restart() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment