Skip to content

Instantly share code, notes, and snippets.

@ghecho
ghecho / TouchIDViewController.swift
Created January 29, 2015 05:22
ViewController with Touch ID
//
// ViewController.swift
// TouchIDViewController
//
// Created by Diego on 1/28/15.
// Copyright (c) 2015 Diego. All rights reserved.
//
import UIKit
import LocalAuthentication
@ghecho
ghecho / offscreen.m
Last active August 29, 2015 14:14 — forked from chrisjdavis/offscreen.m
- (IBAction)getImageFromWeb:(id)sender {
// grab the width and height of the document in our mobileView.
CGSize contentSize = CGSizeMake(
[[mobileView stringByEvaluatingJavaScriptFromString:@"document.body.scrollWidth;"] floatValue],
[[mobileView stringByEvaluatingJavaScriptFromString:@"document.body.scrollHeight;"] floatValue]
);
// create a new window, offscreen.
NSWindow *hiddenWindow = [[NSWindow alloc] initWithContentRect: NSMakeRect( -1000,-1000, contentSize.width, contentSize.height )
styleMask: NSTitledWindowMask | NSClosableWindowMask backing:NSBackingStoreNonretained defer:NO];