Checking for El Capitan

from blog The Desolation of Blog, | ↗ original
Sometimes your app needs to check the Mac OS X version at runtime in order to handle a runtime behavior change in OS X that isn't already handled automatically by the Cocoa API. One standard and Apple-recommended method of checking the runtime version is via NSAppKitVersionNumber. There are constants defined in corresponding to each major OS X version update, as well as a number of minor version updates. For example, this is from the OS X 10.10 SDK: