layout
layout copied to clipboard
Getting a layout error bricks the app
My app allows the user to edit the layout and redisplay. But when an error happens, the whole windows is taken over and there is no way back to the code editor.
@ayrtonsoftware you can disable the layout error console using LayoutConsole.isEnabled = false
, or hide it programmatically using LayoutConsole.hide()
.
@nicklockwood, thanks. This will work on getting rid of the console, but how to I get the errors? I will display them in my own UI. - Thanks
I am doing this:
self.loadLayout(withContentsOfURL: viewModel.path) { (error: LayoutError?) in print(error?.description) print(error?.localizedDescription) print(error?.suggestions) }
but the error is always nil....
@ayrtonsoftware the error parameter only catches errors that occur during loading. To catch other errors you will need to implement the func layoutError(_ error: LayoutError)
delegate method in your Layout ViewController.