One Logo Pool Ball
CoreGraphics · IOS API REFERENCE

CGContext

class · SDK 27.1

class CGContext

Members (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) | null
Swift declaration
init?(data: UnsafeMutableRawPointer?, width: Int, height: Int, bitsPerComponent: Int, bytesPerRow: Int, space: CGColorSpace?, bitmapInfo: CGBitmapInfo)
method · iOS 2.0+

makeImage

TypeScript
makeImage(): (CGImage) | null
Swift declaration
func makeImage() -> CGImage?
get · iOS 2.0+

alphaInfo

TypeScript
get alphaInfo(): CGImageAlphaInfo
Swift declaration
var alphaInfo: CGImageAlphaInfo { get }
get · iOS 2.0+

bitmapInfo

TypeScript
get bitmapInfo(): CGBitmapInfo
Swift declaration
var bitmapInfo: CGBitmapInfo { get }
get · iOS 2.0+

bitsPerComponent

TypeScript
get bitsPerComponent(): number
Swift declaration
var bitsPerComponent: Int { get }
get · iOS 2.0+

bitsPerPixel

TypeScript
get bitsPerPixel(): number
Swift declaration
var bitsPerPixel: Int { get }
get · iOS 2.0+

bytesPerRow

TypeScript
get bytesPerRow(): number
Swift declaration
var bytesPerRow: Int { get }
get · iOS 2.0+

colorSpace

TypeScript
get colorSpace(): (CGColorSpace) | null
Swift declaration
var colorSpace: CGColorSpace? { get }
get · iOS 2.0+

data

TypeScript
get data(): (SDKHandle) | null
Swift declaration
var data: UnsafeMutableRawPointer? { get }
get · iOS 2.0+

height

TypeScript
get height(): number
Swift declaration
var height: Int { get }
get · iOS 2.0+

width

TypeScript
get width(): number
Swift declaration
var width: Int { get }
method · iOS 2.0+

addEllipse

TypeScript
addEllipse(rect: { x: number; y: number; width: number; height: number }): void
Swift declaration
func addEllipse(in rect: CGRect)
method · iOS 2.0+

addPath

TypeScript
addPath(path: CGPath): void
Swift declaration
func addPath(_ path: CGPath)
method · iOS 2.0+

addRect

TypeScript
addRect(rect: { x: number; y: number; width: number; height: number }): void
Swift declaration
func addRect(_ rect: CGRect)
method · iOS 2.0+

beginPage

TypeScript
beginPage(mediaBox?: ("animatableData" | SDKHandle) | null): void
Swift declaration
func beginPage(mediaBox: UnsafePointer<CGRect>?)
method · iOS 2.0+

beginPath

TypeScript
beginPath(): void
Swift declaration
func beginPath()
method · iOS 2.0+

beginTransparencyLayer

TypeScript
beginTransparencyLayerAuxiliaryInfo(auxiliaryInfo?: (_CoreFoundation_CFDictionary) | null): void
Swift 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): void
Swift 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 }): void
Swift declaration
func clear(_ rect: CGRect)
method · iOS 2.0+

clip

TypeScript
clipToMask(rect: { x: number; y: number; width: number; height: number }, mask: CGImage): void
Swift declaration
func clip(to rect: CGRect, mask: CGImage)
method · iOS 2.0+

clip

TypeScript
clipTo(rect: { x: number; y: number; width: number; height: number }): void
Swift declaration
func clip(to rect: CGRect)
method · iOS 2.0+

closePath

TypeScript
closePath(): void
Swift declaration
func closePath()
method · iOS 2.0+

concatenate

TypeScript
concatenate(transform: _CoreFoundation_CGAffineTransform): void
Swift 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) -> CGPoint
method · iOS 2.0+

convertToUserSpace

TypeScript
convertToUserSpace(point: { x: number; y: number }): { x: number; y: number }
Swift declaration
func convertToUserSpace(_ point: CGPoint) -> CGPoint
method · 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) -> CGRect
method · 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) -> CGRect
method · iOS 2.0+

convertToDeviceSpace

TypeScript
convertToDeviceSpace39714(size: { width: number; height: number }): { width: number; height: number }
Swift declaration
func convertToDeviceSpace(_ size: CGSize) -> CGSize
method · iOS 2.0+

convertToUserSpace

TypeScript
convertToUserSpace3229(size: { width: number; height: number }): { width: number; height: number }
Swift declaration
func convertToUserSpace(_ size: CGSize) -> CGSize
get · iOS 2.0+

path

TypeScript
get path(): (CGPath) | null
Swift 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): void
Swift declaration
func drawLinearGradient(_ gradient: CGGradient, start startPoint: CGPoint, end endPoint: CGPoint, options: CGGradientDrawingOptions)
method · iOS 2.0+

drawPDFPage

TypeScript
drawPDFPage(page: CGPDFPage): void
Swift declaration
func drawPDFPage(_ page: CGPDFPage)
method · iOS 2.0+

drawPath

TypeScript
drawPath(mode: CGPathDrawingMode): void
Swift 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): void
Swift declaration
func drawRadialGradient(_ gradient: CGGradient, startCenter: CGPoint, startRadius: CGFloat, endCenter: CGPoint, endRadius: CGFloat, options: CGGradientDrawingOptions)
method · iOS 2.0+

drawShading

TypeScript
drawShading(shading: CGShading): void
Swift declaration
func drawShading(_ shading: CGShading)
method · iOS 2.0+

endPage

TypeScript
endPage(): void
Swift declaration
func endPage()
method · iOS 2.0+

endTransparencyLayer

TypeScript
endTransparencyLayer(): void
Swift declaration
func endTransparencyLayer()
method · iOS 2.0+

fillEllipse

TypeScript
fillEllipse(rect: { x: number; y: number; width: number; height: number }): void
Swift declaration
func fillEllipse(in rect: CGRect)
method · iOS 2.0+

fill

TypeScript
fill(rect: { x: number; y: number; width: number; height: number }): void
Swift declaration
func fill(_ rect: CGRect)
method · iOS 2.0+

flush

TypeScript
flush(): void
Swift declaration
func flush()
get · iOS 2.0+

ctm

TypeScript
get ctm(): _CoreFoundation_CGAffineTransform
Swift 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(): CGInterpolationQuality
Swift 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_CGAffineTransform
Swift 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(): number
Swift declaration
class var typeID: CFTypeID { get }
get · iOS 2.0+

userSpaceToDeviceSpaceTransform

TypeScript
get userSpaceToDeviceSpaceTransform(): _CoreFoundation_CGAffineTransform
Swift declaration
var userSpaceToDeviceSpaceTransform: CGAffineTransform { get }
get · iOS 2.0+

isPathEmpty

TypeScript
get isPathEmpty(): boolean
Swift declaration
var isPathEmpty: Bool { get }
method · iOS 2.0+

pathContains

TypeScript
pathContains(point: { x: number; y: number }, mode: CGPathDrawingMode): boolean
Swift declaration
func pathContains(_ point: CGPoint, mode: CGPathDrawingMode) -> Bool
method · iOS 2.0+

replacePathWithStrokedPath

TypeScript
replacePathWithStrokedPath(): void
Swift declaration
func replacePathWithStrokedPath()
method

resetClip

TypeScript
resetClip(): void
Swift declaration
func resetClip()
method · iOS 2.0+

restoreGState

TypeScript
restoreGState(): void
Swift declaration
func restoreGState()
method · iOS 2.0+

rotate

TypeScript
rotate(angle: number): void
Swift declaration
func rotate(by angle: CGFloat)
method · iOS 2.0+

saveGState

TypeScript
saveGState(): void
Swift declaration
func saveGState()
method · iOS 2.0+

scaleBy

TypeScript
scaleBy(sx: number, sy: number): void
Swift declaration
func scaleBy(x sx: CGFloat, y sy: CGFloat)
method · iOS 2.0+

setAllowsAntialiasing

TypeScript
setAllowsAntialiasing(allowsAntialiasing: boolean): void
Swift declaration
func setAllowsAntialiasing(_ allowsAntialiasing: Bool)
method · iOS 2.0+

setAllowsFontSmoothing

TypeScript
setAllowsFontSmoothing(allowsFontSmoothing: boolean): void
Swift declaration
func setAllowsFontSmoothing(_ allowsFontSmoothing: Bool)
method · iOS 2.0+

setAllowsFontSubpixelPositioning

TypeScript
setAllowsFontSubpixelPositioning(allowsFontSubpixelPositioning: boolean): void
Swift declaration
func setAllowsFontSubpixelPositioning(_ allowsFontSubpixelPositioning: Bool)
method · iOS 2.0+

setAllowsFontSubpixelQuantization

TypeScript
setAllowsFontSubpixelQuantization(allowsFontSubpixelQuantization: boolean): void
Swift declaration
func setAllowsFontSubpixelQuantization(_ allowsFontSubpixelQuantization: Bool)
method · iOS 2.0+

setAlpha

TypeScript
setAlpha(alpha: number): void
Swift declaration
func setAlpha(_ alpha: CGFloat)
method · iOS 2.0+

setBlendMode

TypeScript
setBlendMode(mode: CGBlendMode): void
Swift declaration
func setBlendMode(_ mode: CGBlendMode)
method · iOS 2.0+

setFillColor

TypeScript
setFillColorCyanMagentaYellowBlackAlpha(cyan: number, magenta: number, yellow: number, black: number, alpha: number): void
Swift 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): void
Swift declaration
func setStrokeColor(cyan: CGFloat, magenta: CGFloat, yellow: CGFloat, black: CGFloat, alpha: CGFloat)
method · iOS 2.0+

setCharacterSpacing

TypeScript
setCharacterSpacing(spacing: number): void
Swift declaration
func setCharacterSpacing(_ spacing: CGFloat)
method · iOS 18.0+

setEDRTargetHeadroom

TypeScript
setEDRTargetHeadroom(headroom: number): boolean
Swift declaration
func setEDRTargetHeadroom(_ headroom: Float) -> Bool
method · iOS 2.0+

setFillColor

TypeScript
setFillColor(components: "animatableData" | SDKHandle): void
Swift declaration
func setFillColor(_ components: UnsafePointer<CGFloat>)
method · iOS 2.0+

setFillColorSpace

TypeScript
setFillColorSpace(space: CGColorSpace): void
Swift declaration
func setFillColorSpace(_ space: CGColorSpace)
method · iOS 2.0+

setFillColor

TypeScript
setFillColor49658(color: CGColor): void
Swift declaration
func setFillColor(_ color: CGColor)
method · iOS 2.0+

setFillPattern

TypeScript
setFillPattern(pattern: CGPattern, components: "animatableData" | SDKHandle): void
Swift declaration
func setFillPattern(_ pattern: CGPattern, colorComponents components: UnsafePointer<CGFloat>)
method · iOS 2.0+

setFlatness

TypeScript
setFlatness(flatness: number): void
Swift declaration
func setFlatness(_ flatness: CGFloat)
method · iOS 2.0+

setFont

TypeScript
setFont(font: CGFont): void
Swift declaration
func setFont(_ font: CGFont)
method · iOS 2.0+

setFontSize

TypeScript
setFontSize(size: number): void
Swift declaration
func setFontSize(_ size: CGFloat)
method · iOS 2.0+

setFillColor

TypeScript
setFillColorGrayAlpha(gray: number, alpha: number): void
Swift declaration
func setFillColor(gray: CGFloat, alpha: CGFloat)
method · iOS 2.0+

setStrokeColor

TypeScript
setStrokeColorGrayAlpha(gray: number, alpha: number): void
Swift declaration
func setStrokeColor(gray: CGFloat, alpha: CGFloat)
method · iOS 2.0+

setLineCap

TypeScript
setLineCap(cap: CGLineCap): void
Swift declaration
func setLineCap(_ cap: CGLineCap)
method · iOS 2.0+

setLineJoin

TypeScript
setLineJoin(join: CGLineJoin): void
Swift declaration
func setLineJoin(_ join: CGLineJoin)
method · iOS 2.0+

setLineWidth

TypeScript
setLineWidth(width: number): void
Swift declaration
func setLineWidth(_ width: CGFloat)
method · iOS 2.0+

setMiterLimit

TypeScript
setMiterLimit(limit: number): void
Swift declaration
func setMiterLimit(_ limit: CGFloat)
method · iOS 2.0+

setPatternPhase

TypeScript
setPatternPhase(phase: { width: number; height: number }): void
Swift declaration
func setPatternPhase(_ phase: CGSize)
method · iOS 2.0+

setFillColor

TypeScript
setFillColorRedGreenBlueAlpha(red: number, green: number, blue: number, alpha: number): void
Swift 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): void
Swift declaration
func setStrokeColor(red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat)
method · iOS 2.0+

setRenderingIntent

TypeScript
setRenderingIntent(intent: CGColorRenderingIntent): void
Swift declaration
func setRenderingIntent(_ intent: CGColorRenderingIntent)
method · iOS 2.0+

setShadow

