Skip to content

Instantly share code, notes, and snippets.

View vitoziv's full-sized avatar
🐙
Writing bugs

Vito vitoziv

🐙
Writing bugs
View GitHub Profile
@vitoziv
vitoziv / search_archs
Created March 20, 2014 06:16
find ARCHS in build setting
xcodebuild -scheme MyScheme -showBuildSettings | grep ARCHS
@vitoziv
vitoziv / UIImage+VI_Resize.m
Created July 4, 2014 06:22
Resize Image With low memory
+ (UIImage *)resizeImage:(UIImage *)image scaledToFitSize:(CGFloat)max
{
NSData *imageData = [NSData dataWithData:UIImageJPEGRepresentation(image, 1.0)];
CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)imageData, NULL);
if (!imageSource)
return nil;
CFDictionaryRef options = (__bridge CFDictionaryRef)[NSDictionary dictionaryWithObjectsAndKeys:
(id)kCFBooleanTrue, (id)kCGImageSourceCreateThumbnailWithTransform,
(id)kCFBooleanTrue, (id)kCGImageSourceCreateThumbnailFromImageIfAbsent,