When I view a post including a Stack Snippet, there is no ability to "run" the snippet like on the website.

On the app:

No Stack Snippets 🙁

On the mobile site:

Stack Snippets and Unicorns 😀

  • 1
    Is that even allowed? I always thought Apple doesn't allow running dynamic code, even javascript, unless it is in a web view. Jun 26, 2016 at 18:37
  • 1
    @PatrickHofman Isn’t that what a Stack Snippet is — A web view?
    – J F
    Jun 26, 2016 at 18:51
  • @Pat can't see how this can be true, most basic example is browser app like Chrome which renders JS on iOS just fine. Not sure how easy or feasible it is for an app to render JS, but surely it's possible. Maybe you're confused with Flash, which is indeed not allowed? Jun 28, 2016 at 14:18
  • Nah, I read there is a restriction on executing dynamic code other than in a web view. That is what Chrome uses (they are not allowed to use their own render engine as far as I know for this specific reason). Jun 28, 2016 at 14:20
  • @Sha it seems that rule was dropped with iOS 8: arstechnica.com/apple/2016/01/…. Jun 28, 2016 at 14:22
  • @Pat huh, never noticed any of this. One never stop learning! :) Jun 28, 2016 at 14:24
  • If the snippet is pure JS, you don't even need a webview to evaluate it. You can use a JSContext in the JavaScriptCore framework.
    – JAL
    Jun 28, 2016 at 17:41
  • @JAL but a pure JS snippet needs DOM access, too.
    – J F
    Jun 28, 2016 at 21:09


You must log in to answer this question.

Browse other questions tagged .