Skip to content

Commit fc2e0cf

Browse files
committed
Update README.md
1 parent 9561e88 commit fc2e0cf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ enum MyState: StateType {
2323
let machine = StateMachine<MyState, MyEvent>(state: .State0) { machine in
2424

2525
machine.addRoute(.State0 => .State1)
26-
machine.addRoute(nil => .State2) { context in println("Any => 2, msg=\(context.userInfo!)") }
27-
machine.addRoute(.State2 => nil) { context in println("2 => Any, msg=\(context.userInfo!)") }
26+
machine.addRoute(nil => .State2) { context in print("Any => 2, msg=\(context.userInfo)") }
27+
machine.addRoute(.State2 => nil) { context in print("2 => Any, msg=\(context.userInfo)") }
2828

2929
// add handler (handlerContext = (event, transition, order, userInfo))
3030
machine.addHandler(.State0 => .State1) { context in
31-
println("0 => 1")
31+
print("0 => 1")
3232
}
3333

3434
// add errorHandler
3535
machine.addErrorHandler { (event, transition, order, userInfo) in
36-
println("[ERROR] \(transition.fromState) => \(transition.toState)")
36+
print("[ERROR] \(transition.fromState) => \(transition.toState)")
3737
}
3838
}
3939

@@ -43,7 +43,7 @@ machine <- (.State2, "Hello")
4343
machine <- (.State1, "Bye")
4444
machine <- .State0 // fail: no 1 => 0
4545

46-
println("machine.state = \(machine.state)")
46+
print("machine.state = \(machine.state)")
4747
```
4848

4949
This will print:

0 commit comments

Comments
 (0)