profile for monkeydom at Stack Overflow, Q&A for professional and enthusiast programmers

cocoa-dom

coding bits I use, come across, like, hate, the whole shebang.

twitter | github | mastodon     rant-dom     rss | archive

Permalink
Home

Handy constants

Another element that is easily overlooked, but can make code and life so much easier: Convenience Constants. Take some examples:

CGPointZero
CGRectZero
CGSizeZero
CGRectInfinite // mostly used in Core Image contexts
CGRectNull // not equal to CGRectZero, returned by e.g. CGRectIntersection()
NSNotFound
CGAffineTransformIdentity
UIEdgeInsetsZero
UITrackingRunLoopMode
NSFoundationVersionNumber
NSRunLoopCommonModes
NSEventTrackingRunLoopMode