Skip to content

Instantly share code, notes, and snippets.

View guruguruman's full-sized avatar

Tomoyuki Kato guruguruman

  • Tokyo, Japan
View GitHub Profile
@guruguruman
guruguruman / itunes-icon-generator.sh
Last active December 18, 2015 09:39
Create icons necessary for submitting the app to AppStore.
#!/bin/sh
################################################################################
#
# iTunes Icon Generator v 0.3
#
#
# This script requires ImageMagick.
# See link below for more defailed information:
@guruguruman
guruguruman / UIWebView+StopBouncing
Created May 22, 2013 01:20
Disable bouncing on the other hand not disabling zooming and scrolling
UIWebView webView;
for (id subview in webView.subviews ) {
if([subview isKindOfClass: [UIScrollView class]]){
UIScrollView *scrollView = (UIScrollView *)subview;
scrollView.bounces = NO;
scrollView.scrollEnabled = YES;
scrollView.minimumZoomScale = 1.0f;
scrollView.bouncesZoom = NO;
scrollView.alwaysBounceVertical = NO;
@guruguruman
guruguruman / UIView+ImageCapture
Created May 11, 2013 08:32
Capturing image from rendered view.
+ (UIImage *)viewAsImage:(UIView *)aView {
if (!aView) {
return nil;
}
UIGraphicsBeginImageContext(aView.bounds.size);
[aView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *aViewAsImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return aViewAsImage;
}