Skip to content

Instantly share code, notes, and snippets.

View danielphillips's full-sized avatar

Daniel Phillips danielphillips

  • Trainline
  • London, UK
View GitHub Profile
@Shilo
Shilo / UIImage+Additions.h
Created October 17, 2011 07:43
A UIImage category that will replace or remove colors. This allows multiple colors to be changed on a single image, until it has alpha values.
//
// UIImage+Additions.h
// Sparrow
//
// Created by Shilo White on 10/16/11.
// Copyright 2011 Shilocity Productions. All rights reserved.
//
#define COLOR_PART_RED(color) (((color) >> 16) & 0xff)
#define COLOR_PART_GREEN(color) (((color) >> 8) & 0xff)
@danielphillips
danielphillips / LabelSizer.h
Created March 22, 2011 16:10
Allows you adjust a UILabel's height according to its content and retreive expected height for given input
@interface LabelSizer : NSObject {
}
+(float)getExpectedHeightForLabel:(UILabel*)label;
+(float)makeLabelCorrectSizeForCurrentWidth:(UILabel*)label;
+(float)getExpectedHeightForText:(NSString*)text withFontName:(NSString*)font atSize:(float)fontSize inContainerWidth:(float)width;
@end
@Abizern
Abizern / CommonMacros.h
Created March 8, 2010 23:21
Common Macros for Xcode projects
// Useful Macros.
// The best place to import this is in your project's pch file.
// See http://www.cimgf.com/2010/05/02/my-current-prefix-pch-file/ for details.
// Most current version at https://gist.github.com/325926 along with usage notes.
#ifndef jcscommonmacros
#define jcscommonmacros_1_0 10000
#define jcscommonmacros jcscommonmacros_1_0
#endif