TypeScript
setShadowOffsetBlur(offset: { width: number; height: number }, blur: number): void
Swift declaration
func setShadow(offset: CGSize, blur: CGFloat)
method · iOS 2.0+

setShadow

TypeScript
setShadowOffsetBlurColor(offset: { width: number; height: number }, blur: number, color?: (CGColor) | null): void
Swift declaration
func setShadow(offset: CGSize, blur: CGFloat, color: CGColor?)
method · iOS 2.0+

setShouldAntialias

TypeScript
setShouldAntialias(shouldAntialias: boolean): void
Swift declaration
func setShouldAntialias(_ shouldAntialias: Bool)
method · iOS 2.0+

setShouldSmoothFonts

TypeScript
setShouldSmoothFonts(shouldSmoothFonts: boolean): void
Swift declaration
func setShouldSmoothFonts(_ shouldSmoothFonts: Bool)
method · iOS 2.0+

setShouldSubpixelPositionFonts

TypeScript
setShouldSubpixelPositionFonts(shouldSubpixelPositionFonts: boolean): void
Swift declaration
func setShouldSubpixelPositionFonts(_ shouldSubpixelPositionFonts: Bool)
method · iOS 2.0+

setShouldSubpixelQuantizeFonts

TypeScript
setShouldSubpixelQuantizeFonts(shouldSubpixelQuantizeFonts: boolean): void
Swift declaration
func setShouldSubpixelQuantizeFonts(_ shouldSubpixelQuantizeFonts: Bool)
method · iOS 2.0+

setStrokeColor

TypeScript
setStrokeColor(components: "animatableData" | SDKHandle): void
Swift declaration
func setStrokeColor(_ components: UnsafePointer<CGFloat>)
method · iOS 2.0+

setStrokeColorSpace

TypeScript
setStrokeColorSpace(space: CGColorSpace): void
Swift declaration
func setStrokeColorSpace(_ space: CGColorSpace)
method · iOS 2.0+

setStrokeColor

TypeScript
setStrokeColor46187(color: CGColor): void
Swift declaration
func setStrokeColor(_ color: CGColor)
method · iOS 2.0+

setStrokePattern

TypeScript
setStrokePattern(pattern: CGPattern, components: "animatableData" | SDKHandle): void
Swift declaration
func setStrokePattern(_ pattern: CGPattern, colorComponents components: UnsafePointer<CGFloat>)
method · iOS 2.0+

setTextDrawingMode

TypeScript
setTextDrawingMode(mode: CGTextDrawingMode): void
Swift declaration
func setTextDrawingMode(_ mode: CGTextDrawingMode)
method · iOS 2.0+

strokeEllipse

TypeScript
strokeEllipse(rect: { x: number; y: number; width: number; height: number }): void
Swift declaration
func strokeEllipse(in rect: CGRect)
method · iOS 2.0+

strokePath

TypeScript
strokePath(): void
Swift declaration
func strokePath()
method · iOS 2.0+

stroke

TypeScript
stroke(rect: { x: number; y: number; width: number; height: number }): void
Swift declaration
func stroke(_ rect: CGRect)
method · iOS 2.0+

stroke

TypeScript
strokeWidth(rect: { x: number; y: number; width: number; height: number }, width: number): void
Swift declaration
func stroke(_ rect: CGRect, width: CGFloat)
method · iOS 2.0+

synchronize

TypeScript
synchronize(): void
Swift declaration
func synchronize()
method · iOS 26.0+

synchronizeAttributes

TypeScript
synchronizeAttributes(): void
Swift declaration
func synchronizeAttributes()
method · iOS 2.0+

translateBy

TypeScript
translateBy(tx: number, ty: number): void
Swift declaration
func translateBy(x tx: CGFloat, y ty: CGFloat)
method · iOS 2.0+

addDestination

TypeScript
addDestination(name: _CoreFoundation_CFString, point: { x: number; y: number }): void
Swift declaration
func addDestination(_ name: CFString, at point: CGPoint)
method · iOS 4.0+

addDocumentMetadata

TypeScript
addDocumentMetadata(metadata?: (_CoreFoundation_CFData) | null): void
Swift declaration
func addDocumentMetadata(_ metadata: CFData?)
method · iOS 27.0+

addStructureTreeRootChild

TypeScript
addStructureTreeRootChild(structureElement: CGPDFStructureElement): number
Swift declaration
func addStructureTreeRootChild(_ structureElement: CGPDFStructureElement) -> OSStatus
method · iOS 27.0+

