Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "CG" in CGGeometry, CGPoint, CGRect stand for?

Tags:

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 CGPointand CGRect?

like image 737
Anson Yao Avatar asked Dec 22 '14 21:12

Anson Yao


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”.

like image 104
Kazuki Sakamoto Avatar answered Mar 16 '23 18:03

Kazuki Sakamoto


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.

like image 30
nburk Avatar answered Mar 16 '23 16:03

nburk