Skip to content

Instantly share code, notes, and snippets.

@bomberstudios
Created April 23, 2014 13:49
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bomberstudios/11215874 to your computer and use it in GitHub Desktop.
Save bomberstudios/11215874 to your computer and use it in GitHub Desktop.
Play 2048 inside Sketch.app, just because...
var URL = "http://gabrielecirulli.github.io/2048/"
var frame = NSMakeRect(0,0,340,480)
var webView = [[WebView alloc] initWithFrame:frame]
[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:URL]]]
var mask = NSTitledWindowMask + NSClosableWindowMask + NSMiniaturizableWindowMask + NSResizableWindowMask + NSUtilityWindowMask;
var window = [[NSPanel alloc] initWithContentRect:frame styleMask:mask backing:NSBackingStoreBuffered defer:true];
[[window contentView] addSubview:webView]
[window makeKeyAndOrderFront:nil]
@bomberstudios
Copy link
Author

Just download, double click to install, and enjoy : )

@postite
Copy link

postite commented May 14, 2014

awesome !

@josephfraser
Copy link

awesome

@afsalcreations
Copy link

Hi Bomberstudios, could you please tell me if there is any way that i can use offline html files in webview?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment