Kodeco Forums

Core Graphics Tutorial Part 2: Gradients and Contexts

This this second part of our Core Graphics tutorial, you'll learn about gradients and transformations in a modern Swift app.

This is a companion discussion topic for the original entry at https://www.raywenderlich.com/410-core-graphics-tutorial-part-2-gradients-and-contexts

Hey Andriy!
Really appreciate the tutorial and Iā€™m learning a lot.
Iā€™m curious if you can explain the advantage of drawing using the context state instead of just using a UIBezierPath? Iā€™m referencing the water counter tickers that we drew at the end of the tutorial.


Hey Luke!

Thanks for kind words)

Using context state allows you to manipulate the canvas(context) on which you are drawing. This is similar to real world drawing, you can draw with the sheet of paper laying static on the table, but sometimes it is easier to move or rotate the canvas, making the actual drawing simpler.

Makes sense. thanks for the response!

This tutorial is more than six months old so questions are no longer supported at the moment for it. Thank you!