@@ -44,8 +44,10 @@ public class Router<State: StateType>: StoreSubscriber {
44
44
case let . Pop( responsibleRoutableIndex, segmentToBePopped) :
45
45
dispatch_async ( dispatch_get_main_queue ( ) ) {
46
46
self . routables [ responsibleRoutableIndex]
47
- . popRouteSegment ( segmentToBePopped) {
48
- dispatch_semaphore_signal ( semaphore)
47
+ . popRouteSegment (
48
+ segmentToBePopped,
49
+ animated: state. changeRouteAnimated) {
50
+ dispatch_semaphore_signal ( semaphore)
49
51
}
50
52
51
53
self . routables. removeAtIndex ( responsibleRoutableIndex + 1 )
@@ -55,8 +57,10 @@ public class Router<State: StateType>: StoreSubscriber {
55
57
dispatch_async ( dispatch_get_main_queue ( ) ) {
56
58
self . routables [ responsibleRoutableIndex + 1 ] =
57
59
self . routables [ responsibleRoutableIndex]
58
- . changeRouteSegment ( segmentToBeReplaced,
59
- to: newSegment) {
60
+ . changeRouteSegment (
61
+ segmentToBeReplaced,
62
+ to: newSegment,
63
+ animated: state. changeRouteAnimated) {
60
64
dispatch_semaphore_signal ( semaphore)
61
65
}
62
66
}
@@ -65,8 +69,10 @@ public class Router<State: StateType>: StoreSubscriber {
65
69
dispatch_async ( dispatch_get_main_queue ( ) ) {
66
70
self . routables. append (
67
71
self . routables [ responsibleRoutableIndex]
68
- . pushRouteSegment ( segmentToBePushed) {
69
- dispatch_semaphore_signal ( semaphore)
72
+ . pushRouteSegment (
73
+ segmentToBePushed,
74
+ animated: state. changeRouteAnimated) {
75
+ dispatch_semaphore_signal ( semaphore)
70
76
}
71
77
)
72
78
}
@@ -77,9 +83,12 @@ public class Router<State: StateType>: StoreSubscriber {
77
83
let result = dispatch_semaphore_wait ( semaphore, waitUntil)
78
84
79
85
if result != 0 {
80
- assertionFailure ( " [SwiftFlowRouter]: Router is stuck waiting for a " +
81
- " completion handler to be called. Ensure that you have called the " +
86
+ print ( " [SwiftFlowRouter]: Router is stuck waiting for a " +
87
+ " completion handler to be called. Ensure that you have called the " +
82
88
" completion handler in each Routable element. " )
89
+ print ( " Set a symbolic breakpoint for the `ReSwiftRouterStuck` symbol in order " +
90
+ " to halt the program when this happens " )
91
+ ReSwiftRouterStuck ( )
83
92
}
84
93
}
85
94
@@ -194,6 +203,8 @@ public class Router<State: StateType>: StoreSubscriber {
194
203
195
204
}
196
205
206
+ func ReSwiftRouterStuck( ) { }
207
+
197
208
enum RoutingActions {
198
209
case Push( responsibleRoutableIndex: Int , segmentToBePushed: RouteElementIdentifier )
199
210
case Pop( responsibleRoutableIndex: Int , segmentToBePopped: RouteElementIdentifier )
0 commit comments