/Utilites

Utilites for some cocoa classes

Primary LanguageObjective-C

Utilites for some cocoa classes

WebView+Utilites

- (NSImage *)snapshot; - create web page snapshot

NSMutableArray+Utilites

- (void)reverse; - reverse array

NSNumber+Utilites

- (NSString *)moneyRepresentation; - return money representation (1 000 000,00) of number
- (NSString *)byteRepresentation; - return bytes representation (KB, MB etc) of number
- (NSString *)bitRepresentation; - return bit representation (Kbps, Mbps etc) of number
- (NSString *)durationRepresentationWithHours; - return time representation (hh:mm:ss) of number
- (NSString *)durationRepresentationWithMinutes; - return time representation (mm:ss) of number

NSDate+Utilites

- (NSDate *)truncate; - set hours, minutes and seconds to 0
- (NSDate *)dateByAddingHours:(NSInteger)hours; - return date by adding hours to date
- (NSDate *)dateByAddingMinutes:(NSInteger)minutes; - return date by adding some minutes to date
- (NSDate *)dateByAddingDays:(NSInteger)days; - return date by adding some days to date
- (NSDate *)dateByAddingMonths:(NSInteger)months; - return date by adding some month to date
- (NSInteger)daysCountBetweenDate:(NSDate *)date; - return count of days between to dates
- (NSString *)dbDateRepresentation; - return date representation in "yyyy-dd-mm" format
- (NSString *)shortDateRepresentation; - return date representation in NSDateFormatterShortStyle format
- (NSString *)mediumDateRepresentation; - return date representation in NSDateFormatterMediumStyle format
- (NSString *)longDateRepresentation; - return date representation in NSDateFormatterLongStyle format
- (NSString *)longDateRepresentationWithTime; - return date representation in NSDateFormatterLongStyle with time in NSDateFormatterShortStyle format
- (NSString *)fullDateRepresentation; - return date representation in NSDateFormatterFullStyle format
- (NSString *)timeRepresentation; - return time representation in "hh:mm" format
- (NSString *)systemTimeRepresentation; - return time representation in system time format
- (NSString *)shortMonthName; - return short name of month
- (NSString *)monthName; - return full name of month
- (NSString *)weekDayName; - return week day name
- (NSInteger)year; - return year
- (NSInteger)month; - return month
- (NSInteger)day; - return day
- (NSInteger)hour; - return hour
- (NSInteger)minute; - return minute
- (NSInteger)week; - return number of week
- (NSInteger)weekday; - return number of weekday
+ (NSDate *)dateFromDbString:(NSString *)db; - convert "yyyy-dd-mm" string to date
+ (NSDate *)dateFromRFC1123:(NSString *)rfc; - convert RFC1123 string to date
+ (NSDate *)dateFromTZ:(NSString *)tz; - convert "yyyy-MM-dd'T'HH:mm:ss'Z'" string to date
+ (NSDate *)dateFromUTCString:(NSString *)utc;- convert "yyyy-MM-dd HH:mm:ss" string to date. UTC time zone
- (NSString *)UTCString; - return date representation in "yyyy-MM-dd HH:mm:ss" format. UTC time zone
- (NSString *)UTCStringWithMilliseconds; - return date representation in "yyyy-MM-dd HH:mm:ss.SSS" format. UTC time zone

NSApplication+Utilites.h

- (void)getSystemVersionMajor:(unsigned *)major minor:(unsigned *)minor bugFix:(unsigned *)bugFix; - return system version
- (BOOL)isLion;
- (BOOL)isMountainLion;
- (void)redirectConsoleLogToDocumentFolder; - redirect NSLog() output to file ~/Documents/Bundle Identifier.log

UIImage+Utilites

- (UIImage *)scaleAndRotateWithReslution:(int)resolution; - proportionally scale image by given max resolution
- (UIImage *)imageByCroppingToRect:(CGRect)rect; - cropping image to rect