iOS reference / CoreGraphics / CGContextCoreGraphics · IOS API REFERENCE
CGContext class · SDK 27.1
class CGContextMembers (142) init · iOS 2.0+ init TypeScript static initDataWidthHeightBitsPerComponentBytesPerRowSpaceBitmapInfo(data: (SDKHandle) | null, width: number, height: number, bitsPerComponent: number, bytesPerRow: number, space: (CGColorSpace) | null, bitmapInfo: CGBitmapInfo): (CGContext) | nullSwift declaration init?(data: UnsafeMutableRawPointer?, width: Int, height: Int, bitsPerComponent: Int, bytesPerRow: Int, space: CGColorSpace?, bitmapInfo: CGBitmapInfo)method · iOS 2.0+ makeImage TypeScript makeImage(): (CGImage) | nullSwift declaration func makeImage() -> CGImage?get · iOS 2.0+ alphaInfo TypeScript get alphaInfo(): CGImageAlphaInfoSwift declaration var alphaInfo: CGImageAlphaInfo { get }get · iOS 2.0+ bitmapInfo TypeScript get bitmapInfo(): CGBitmapInfoSwift declaration var bitmapInfo: CGBitmapInfo { get }get · iOS 2.0+ bitsPerComponent TypeScript get bitsPerComponent(): numberSwift declaration var bitsPerComponent: Int { get }get · iOS 2.0+ bitsPerPixel TypeScript get bitsPerPixel(): numberSwift declaration var bitsPerPixel: Int { get }get · iOS 2.0+ bytesPerRow TypeScript get bytesPerRow(): numberSwift declaration var bytesPerRow: Int { get }get · iOS 2.0+ colorSpace TypeScript get colorSpace(): (CGColorSpace) | nullSwift declaration var colorSpace: CGColorSpace? { get }get · iOS 2.0+ data TypeScript get data(): (SDKHandle) | nullSwift declaration var data: UnsafeMutableRawPointer? { get }get · iOS 2.0+ height TypeScript get height(): numberSwift declaration var height: Int { get }get · iOS 2.0+ width TypeScript get width(): numberSwift declaration var width: Int { get }method · iOS 2.0+ addEllipse TypeScript addEllipse(rect: { x: number; y: number; width: number; height: number }): voidSwift declaration func addEllipse(in rect: CGRect)method · iOS 2.0+ addPath TypeScript addPath(path: CGPath): voidSwift declaration func addPath(_ path: CGPath)method · iOS 2.0+ addRect TypeScript addRect(rect: { x: number; y: number; width: number; height: number }): voidSwift declaration func addRect(_ rect: CGRect)method · iOS 2.0+ beginPage TypeScript beginPage(mediaBox?: ("animatableData" | SDKHandle) | null): voidSwift declaration func beginPage(mediaBox: UnsafePointer<CGRect>?)method · iOS 2.0+ beginPath TypeScript beginPath(): voidSwift declaration func beginPath()method · iOS 2.0+ beginTransparencyLayer TypeScript beginTransparencyLayerAuxiliaryInfo(auxiliaryInfo?: (_CoreFoundation_CFDictionary) | null): voidSwift declaration func beginTransparencyLayer(auxiliaryInfo: CFDictionary?)method · iOS 2.0+ beginTransparencyLayer TypeScript beginTransparencyLayerInAuxiliaryInfo(rect: { x: number; y: number; width: number; height: number }, auxInfo?: (_CoreFoundation_CFDictionary) | null): voidSwift declaration func beginTransparencyLayer(in rect: CGRect, auxiliaryInfo auxInfo: CFDictionary?)method · iOS 2.0+ clear TypeScript clear(rect: { x: number; y: number; width: number; height: number }): voidSwift declaration func clear(_ rect: CGRect)method · iOS 2.0+ clip TypeScript clipToMask(rect: { x: number; y: number; width: number; height: number }, mask: CGImage): voidSwift declaration func clip(to rect: CGRect, mask: CGImage)method · iOS 2.0+ clip TypeScript clipTo(rect: { x: number; y: number; width: number; height: number }): voidSwift declaration func clip(to rect: CGRect)method · iOS 2.0+ closePath TypeScript closePath(): voidSwift declaration func closePath()method · iOS 2.0+ concatenate TypeScript concatenate(transform: _CoreFoundation_CGAffineTransform): voidSwift declaration func concatenate(_ transform: CGAffineTransform)method · iOS 2.0+ convertToDeviceSpace TypeScript convertToDeviceSpace(point: { x: number; y: number }): { x: number; y: number }Swift declaration func convertToDeviceSpace(_ point: CGPoint) -> CGPointmethod · iOS 2.0+ convertToUserSpace TypeScript convertToUserSpace(point: { x: number; y: number }): { x: number; y: number }Swift declaration func convertToUserSpace(_ point: CGPoint) -> CGPointmethod · iOS 2.0+ convertToDeviceSpace TypeScript convertToDeviceSpace18191(rect: { x: number; y: number; width: number; height: number }): { x: number; y: number; width: number; height: number }Swift declaration func convertToDeviceSpace(_ rect: CGRect) -> CGRectmethod · iOS 2.0+ convertToUserSpace TypeScript convertToUserSpace42604(rect: { x: number; y: number; width: number; height: number }): { x: number; y: number; width: number; height: number }Swift declaration func convertToUserSpace(_ rect: CGRect) -> CGRectmethod · iOS 2.0+ convertToDeviceSpace TypeScript convertToDeviceSpace39714(size: { width: number; height: number }): { width: number; height: number }Swift declaration func convertToDeviceSpace(_ size: CGSize) -> CGSizemethod · iOS 2.0+ convertToUserSpace TypeScript convertToUserSpace3229(size: { width: number; height: number }): { width: number; height: number }Swift declaration func convertToUserSpace(_ size: CGSize) -> CGSizeget · iOS 2.0+ path TypeScript get path(): (CGPath) | nullSwift declaration var path: CGPath? { get }method · iOS 2.0+ drawLinearGradient TypeScript drawLinearGradient(gradient: CGGradient, startPoint: { x: number; y: number }, endPoint: { x: number; y: number }, options: CGGradientDrawingOptions): voidSwift declaration func drawLinearGradient(_ gradient: CGGradient, start startPoint: CGPoint, end endPoint: CGPoint, options: CGGradientDrawingOptions)method · iOS 2.0+ drawPDFPage TypeScript drawPDFPage(page: CGPDFPage): voidSwift declaration func drawPDFPage(_ page: CGPDFPage)method · iOS 2.0+ drawPath TypeScript drawPath(mode: CGPathDrawingMode): voidSwift declaration func drawPath(using mode: CGPathDrawingMode)method · iOS 2.0+ drawRadialGradient TypeScript drawRadialGradient(gradient: CGGradient, startCenter: { x: number; y: number }, startRadius: number, endCenter: { x: number; y: number }, endRadius: number, options: CGGradientDrawingOptions): voidSwift declaration func drawRadialGradient(_ gradient: CGGradient, startCenter: CGPoint, startRadius: CGFloat, endCenter: CGPoint, endRadius: CGFloat, options: CGGradientDrawingOptions)method · iOS 2.0+ drawShading TypeScript drawShading(shading: CGShading): voidSwift declaration func drawShading(_ shading: CGShading)method · iOS 2.0+ endPage TypeScript endPage(): voidSwift declaration func endPage()method · iOS 2.0+ endTransparencyLayer TypeScript endTransparencyLayer(): voidSwift declaration func endTransparencyLayer()method · iOS 2.0+ fillEllipse TypeScript fillEllipse(rect: { x: number; y: number; width: number; height: number }): voidSwift declaration func fillEllipse(in rect: CGRect)method · iOS 2.0+ fill TypeScript fill(rect: { x: number; y: number; width: number; height: number }): voidSwift declaration func fill(_ rect: CGRect)method · iOS 2.0+ flush TypeScript flush(): voidSwift declaration func flush()get · iOS 2.0+ ctm TypeScript get ctm(): _CoreFoundation_CGAffineTransformSwift declaration var ctm: CGAffineTransform { get }get · iOS 2.0+ boundingBoxOfClipPath TypeScript get boundingBoxOfClipPath(): { x: number; y: number; width: number; height: number }Swift declaration var boundingBoxOfClipPath: CGRect { get }get · iOS 2.0+ interpolationQuality TypeScript get interpolationQuality(): CGInterpolationQualitySwift declaration var interpolationQuality: CGInterpolationQuality { get set }set · iOS 2.0+ interpolationQuality TypeScript set interpolationQuality(value: CGInterpolationQuality)Swift declaration var interpolationQuality: CGInterpolationQuality { get set }get · iOS 2.0+ boundingBoxOfPath TypeScript get boundingBoxOfPath(): { x: number; y: number; width: number; height: number }Swift declaration var boundingBoxOfPath: CGRect { get }get · iOS 2.0+ currentPointOfPath TypeScript get currentPointOfPath(): { x: number; y: number }Swift declaration var currentPointOfPath: CGPoint { get }get · iOS 2.0+ textMatrix TypeScript get textMatrix(): _CoreFoundation_CGAffineTransformSwift declaration var textMatrix: CGAffineTransform { get set }set · iOS 2.0+ textMatrix TypeScript set textMatrix(value: _CoreFoundation_CGAffineTransform)Swift declaration var textMatrix: CGAffineTransform { get set }get · iOS 2.0+ typeID TypeScript static get typeID(): numberSwift declaration class var typeID: CFTypeID { get }get · iOS 2.0+ userSpaceToDeviceSpaceTransform TypeScript get userSpaceToDeviceSpaceTransform(): _CoreFoundation_CGAffineTransformSwift declaration var userSpaceToDeviceSpaceTransform: CGAffineTransform { get }get · iOS 2.0+ isPathEmpty TypeScript get isPathEmpty(): booleanSwift declaration var isPathEmpty: Bool { get }method · iOS 2.0+ pathContains TypeScript pathContains(point: { x: number; y: number }, mode: CGPathDrawingMode): booleanSwift declaration func pathContains(_ point: CGPoint, mode: CGPathDrawingMode) -> Boolmethod · iOS 2.0+ replacePathWithStrokedPath TypeScript replacePathWithStrokedPath(): voidSwift declaration func replacePathWithStrokedPath()method resetClip TypeScript resetClip(): voidSwift declaration func resetClip()method · iOS 2.0+ restoreGState TypeScript restoreGState(): voidSwift declaration func restoreGState()method · iOS 2.0+ rotate TypeScript rotate(angle: number): voidSwift declaration func rotate(by angle: CGFloat)method · iOS 2.0+ saveGState TypeScript saveGState(): voidSwift declaration func saveGState()method · iOS 2.0+ scaleBy TypeScript scaleBy(sx: number, sy: number): voidSwift declaration func scaleBy(x sx: CGFloat, y sy: CGFloat)method · iOS 2.0+ setAllowsAntialiasing TypeScript setAllowsAntialiasing(allowsAntialiasing: boolean): voidSwift declaration func setAllowsAntialiasing(_ allowsAntialiasing: Bool)method · iOS 2.0+ setAllowsFontSmoothing TypeScript setAllowsFontSmoothing(allowsFontSmoothing: boolean): voidSwift declaration func setAllowsFontSmoothing(_ allowsFontSmoothing: Bool)method · iOS 2.0+ setAllowsFontSubpixelPositioning TypeScript setAllowsFontSubpixelPositioning(allowsFontSubpixelPositioning: boolean): voidSwift declaration func setAllowsFontSubpixelPositioning(_ allowsFontSubpixelPositioning: Bool)method · iOS 2.0+ setAllowsFontSubpixelQuantization TypeScript setAllowsFontSubpixelQuantization(allowsFontSubpixelQuantization: boolean): voidSwift declaration func setAllowsFontSubpixelQuantization(_ allowsFontSubpixelQuantization: Bool)method · iOS 2.0+ setAlpha TypeScript setAlpha(alpha: number): voidSwift declaration func setAlpha(_ alpha: CGFloat)method · iOS 2.0+ setBlendMode TypeScript setBlendMode(mode: CGBlendMode): voidSwift declaration func setBlendMode(_ mode: CGBlendMode)method · iOS 2.0+ setFillColor TypeScript setFillColorCyanMagentaYellowBlackAlpha(cyan: number, magenta: number, yellow: number, black: number, alpha: number): voidSwift declaration func setFillColor(cyan: CGFloat, magenta: CGFloat, yellow: CGFloat, black: CGFloat, alpha: CGFloat)method · iOS 2.0+ setStrokeColor TypeScript setStrokeColorCyanMagentaYellowBlackAlpha(cyan: number, magenta: number, yellow: number, black: number, alpha: number): voidSwift declaration func setStrokeColor(cyan: CGFloat, magenta: CGFloat, yellow: CGFloat, black: CGFloat, alpha: CGFloat)method · iOS 2.0+ setCharacterSpacing TypeScript setCharacterSpacing(spacing: number): voidSwift declaration func setCharacterSpacing(_ spacing: CGFloat)method · iOS 18.0+ setEDRTargetHeadroom TypeScript setEDRTargetHeadroom(headroom: number): booleanSwift declaration func setEDRTargetHeadroom(_ headroom: Float) -> Boolmethod · iOS 2.0+ setFillColor TypeScript setFillColor(components: "animatableData" | SDKHandle): voidSwift declaration func setFillColor(_ components: UnsafePointer<CGFloat>)method · iOS 2.0+ setFillColorSpace TypeScript setFillColorSpace(space: CGColorSpace): voidSwift declaration func setFillColorSpace(_ space: CGColorSpace)method · iOS 2.0+ setFillColor TypeScript setFillColor49658(color: CGColor): voidSwift declaration func setFillColor(_ color: CGColor)method · iOS 2.0+ setFillPattern TypeScript setFillPattern(pattern: CGPattern, components: "animatableData" | SDKHandle): voidSwift declaration func setFillPattern(_ pattern: CGPattern, colorComponents components: UnsafePointer<CGFloat>)method · iOS 2.0+ setFlatness TypeScript setFlatness(flatness: number): voidSwift declaration func setFlatness(_ flatness: CGFloat)method · iOS 2.0+ setFont TypeScript setFont(font: CGFont): voidSwift declaration func setFont(_ font: CGFont)method · iOS 2.0+ setFontSize TypeScript setFontSize(size: number): voidSwift declaration func setFontSize(_ size: CGFloat)method · iOS 2.0+ setFillColor TypeScript setFillColorGrayAlpha(gray: number, alpha: number): voidSwift declaration func setFillColor(gray: CGFloat, alpha: CGFloat)method · iOS 2.0+ setStrokeColor TypeScript setStrokeColorGrayAlpha(gray: number, alpha: number): voidSwift declaration func setStrokeColor(gray: CGFloat, alpha: CGFloat)method · iOS 2.0+ setLineCap TypeScript setLineCap(cap: CGLineCap): voidSwift declaration func setLineCap(_ cap: CGLineCap)method · iOS 2.0+ setLineJoin TypeScript setLineJoin(join: CGLineJoin): voidSwift declaration func setLineJoin(_ join: CGLineJoin)method · iOS 2.0+ setLineWidth TypeScript setLineWidth(width: number): voidSwift declaration func setLineWidth(_ width: CGFloat)method · iOS 2.0+ setMiterLimit TypeScript setMiterLimit(limit: number): voidSwift declaration func setMiterLimit(_ limit: CGFloat)method · iOS 2.0+ setPatternPhase TypeScript setPatternPhase(phase: { width: number; height: number }): voidSwift declaration func setPatternPhase(_ phase: CGSize)method · iOS 2.0+ setFillColor TypeScript setFillColorRedGreenBlueAlpha(red: number, green: number, blue: number, alpha: number): voidSwift declaration func setFillColor(red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat)method · iOS 2.0+ setStrokeColor TypeScript setStrokeColorRedGreenBlueAlpha(red: number, green: number, blue: number, alpha: number): voidSwift declaration func setStrokeColor(red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat)method · iOS 2.0+ setRenderingIntent TypeScript setRenderingIntent(intent: CGColorRenderingIntent): voidSwift declaration func setRenderingIntent(_ intent: CGColorRenderingIntent)method · iOS 2.0+ setShadow TypeScript setShadowOffsetBlur(offset: { width: number; height: number }, blur: number): voidSwift declaration func setShadow(offset: CGSize, blur: CGFloat)method · iOS 2.0+ setShadow TypeScript setShadowOffsetBlurColor(offset: { width: number; height: number }, blur: number, color?: (CGColor) | null): voidSwift declaration func setShadow(offset: CGSize, blur: CGFloat, color: CGColor?)method · iOS 2.0+ setShouldAntialias TypeScript setShouldAntialias(shouldAntialias: boolean): voidSwift declaration func setShouldAntialias(_ shouldAntialias: Bool)method · iOS 2.0+ setShouldSmoothFonts TypeScript setShouldSmoothFonts(shouldSmoothFonts: boolean): voidSwift declaration func setShouldSmoothFonts(_ shouldSmoothFonts: Bool)method · iOS 2.0+ setShouldSubpixelPositionFonts TypeScript setShouldSubpixelPositionFonts(shouldSubpixelPositionFonts: boolean): voidSwift declaration func setShouldSubpixelPositionFonts(_ shouldSubpixelPositionFonts: Bool)method · iOS 2.0+ setShouldSubpixelQuantizeFonts TypeScript setShouldSubpixelQuantizeFonts(shouldSubpixelQuantizeFonts: boolean): voidSwift declaration func setShouldSubpixelQuantizeFonts(_ shouldSubpixelQuantizeFonts: Bool)method · iOS 2.0+ setStrokeColor TypeScript setStrokeColor(components: "animatableData" | SDKHandle): voidSwift declaration func setStrokeColor(_ components: UnsafePointer<CGFloat>)method · iOS 2.0+ setStrokeColorSpace TypeScript setStrokeColorSpace(space: CGColorSpace): voidSwift declaration func setStrokeColorSpace(_ space: CGColorSpace)method · iOS 2.0+ setStrokeColor TypeScript setStrokeColor46187(color: CGColor): voidSwift declaration func setStrokeColor(_ color: CGColor)method · iOS 2.0+ setStrokePattern TypeScript setStrokePattern(pattern: CGPattern, components: "animatableData" | SDKHandle): voidSwift declaration func setStrokePattern(_ pattern: CGPattern, colorComponents components: UnsafePointer<CGFloat>)method · iOS 2.0+ setTextDrawingMode TypeScript setTextDrawingMode(mode: CGTextDrawingMode): voidSwift declaration func setTextDrawingMode(_ mode: CGTextDrawingMode)method · iOS 2.0+ strokeEllipse TypeScript strokeEllipse(rect: { x: number; y: number; width: number; height: number }): voidSwift declaration func strokeEllipse(in rect: CGRect)method · iOS 2.0+ strokePath TypeScript strokePath(): voidSwift declaration func strokePath()method · iOS 2.0+ stroke TypeScript stroke(rect: { x: number; y: number; width: number; height: number }): voidSwift declaration func stroke(_ rect: CGRect)method · iOS 2.0+ stroke TypeScript strokeWidth(rect: { x: number; y: number; width: number; height: number }, width: number): voidSwift declaration func stroke(_ rect: CGRect, width: CGFloat)method · iOS 2.0+ synchronize TypeScript synchronize(): voidSwift declaration func synchronize()method · iOS 26.0+ synchronizeAttributes TypeScript synchronizeAttributes(): voidSwift declaration func synchronizeAttributes()method · iOS 2.0+ translateBy TypeScript translateBy(tx: number, ty: number): voidSwift declaration func translateBy(x tx: CGFloat, y ty: CGFloat)method · iOS 2.0+ addDestination TypeScript addDestination(name: _CoreFoundation_CFString, point: { x: number; y: number }): voidSwift declaration func addDestination(_ name: CFString, at point: CGPoint)method · iOS 4.0+ addDocumentMetadata TypeScript addDocumentMetadata(metadata?: (_CoreFoundation_CFData) | null): voidSwift declaration func addDocumentMetadata(_ metadata: CFData?)method · iOS 27.0+ addStructureTreeRootChild TypeScript addStructureTreeRootChild(structureElement: CGPDFStructureElement): numberSwift declaration func addStructureTreeRootChild(_ structureElement: CGPDFStructureElement) -> OSStatusmethod · iOS 27.0+ beginMarkedContentSequence TypeScript beginMarkedContentSequence(tagType: CGPDFTagType): (CGPDFMarkedContentItem) | nullSwift declaration func beginMarkedContentSequence(_ tagType: CGPDFTagType) -> CGPDFMarkedContentItem?method · iOS 27.0+ beginNonStructuralMarkedContentSequence TypeScript beginNonStructuralMarkedContentSequence(tagType: CGPDFTagType): voidSwift declaration func beginNonStructuralMarkedContentSequence(_ tagType: CGPDFTagType)method · iOS 27.0+ beginObjectReference TypeScript beginObjectReference(): (CGPDFMarkedContentItem) | nullSwift declaration func beginObjectReference() -> CGPDFMarkedContentItem?method · iOS 2.0+ beginPDFPage TypeScript beginPDFPage(pageInfo?: (_CoreFoundation_CFDictionary) | null): voidSwift declaration func beginPDFPage(_ pageInfo: CFDictionary?)method · iOS 2.0+ closePDF TypeScript closePDF(): voidSwift declaration func closePDF()init · iOS 2.0+ init TypeScript static initConsumerMediaBox(consumer: CGDataConsumer, mediaBox?: ("animatableData" | SDKHandle) | null, auxiliaryInfo?: (_CoreFoundation_CFDictionary) | null): (CGContext) | nullSwift declaration init?(consumer: CGDataConsumer, mediaBox: UnsafePointer<CGRect>?, _ auxiliaryInfo: CFDictionary?)init · iOS 2.0+ init TypeScript static initMediaBox(url: _CoreFoundation_CFURL, mediaBox?: ("animatableData" | SDKHandle) | null, auxiliaryInfo?: (_CoreFoundation_CFDictionary) | null): (CGContext) | nullSwift declaration init?(_ url: CFURL, mediaBox: UnsafePointer<CGRect>?, _ auxiliaryInfo: CFDictionary?)method · iOS 27.0+ endMarkedContentSequence TypeScript endMarkedContentSequence(): voidSwift declaration func endMarkedContentSequence()method · iOS 27.0+ endObjectReference TypeScript endObjectReference(): voidSwift declaration func endObjectReference()method · iOS 2.0+ endPDFPage TypeScript endPDFPage(): voidSwift declaration func endPDFPage()method · iOS 2.0+ setDestination TypeScript setDestination(name: _CoreFoundation_CFString, rect: { x: number; y: number; width: number; height: number }): voidSwift declaration func setDestination(_ name: CFString, for rect: CGRect)method · iOS 2.0+ setURL TypeScript setURL(url: _CoreFoundation_CFURL, rect: { x: number; y: number; width: number; height: number }): voidSwift declaration func setURL(_ url: CFURL, for rect: CGRect)init · iOS 2.0+ · Deprecated in iOS 100000.0 init TypeScript static initDataWidthHeightBitsPerComponentBytesPerRowSpaceBitmapInfo91056(data: (SDKHandle) | null, width: number, height: number, bitsPerComponent: number, bytesPerRow: number, space: CGColorSpace, bitmapInfo: number): (CGContext) | nullSwift declaration init?(data: UnsafeMutableRawPointer?, width: Int, height: Int, bitsPerComponent: Int, bytesPerRow: Int, space: CGColorSpace, bitmapInfo: UInt32)method · iOS 7.0+ showGlyphs TypeScript showGlyphs(glyphs: Array<number>, positions: Array<{ x: number; y: number }>): voidSwift declaration func showGlyphs(_ glyphs: [CGGlyph], at positions: [CGPoint])method · iOS 7.0+ setLineDash TypeScript setLineDash(phase: number, lengths: Array<number>): voidSwift declaration func setLineDash(phase: CGFloat, lengths: [CGFloat])method · iOS 7.0+ addQuadCurve TypeScript addQuadCurve(end: { x: number; y: number }, control: { x: number; y: number }): voidSwift declaration func addQuadCurve(to end: CGPoint, control: CGPoint)get · iOS 7.0+ textPosition TypeScript get textPosition(): { x: number; y: number }Swift declaration var textPosition: CGPoint { get set }set · iOS 7.0+ textPosition TypeScript set textPosition(value: { x: number; y: number })Swift declaration var textPosition: CGPoint { get set }method · iOS 7.0+ strokeLineSegments TypeScript strokeLineSegments(points: Array<{ x: number; y: number }>): voidSwift declaration func strokeLineSegments(between points: [CGPoint])get · iOS 26.0+ contentToneMappingInfo TypeScript get contentToneMappingInfo(): CGContentToneMappingInfoSwift declaration var contentToneMappingInfo: CGContentToneMappingInfo { get set }set · iOS 26.0+ contentToneMappingInfo TypeScript set contentToneMappingInfo(value: CGContentToneMappingInfo)Swift declaration var contentToneMappingInfo: CGContentToneMappingInfo { get set }method · iOS 7.0+ clip TypeScript clipTo99427(rects: Array<{ x: number; y: number; width: number; height: number }>): voidSwift declaration func clip(to rects: [CGRect])method · iOS 7.0+ clip TypeScript clipUsing(rule?: CGPathFillRule): voidSwift declaration func clip(using rule: CGPathFillRule = .winding)Intersects the current path with the current clipping region and uses the
result as the new clipping region for subsequent drawing.
Uses the specified fill rule (winding by default) to determine which
areas to treat as the interior of the clipping region. When evaluating
the path, any open subpath is implicitly closed.
method · iOS 7.0+ draw TypeScript drawAt(layer: CGLayer, point: { x: number; y: number }): voidSwift declaration func draw(_ layer: CGLayer, at point: CGPoint)method · iOS 18.0+ draw TypeScript drawInByOptions(image: CGImage, rect: { x: number; y: number; width: number; height: number }, toneMapping?: CGToneMapping, options?: (_CoreFoundation_CFDictionary) | null): booleanSwift declaration func draw(_ image: CGImage, in rect: CGRect, by toneMapping: CGToneMapping = .default, options: CFDictionary?) -> Boolmethod · iOS 7.0+ draw TypeScript drawInByTiling(image: CGImage, rect: { x: number; y: number; width: number; height: number }, byTiling?: boolean): voidSwift declaration func draw(_ image: CGImage, in rect: CGRect, byTiling: Bool = false)method · iOS 7.0+ draw TypeScript drawIn(layer: CGLayer, rect: { x: number; y: number; width: number; height: number }): voidSwift declaration func draw(_ layer: CGLayer, in rect: CGRect)method · iOS 7.0+ fill TypeScript fill95899(rects: Array<{ x: number; y: number; width: number; height: number }>): voidSwift declaration func fill(_ rects: [CGRect])method · iOS 7.0+ move TypeScript move(point: { x: number; y: number }): voidSwift declaration func move(to point: CGPoint)method · iOS 7.0+ addArc TypeScript addArcTangent1EndTangent2EndRadius(tangent1End: { x: number; y: number }, tangent2End: { x: number; y: number }, radius: number): voidSwift declaration func addArc(tangent1End: CGPoint, tangent2End: CGPoint, radius: CGFloat)method · iOS 7.0+ addArc TypeScript addArcCenterRadiusStartAngleEndAngleClockwise(center: { x: number; y: number }, radius: number, startAngle: number, endAngle: number, clockwise: boolean): voidSwift declaration func addArc(center: CGPoint, radius: CGFloat, startAngle: CGFloat, endAngle: CGFloat, clockwise: Bool)method · iOS 7.0+ addLine TypeScript addLine(point: { x: number; y: number }): voidSwift declaration func addLine(to point: CGPoint)method · iOS 7.0+ addCurve TypeScript addCurve(end: { x: number; y: number }, control1: { x: number; y: number }, control2: { x: number; y: number }): voidSwift declaration func addCurve(to end: CGPoint, control1: CGPoint, control2: CGPoint)method · iOS 7.0+ addLines TypeScript addLines(points: Array<{ x: number; y: number }>): voidSwift declaration func addLines(between points: [CGPoint])method · iOS 7.0+ addRects TypeScript addRects(rects: Array<{ x: number; y: number; width: number; height: number }>): voidSwift declaration func addRects(_ rects: [CGRect])method · iOS 7.0+ fillPath TypeScript fillPath(rule?: CGPathFillRule): voidSwift declaration func fillPath(using rule: CGPathFillRule = .winding)Fills the current path using the specified rule (winding by default).
Any open subpath is implicitly closed.
Skipped declarations 2 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
CGContext.init(data:width:height:bitsPerComponent:bytesPerRow:space:bitmapInfo:releaseCallback:releaseInfo:)
The iOS SDK compiler rejected this binding: a C function pointer cannot be formed from a closure that captures context
CGContext.init(data:width:height:bitsPerComponent:bytesPerRow:space:bitmapInfo:releaseCallback:releaseInfo:)
The iOS SDK compiler rejected this binding: a C function pointer cannot be formed from a closure that captures context
All CoreGraphics types →