aschuch / StatefulViewController

Placeholder views based on content, loading, error or empty states
MIT License
2.14k stars 149 forks source link

crash with custom state #32

Closed anneWe closed 7 years ago

anneWe commented 8 years ago

Hi, thanks for this helpful library! I'm currently struggeling to add a custom state. I tried to add the additional state to the state machine as described in the readme. Unfortunately, the app crashes when it tries to create the StatefulViewControllerState with my custom viewKey in the getter of currentState and lastState, because the initialization of the state is forced to not be nil: StatefulViewControllerState(rawValue: viewKey)! and my custom viewKey is not part of the default state enum. How can this be solved?

weyert commented 7 years ago

Anyone, have any tips for this?

aschuch commented 7 years ago

Can you share a codesnippet so I can take a look?

aschuch commented 7 years ago

I am closing this due to inactivity. If you have further questions, do not hesitate to open another issue.