Skip to content

Commit d4f2274

Browse files
committed
Update README.md
1 parent 389b418 commit d4f2274

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ SwiftyTimer is a set of extensions to make the `NSTimer` API cleaner, nicer to u
44

55
Read [Swifty APIs: NSTimer](http://radex.io/swift/nstimer/) for more information about this project.
66

7-
### Scheduling a timer
7+
### Usage
88

99
You can easily schedule repeating and non-repeating timers (repeats and delays) using `NSTimer.every` and `NSTimer.after`:
1010

@@ -46,6 +46,13 @@ let timer = NSTimer.new(every: 1.second) {
4646

4747
(This should be defined as an initializer, but [a bug in Swift](http://www.openradar.me/18720947) prevents this)
4848

49+
Call `start()` to schedule timers created using `new`. You can optionally pass the run loop and run loop modes:
50+
51+
```swift
52+
timer.start()
53+
timer.start(modes: NSDefaultRunLoopMode, NSEventTrackingRunLoopMode)
54+
```
55+
4956
### Installation
5057

5158
The simplest way to install this library is to copy `Src/SwiftyTimer.swift` to your project. There's no step two!

0 commit comments

Comments
 (0)