StatefulViewController icon indicating copy to clipboard operation
StatefulViewController copied to clipboard

Access NSError Object in ErrorView

Open mschonvogel opened this issue 10 years ago • 4 comments

In order to give the user a more concrete info than just "Something went wrong.", it would be straightforward to have access to the NSError object in the view.

mschonvogel avatar Apr 24 '15 14:04 mschonvogel

Hi, thanks for the suggestion.

I was thinking about a generic PlaceholderViewProtocol that every placeholder view can optionally adopt. The protocol gets called whenever the view

  • willAppear
  • didAppear
  • willDisappear
  • didDisappear

Optionally, the current state (including any errors) might be passed with these calls. Would that be sufficient in your case?

aschuch avatar Apr 25 '15 09:04 aschuch

Yes, that would be sufficient. One more thing: In some of my ViewControllers, I would like the StatefulView not to cover the whole screen. I would like to set an y-offset or a custom constraint. Is there a non-hacky way to achieve that? Thanks!

mschonvogel avatar Apr 27 '15 08:04 mschonvogel

Perfect. :+1: Not sure when I will start to tackle this issue, if you want to hack on it feel free to open a pull request any time.


Regarding your question: A quick solution would be to use a transparent view as one of your placeholder views. However, this will block the UI behind it.

Alternatively, we could look into the possibility to provide a delegate method (on the view or the controller) to return the constraints for specific views.

aschuch avatar Apr 28 '15 11:04 aschuch

Any updates on exposing the NSError object inside the error view? I would really like to give a better explanation to the user why the operation failed, instead of a generic message.

jyounus avatar May 19 '16 11:05 jyounus