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