File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -23,17 +23,17 @@ enum MyState: StateType {
2323let 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")
4343machine <- (.State1 , " Bye" )
4444machine <- .State0 // fail: no 1 => 0
4545
46- println (" machine.state = \( machine.state ) " )
46+ print (" machine.state = \( machine.state ) " )
4747```
4848
4949This will print:
Original file line number Diff line number Diff line change @@ -16,8 +16,8 @@ class BasicTests: _TestCase
1616 let machine = StateMachine < MyState , MyEvent > ( state: . State0) { machine in
1717
1818 machine. addRoute ( . State0 => . State1)
19- machine. addRoute ( nil => . State2) { context in print ( " Any => 2, msg= \( context. userInfo! ) " ) }
20- machine. addRoute ( . State2 => nil ) { context in print ( " 2 => Any, msg= \( context. userInfo! ) " ) }
19+ machine. addRoute ( nil => . State2) { context in print ( " Any => 2, msg= \( context. userInfo) " ) }
20+ machine. addRoute ( . State2 => nil ) { context in print ( " 2 => Any, msg= \( context. userInfo) " ) }
2121
2222 // add handler (handlerContext = (event, transition, order, userInfo))
2323 machine. addHandler ( . State0 => . State1) { context in
You can’t perform that action at this time.
0 commit comments