The underlying Core Graphics context.
SDKs
- iOS 10.0+
- Mac Catalyst 13.0+
- tvOS 10.0+
Framework
- UIKit
Declaration
var cgContext: CGContext { get }
Discussion
Use this property to gain access to the underlying Core Graphics context when you need more drawing functionality than is offered by UIKit and UIGraphics
.
For an example of how and when to use the Core Graphics context in an image renderer, see Using Core Graphics Rendering Functions in UIGraphics
.