In the Cocoa and Cocoa Touch APIs what is the meaning of the abbreviation "CG", which is used in a lot of the graphics-related classes such as CGPoint
and CGRect
?
-
1Maybe core graphics?– Guest 86Dec 22, 2014 at 21:40
-
9This question is being discussed on meta.– NathanOliverJul 12, 2016 at 20:25
2 Answers
It's based on Apple's API Naming Guidelines.
You should try to choose names that clearly associate each symbol with your framework. For example, consider adding a short prefix to all external symbol names. Prefixes help differentiate the symbols in your framework from those in other frameworks and libraries. They also make it clear to other developers which framework is being used. Typical prefixes include the first couple of letters or an acronym of your framework name. For example, functions in the Core Graphics framework use the prefix “CG”.
It stands for Core Graphics which is the C-based graphics API on iOS. You can read more about core graphics here. CG
is used as a prefix for the essential data structures that are the basic building blocks of the framework.