Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

CG versus UI. What is the difference?

I am confused when I would use something like CG... or something like UI... because they seem very similar if CG means computer graphics and UI is user interface. I am also talking about using this in swift.

1 Answer

I would recommend looking through Apple's documentation on all the UI classes and all the CG classes. That will help give you a better understanding of each of them and the subclasses available.

I haven't gone through the Swift course yet, but I'm finishing up the iOS track (Obj-C)... But I would say UI classes are more for predefined elements that you need to use, like buttons, tab bars, views, etc... Whereas CG classes can be used to create custom containers, elements, geometry, etc, that do not already have an existing predefined element to use.

I really don't know if I'm making any sense outside of my head, but again, I would suggest taking some time to look through Apple's docs.