Today I released two new open source projects: a tiny one, DejalUtilities, and a significantly larger one, DejalFoundationCategories.
DejalFoundationCategories is a collection of Foundation-level categories, to add useful methods to classes like NSArray
, NSDictionary
, NSString
, and others. They work on both OS X and iOS, and include:
NSArray
and NSMutableArray
, including object matching, reversal, sorting, deep copying, adding and removing.NSAttributedString
and NSMutableAttributedString
, including convenience initializers, RTF and font methods.NSDate
, including convenience initializers, handy date component properties and calculators, JSON date support, string formatting, and relative date output.NSDictionary
and NSMutableDictionary
, including object matching, scalar support, deep copying, and more.NSFileManager
, including convenient file attributes, file renaming, and path building.NSObject
base class, including key-value conveniences, “equivalent” comparisons, and performSelector
methods.NSString
and NSMutableString
, including scalar value formatting, contains evaluation, comparisons, substring and range utilities, reformatting, checksum and encoding utilities, internet utilities, file path methods, and appending and replacing methods.NSUserDefaults
, including support for default values, sanitizing values, time intervals, factory settings, and copying preferences.DejalUtilities is a single header file with some useful #define
macros and static functions, also for both OS X and iOS:
DejalClassAvailable()
and DejalClassSelectorAvailable()
macros, to help determine available APIs.DejalIntervalFromMinutes()
, DejalIntervalFromDays()
, DejalMinutesFromInterval()
, DejalMonthsFromInterval()
, and similar macros, to convert seconds to and from other units.DEJAL_FILE_NAME
and DEJAL_COMPILE_DATE_TIME
macros, to help with debug information.DejalWeakSelf
macro to easily make a weak representation of self for use with blocks.You can get the code and more information from the Dejal Open Source page.
(Looking for an iOS or Mac developer? I'm available for contract or full-time work. Learn more about me.)