Skip to content

assertionFailure() as opposed to fatalError() #85

@viewDidAppear

Description

@viewDidAppear

Hello,

In my own fork of this project, I've gone ahead to remove all references to fatalError() in my use of the Router. This warranted a change to the router itself, to prevent any operations from occurring if I ever return nil from the pushRouteSegment or changeRouteSegment functions. I have manually popped the route from the stack if we ever hit newState() with an invalid route.

Is this the correct way to do this? I would like some further clarification too on why fatalError() was chosen as opposed to assertionFailure() which would be evaluated in DEBUG builds only. The situation we faced was the occasional (widespread) crash in the Routables in our release builds which was horrendously detrimental to our user experience.

I am happy to make a pull request for this too. Otherwise a discussion would be great! 🙌

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions