Last active
May 24, 2019 15:35
-
-
Save BrunoMiguens/d9df9d3b05ecbb724fa7bb31b3d66d96 to your computer and use it in GitHub Desktop.
[Medium] Swift: Using Javascript library - JSContext Exception Handler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import JavaScriptCore | |
let context = JSContext() | |
context?.exceptionHandler = { context, exception in | |
print("JS Error: \(exception!)") // Do not use force unwrap `!` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment