@@ -44,8 +44,10 @@ public class Router<State: StateType>: StoreSubscriber {
4444 case let . Pop( responsibleRoutableIndex, segmentToBePopped) :
4545 dispatch_async ( dispatch_get_main_queue ( ) ) {
4646 self . routables [ responsibleRoutableIndex]
47- . popRouteSegment ( segmentToBePopped) {
48- dispatch_semaphore_signal ( semaphore)
47+ . popRouteSegment (
48+ segmentToBePopped,
49+ animated: state. changeRouteAnimated) {
50+ dispatch_semaphore_signal ( semaphore)
4951 }
5052
5153 self . routables. removeAtIndex ( responsibleRoutableIndex + 1 )
@@ -55,8 +57,10 @@ public class Router<State: StateType>: StoreSubscriber {
5557 dispatch_async ( dispatch_get_main_queue ( ) ) {
5658 self . routables [ responsibleRoutableIndex + 1 ] =
5759 self . routables [ responsibleRoutableIndex]
58- . changeRouteSegment ( segmentToBeReplaced,
59- to: newSegment) {
60+ . changeRouteSegment (
61+ segmentToBeReplaced,
62+ to: newSegment,
63+ animated: state. changeRouteAnimated) {
6064 dispatch_semaphore_signal ( semaphore)
6165 }
6266 }
@@ -65,8 +69,10 @@ public class Router<State: StateType>: StoreSubscriber {
6569 dispatch_async ( dispatch_get_main_queue ( ) ) {
6670 self . routables. append (
6771 self . routables [ responsibleRoutableIndex]
68- . pushRouteSegment ( segmentToBePushed) {
69- dispatch_semaphore_signal ( semaphore)
72+ . pushRouteSegment (
73+ segmentToBePushed,
74+ animated: state. changeRouteAnimated) {
75+ dispatch_semaphore_signal ( semaphore)
7076 }
7177 )
7278 }
@@ -77,9 +83,12 @@ public class Router<State: StateType>: StoreSubscriber {
7783 let result = dispatch_semaphore_wait ( semaphore, waitUntil)
7884
7985 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 " +
8288 " 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 ( )
8392 }
8493 }
8594
@@ -194,6 +203,8 @@ public class Router<State: StateType>: StoreSubscriber {
194203
195204}
196205
206+ func ReSwiftRouterStuck( ) { }
207+
197208enum RoutingActions {
198209 case Push( responsibleRoutableIndex: Int , segmentToBePushed: RouteElementIdentifier )
199210 case Pop( responsibleRoutableIndex: Int , segmentToBePopped: RouteElementIdentifier )
0 commit comments