beginMarkedContentSequence

TypeScript
beginMarkedContentSequence(tagType: CGPDFTagType): (CGPDFMarkedContentItem) | null
Swift declaration
func beginMarkedContentSequence(_ tagType: CGPDFTagType) -> CGPDFMarkedContentItem?
method · iOS 27.0+

beginNonStructuralMarkedContentSequence

TypeScript
beginNonStructuralMarkedContentSequence(tagType: CGPDFTagType): void
Swift declaration
func beginNonStructuralMarkedContentSequence(_ tagType: CGPDFTagType)
method · iOS 27.0+

beginObjectReference

TypeScript
beginObjectReference(): (CGPDFMarkedContentItem) | null
Swift declaration
func beginObjectReference() -> CGPDFMarkedContentItem?
method · iOS 2.0+

beginPDFPage

TypeScript
beginPDFPage(pageInfo?: (_CoreFoundation_CFDictionary) | null): void
Swift declaration
func beginPDFPage(_ pageInfo: CFDictionary?)
method · iOS 2.0+

closePDF

TypeScript
closePDF(): void
Swift declaration
func closePDF()
init · iOS 2.0+

init

TypeScript
static initConsumerMediaBox(consumer: CGDataConsumer, mediaBox?: ("animatableData" | SDKHandle) | null, auxiliaryInfo?: (_CoreFoundation_CFDictionary) | null): (CGContext) | null
Swift 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) | null
Swift declaration
init?(_ url: CFURL, mediaBox: UnsafePointer<CGRect>?, _ auxiliaryInfo: CFDictionary?)
method · iOS 27.0+

endMarkedContentSequence

TypeScript
endMarkedContentSequence(): void
Swift declaration
func endMarkedContentSequence()
method · iOS 27.0+

endObjectReference

TypeScript
endObjectReference(): void
Swift declaration
func endObjectReference()
method · iOS 2.0+

endPDFPage

TypeScript
endPDFPage(): void
Swift declaration
func endPDFPage()
method · iOS 2.0+

setDestination

TypeScript
setDestination(name: _CoreFoundation_CFString, rect: { x: number; y: number; width: number; height: number }): void
Swift 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 }): void
Swift 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) | null
Swift 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 }>): void
Swift declaration
func showGlyphs(_ glyphs: [CGGlyph], at positions: [CGPoint])
method · iOS 7.0+

setLineDash

TypeScript
setLineDash(phase: number, lengths: Array<number>): void
Swift declaration
func setLineDash(phase: CGFloat, lengths: [CGFloat])
method · iOS 7.0+

addQuadCurve

TypeScript
addQuadCurve(end: { x: number; y: number }, control: { x: number; y: number }): void
Swift 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 }>): void
Swift declaration
func strokeLineSegments(between points: [CGPoint])
get · iOS 26.0+

contentToneMappingInfo

TypeScript
get contentToneMappingInfo(): CGContentToneMappingInfo
Swift 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 }>): void
Swift declaration
func clip(to rects: [CGRect])
method · iOS 7.0+

clip

TypeScript
clipUsing(rule?: CGPathFillRule): void
Swift 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 }): void
Swift 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): boolean
Swift declaration
func draw(_ image: CGImage, in rect: CGRect, by toneMapping: CGToneMapping = .default, options: CFDictionary?) -> Bool
method · iOS 7.0+

draw

TypeScript
drawInByTiling(image: CGImage, rect: { x: number; y: number; width: number; height: number }, byTiling?: boolean): void
Swift 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 }): void
Swift 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 }>): void
Swift declaration
func fill(_ rects: [CGRect])
method · iOS 7.0+

move

TypeScript
move(point: { x: number; y: number }): void
Swift 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): void
Swift 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): void
Swift 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 }): void
Swift 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 }): void
Swift declaration
func addCurve(to end: CGPoint, control1: CGPoint, control2: CGPoint)
method · iOS 7.0+

addLines

TypeScript
addLines(points: Array<{ x: number; y: number }>): void
Swift declaration
func addLines(between points: [CGPoint])
method · iOS 7.0+

addRects

TypeScript
addRects(rects: Array<{ x: number; y: number; width: number; height: number }>): void
Swift declaration
func addRects(_ rects: [CGRect])
method · iOS 7.0+

fillPath

TypeScript
fillPath(rule?: CGPathFillRule): void
Swift 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 →