Skip to content

Instantly share code, notes, and snippets.

Verifying I am +scrooks on my passcard. https://onename.com/scrooks
@scrooks
scrooks / keybase.md
Last active February 24, 2017 20:46

Keybase proof

I hereby claim:

  • I am scrooks on github.
  • I am scrooks (https://keybase.io/scrooks) on keybase.
  • I have a public key ASBAgKRlJ_oTEqpvqC4Rx6MjH4hwAz42g8bGc78BqHA5cgo

To claim this, I am signing this object:

@scrooks
scrooks / iOSViewToImage.m
Created February 27, 2012 19:14
Capture an image bitmap of a UIView in iOS
/* Found on a page at http://nickharris.wordpress.com/2012/02/05/ios-slide-out-navigation-code/ */
-(void)showSideMenu
{
// before swaping the views, we'll take a "screenshot" of the current view
// by rendering its CALayer into the an ImageContext then saving that off to a UIImage
CGSize viewSize = self.contentViewController.view.bounds.size;
UIGraphicsBeginImageContextWithOptions(viewSize, NO, 1.0);
[self.contentViewController.view.layer renderInContext:UIGraphicsGetCurrentContext()];