You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
###### SwiftyTimer allows you to instantly schedule delays and repeating timers using convenient closure syntax. It's time to get rid of Objective-C cruft.
@@ -13,14 +13,14 @@ Read [Swifty APIs: NSTimer](http://radex.io/swift/nstimer/) for more information
13
13
14
14
## Usage
15
15
16
-
You can easily schedule repeating and non-repeating timers (repeats and delays) using `NSTimer.every` and `NSTimer.after`:
16
+
You can easily schedule repeating and non-repeating timers (repeats and delays) using `Timer.every` and `Timer.after`:
17
17
18
18
```swift
19
-
NSTimer.every(0.7.seconds) {
19
+
Timer.every(0.7.seconds) {
20
20
statusItem.blink()
21
21
}
22
22
23
-
NSTimer.after(1.minute) {
23
+
Timer.after(1.minute) {
24
24
println("Are you still here?")
25
25
}
26
26
```
@@ -40,15 +40,15 @@ You can specify time intervals with these intuitive helpers:
40
40
You can pass method references instead of closures:
41
41
42
42
```swift
43
-
NSTimer.every(30.seconds, align)
43
+
Timer.every(30.seconds, align)
44
44
```
45
45
46
46
### Manual scheduling
47
47
48
48
If you want to make a timer object without scheduling, use `new(after:)` and `new(every:)`:
49
49
50
50
```swift
51
-
let timer =NSTimer.new(every: 1.second) {
51
+
let timer =Timer.new(every: 1.second) {
52
52
println(self.status)
53
53
}
54
54
```
@@ -59,15 +59,15 @@ Call `start()` to schedule timers created using `new`. You can optionally pass t
0 commit comments