You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an issue where the extension with the fatal error is being called instead of my custom procol conforming classes. I probably haven't set everything up right... here's the relevant code - also not that this is a macOS app but that shouldn't matter...
let store = Store<AppState> (
reducer: AppReducer(),
state: nil
)
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
//let appState: AppState
let router: Router<AppState>
override init() {
//self.appState = AppState(realmState: nil, navigationState: NavigationState())
router = Router(store: store, rootRoutable: MainWindowRouter()) { state in
state.navigationState
}
store.dispatch(
SetRouteAction([Window.EditorWindow.rawValue])
)
super.init()
}
func applicationDidFinishLaunching(aNotification: NSNotification) {
// Insert code here to initialize your application
}
func applicationWillTerminate(aNotification: NSNotification) {
// Insert code here to tear down your application
}
@IBAction func openPreferences(sender: AnyObject) {
store.dispatch(
SetRouteAction([Window.Preferences.rawValue])
)
}
}
struct AppState: StateType {
let realmState: RealmState?
let navigationState: NavigationState
init (realmState: RealmState?, navigationState: NavigationState) {
self.realmState = realmState
self.navigationState = navigationState
}
}
class MainWindowRouter: Routable {
// I've set breakpoints, and none of these get called
func changeRouteSegment(from: RouteElementIdentifier,
to: RouteElementIdentifier,
completionHandler: RoutingCompletionHandler) -> Routable {
completionHandler()
return self
}
func pushRouteSegment(routeElementIdentifier: RouteElementIdentifier,
completionHandler: RoutingCompletionHandler) -> Routable {
if routeElementIdentifier == "EditorWindow" {
let mainWindow = NSStoryboard(name: "Main", bundle: nil).instantiateInitialController() as! Routable
completionHandler()
return mainWindow
}
return self
}
func popRouteSegment(routeElementIdentifier: RouteElementIdentifier,
completionHandler: RoutingCompletionHandler) {
completionHandler()
if routeElementIdentifier == "EditorWindow" {
}
}
}
Am I missing something? The tests don't appear to be doing anything else, and I've scoured the documentation!
The text was updated successfully, but these errors were encountered:
Hey @mathieutozer, sorry that you're facing this issue! Are you using 0.2.6 or 0.2.7 of ReSwift-Router?
If so, the method signatures have changed. The routing methods now carry an animated flag that indicates whether the Routable should route animated or un-animated. Here's an example:
By matching this signature you should be able to solve your issue. I really need to fix this as suggested in #25 and remove the default route implementations and come up with a better solution for this.
I have an issue where the extension with the fatal error is being called instead of my custom procol conforming classes. I probably haven't set everything up right... here's the relevant code - also not that this is a macOS app but that shouldn't matter...
Am I missing something? The tests don't appear to be doing anything else, and I've scoured the documentation!
The text was updated successfully, but these errors were encountered: