Skip to content

Instantly share code, notes, and snippets.

View danielphillips's full-sized avatar

Daniel Phillips danielphillips

  • Trainline
  • London, UK
View GitHub Profile
@danielphillips
danielphillips / HTMLLineBreakConvertor.h
Created March 25, 2011 13:37
Convert raw HTML to basic text preserving line breaks for use in UILabel or UITextView
@interface HTMLLineBreakConvertor : NSObject <NSXMLParserDelegate> {
NSMutableString* resultString;
NSDictionary* tags;
}
- (NSString*)convertEntiesInString:(NSString*)s;
@end
@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