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
extension NSTimer { | |
/** | |
Creates and schedules a one-time `NSTimer` instance. | |
- Parameters: | |
- delay: The delay before execution. | |
- handler: A closure to execute after `delay`. | |
- Returns: The newly-created `NSTimer` instance. | |
*/ |
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
// Hello, fellow Swift programmer! | |
// | |
// Here's a demonstration of a few ways of cleaning up the unwrapping of | |
// optionals in Swift. | |
// | |
// Swift is known to have both OO and functional background. Thus, there is | |
// probably some middle ground programming style that is *more* functional than | |
// Objective-C, and probably less so than Haskell. This playground tries to | |
// compare their differences in the pretty common scenario of dealing with | |
// errors or missing input. |