Documentation Archive Developer
Search

CoreGraphics Changes for Objective-C

CoreGraphics

CGBitmapContext.h

Declaration
From
CGContextRef CGBitmapContextCreate (
    void *data,
    size_t width,
    size_t height,
    size_t bitsPerComponent,
    size_t bytesPerRow,
    CGColorSpaceRef space,
    CGBitmapInfo bitmapInfo
);
To
CGContextRef _Nullable CGBitmapContextCreate (
    void * _Nullable data,
    size_t width,
    size_t height,
    size_t bitsPerComponent,
    size_t bytesPerRow,
    CGColorSpaceRef _Nullable space,
    uint32_t bitmapInfo
);

Declaration
From
CGContextRef CGBitmapContextCreateWithData (
    void *data,
    size_t width,
    size_t height,
    size_t bitsPerComponent,
    size_t bytesPerRow,
    CGColorSpaceRef space,
    CGBitmapInfo bitmapInfo,
    CGBitmapContextReleaseDataCallback releaseCallback,
    void *releaseInfo
);
To
CGContextRef _Nullable CGBitmapContextCreateWithData (
    void * _Nullable data,
    size_t width,
    size_t height,
    size_t bitsPerComponent,
    size_t bytesPerRow,
    CGColorSpaceRef _Nullable space,
    uint32_t bitmapInfo,
    CGBitmapContextReleaseDataCallback _Nullable releaseCallback,
    void * _Nullable releaseInfo
);

CGColor.h

Declaration
From
CGColorRef CGColorCreate (
    CGColorSpaceRef space,
    const CGFloat components[]
);
To
CGColorRef _Nullable CGColorCreate (
    CGColorSpaceRef _Nullable space,
    const CGFloat * _Nullable components
);

Declaration
From
CGColorRef CGColorCreateWithPattern (
    CGColorSpaceRef space,
    CGPatternRef pattern,
    const CGFloat components[]
);
To
CGColorRef _Nullable CGColorCreateWithPattern (
    CGColorSpaceRef _Nullable space,
    CGPatternRef _Nullable pattern,
    const CGFloat * _Nullable components
);

CGColorSpace.h

CGContext.h

Declaration
From
void CGContextAddEllipseInRect (
    CGContextRef context,
    CGRect rect
);
To
void CGContextAddEllipseInRect (
    CGContextRef _Nullable c,
    CGRect rect
);

Declaration
From
void CGContextAddLines (
    CGContextRef c,
    const CGPoint points[],
    size_t count
);
To
void CGContextAddLines (
    CGContextRef _Nullable c,
    const CGPoint * _Nullable points,
    size_t count
);

Declaration
From
void CGContextAddPath (
    CGContextRef context,
    CGPathRef path
);
To
void CGContextAddPath (
    CGContextRef _Nullable c,
    CGPathRef _Nullable path
);

Declaration
From
void CGContextAddRects (
    CGContextRef c,
    const CGRect rects[],
    size_t count
);
To
void CGContextAddRects (
    CGContextRef _Nullable c,
    const CGRect * _Nullable rects,
    size_t count
);

Declaration
From
void CGContextBeginTransparencyLayer (
    CGContextRef context,
    CFDictionaryRef auxiliaryInfo
);
To
void CGContextBeginTransparencyLayer (
    CGContextRef _Nullable c,
    CFDictionaryRef _Nullable auxiliaryInfo
);

Declaration
From
void CGContextBeginTransparencyLayerWithRect (
    CGContextRef context,
    CGRect rect,
    CFDictionaryRef auxiliaryInfo
);
To
void CGContextBeginTransparencyLayerWithRect (
    CGContextRef _Nullable c,
    CGRect rect,
    CFDictionaryRef _Nullable auxInfo
);

Declaration
From
void CGContextClipToRects (
    CGContextRef c,
    const CGRect rects[],
    size_t count
);
To
void CGContextClipToRects (
    CGContextRef _Nullable c,
    const CGRect * _Nonnull rects,
    size_t count
);

Declaration
From
CGPoint CGContextConvertPointToDeviceSpace (
    CGContextRef context,
    CGPoint point
);
To
CGPoint CGContextConvertPointToDeviceSpace (
    CGContextRef _Nullable c,
    CGPoint point
);

Declaration
From
CGPoint CGContextConvertPointToUserSpace (
    CGContextRef context,
    CGPoint point
);
To
CGPoint CGContextConvertPointToUserSpace (
    CGContextRef _Nullable c,
    CGPoint point
);

Declaration
From
CGRect CGContextConvertRectToDeviceSpace (
    CGContextRef context,
    CGRect rect
);
To
CGRect CGContextConvertRectToDeviceSpace (
    CGContextRef _Nullable c,
    CGRect rect
);

Declaration
From
CGRect CGContextConvertRectToUserSpace (
    CGContextRef context,
    CGRect rect
);
To
CGRect CGContextConvertRectToUserSpace (
    CGContextRef _Nullable c,
    CGRect rect
);

Declaration
From
CGSize CGContextConvertSizeToDeviceSpace (
    CGContextRef context,
    CGSize size
);
To
CGSize CGContextConvertSizeToDeviceSpace (
    CGContextRef _Nullable c,
    CGSize size
);

Declaration
From
CGSize CGContextConvertSizeToUserSpace (
    CGContextRef context,
    CGSize size
);
To
CGSize CGContextConvertSizeToUserSpace (
    CGContextRef _Nullable c,
    CGSize size
);

Declaration
From
CGPathRef CGContextCopyPath (
    CGContextRef context
);
To
CGPathRef _Nullable CGContextCopyPath (
    CGContextRef _Nullable c
);

Declaration
From
void CGContextDrawLinearGradient (
    CGContextRef context,
    CGGradientRef gradient,
    CGPoint startPoint,
    CGPoint endPoint,
    CGGradientDrawingOptions options
);
To
void CGContextDrawLinearGradient (
    CGContextRef _Nullable c,
    CGGradientRef _Nullable gradient,
    CGPoint startPoint,
    CGPoint endPoint,
    CGGradientDrawingOptions options
);

Declaration
From
void CGContextDrawRadialGradient (
    CGContextRef context,
    CGGradientRef gradient,
    CGPoint startCenter,
    CGFloat startRadius,
    CGPoint endCenter,
    CGFloat endRadius,
    CGGradientDrawingOptions options
);
To
void CGContextDrawRadialGradient (
    CGContextRef _Nullable c,
    CGGradientRef _Nullable gradient,
    CGPoint startCenter,
    CGFloat startRadius,
    CGPoint endCenter,
    CGFloat endRadius,
    CGGradientDrawingOptions options
);

Declaration
From
void CGContextDrawShading (
    CGContextRef context,
    CGShadingRef shading
);
To
void CGContextDrawShading (
    CGContextRef _Nullable c,
    CGShadingRef _Nullable shading
);

Declaration
From
void CGContextEndTransparencyLayer (
    CGContextRef context
);
To
void CGContextEndTransparencyLayer (
    CGContextRef _Nullable c
);

Declaration
From
void CGContextFillEllipseInRect (
    CGContextRef context,
    CGRect rect
);
To
void CGContextFillEllipseInRect (
    CGContextRef _Nullable c,
    CGRect rect
);

Declaration
From
void CGContextFillRects (
    CGContextRef c,
    const CGRect rects[],
    size_t count
);
To
void CGContextFillRects (
    CGContextRef _Nullable c,
    const CGRect * _Nullable rects,
    size_t count
);

Declaration
From
CGInterpolationQuality CGContextGetInterpolationQuality (
    CGContextRef context
);
To
CGInterpolationQuality CGContextGetInterpolationQuality (
    CGContextRef _Nullable c
);

Declaration
From
CGRect CGContextGetPathBoundingBox (
    CGContextRef context
);
To
CGRect CGContextGetPathBoundingBox (
    CGContextRef _Nullable c
);

Declaration
From
CGPoint CGContextGetPathCurrentPoint (
    CGContextRef context
);
To
CGPoint CGContextGetPathCurrentPoint (
    CGContextRef _Nullable c
);

Declaration
From
CGPoint CGContextGetTextPosition (
    CGContextRef context
);
To
CGPoint CGContextGetTextPosition (
    CGContextRef _Nullable c
);

Declaration
From
CGAffineTransform CGContextGetUserSpaceToDeviceSpaceTransform (
    CGContextRef context
);
To
CGAffineTransform CGContextGetUserSpaceToDeviceSpaceTransform (
    CGContextRef _Nullable c
);

Declaration
From
bool CGContextIsPathEmpty (
    CGContextRef context
);
To
bool CGContextIsPathEmpty (
    CGContextRef _Nullable c
);

Declaration
From
bool CGContextPathContainsPoint (
    CGContextRef context,
    CGPoint point,
    CGPathDrawingMode mode
);
To
bool CGContextPathContainsPoint (
    CGContextRef _Nullable c,
    CGPoint point,
    CGPathDrawingMode mode
);

Declaration
From
void CGContextSetAllowsAntialiasing (
    CGContextRef context,
    bool allowsAntialiasing
);
To
void CGContextSetAllowsAntialiasing (
    CGContextRef _Nullable c,
    bool allowsAntialiasing
);

Declaration
From
void CGContextSetAllowsFontSmoothing (
    CGContextRef context,
    bool allowsFontSmoothing
);
To
void CGContextSetAllowsFontSmoothing (
    CGContextRef _Nullable c,
    bool allowsFontSmoothing
);

Declaration
From
void CGContextSetAllowsFontSubpixelPositioning (
    CGContextRef context,
    bool allowsFontSubpixelPositioning
);
To
void CGContextSetAllowsFontSubpixelPositioning (
    CGContextRef _Nullable c,
    bool allowsFontSubpixelPositioning
);

Declaration
From
void CGContextSetAllowsFontSubpixelQuantization (
    CGContextRef context,
    bool allowsFontSubpixelQuantization
);
To
void CGContextSetAllowsFontSubpixelQuantization (
    CGContextRef _Nullable c,
    bool allowsFontSubpixelQuantization
);

Declaration
From
void CGContextSetBlendMode (
    CGContextRef context,
    CGBlendMode mode
);
To
void CGContextSetBlendMode (
    CGContextRef _Nullable c,
    CGBlendMode mode
);

Declaration
From
void CGContextSetCharacterSpacing (
    CGContextRef context,
    CGFloat spacing
);
To
void CGContextSetCharacterSpacing (
    CGContextRef _Nullable c,
    CGFloat spacing
);

Declaration
From
void CGContextSetCMYKFillColor (
    CGContextRef context,
    CGFloat cyan,
    CGFloat magenta,
    CGFloat yellow,
    CGFloat black,
    CGFloat alpha
);
To
void CGContextSetCMYKFillColor (
    CGContextRef _Nullable c,
    CGFloat cyan,
    CGFloat magenta,
    CGFloat yellow,
    CGFloat black,
    CGFloat alpha
);

Declaration
From
void CGContextSetCMYKStrokeColor (
    CGContextRef context,
    CGFloat cyan,
    CGFloat magenta,
    CGFloat yellow,
    CGFloat black,
    CGFloat alpha
);
To
void CGContextSetCMYKStrokeColor (
    CGContextRef _Nullable c,
    CGFloat cyan,
    CGFloat magenta,
    CGFloat yellow,
    CGFloat black,
    CGFloat alpha
);

Declaration
From
void CGContextSetFillColor (
    CGContextRef context,
    const CGFloat components[]
);
To
void CGContextSetFillColor (
    CGContextRef _Nullable c,
    const CGFloat * _Nullable components
);

Declaration
From
void CGContextSetFillColorSpace (
    CGContextRef context,
    CGColorSpaceRef space
);
To
void CGContextSetFillColorSpace (
    CGContextRef _Nullable c,
    CGColorSpaceRef _Nullable space
);

Declaration
From
void CGContextSetFillPattern (
    CGContextRef context,
    CGPatternRef pattern,
    const CGFloat components[]
);
To
void CGContextSetFillPattern (
    CGContextRef _Nullable c,
    CGPatternRef _Nullable pattern,
    const CGFloat * _Nullable components
);

Declaration
From
void CGContextSetGrayFillColor (
    CGContextRef context,
    CGFloat gray,
    CGFloat alpha
);
To
void CGContextSetGrayFillColor (
    CGContextRef _Nullable c,
    CGFloat gray,
    CGFloat alpha
);

Declaration
From
void CGContextSetGrayStrokeColor (
    CGContextRef context,
    CGFloat gray,
    CGFloat alpha
);
To
void CGContextSetGrayStrokeColor (
    CGContextRef _Nullable c,
    CGFloat gray,
    CGFloat alpha
);

Declaration
From
void CGContextSetInterpolationQuality (
    CGContextRef context,
    CGInterpolationQuality quality
);
To
void CGContextSetInterpolationQuality (
    CGContextRef _Nullable c,
    CGInterpolationQuality quality
);

Declaration
From
void CGContextSetLineDash (
    CGContextRef c,
    CGFloat phase,
    const CGFloat lengths[],
    size_t count
);
To
void CGContextSetLineDash (
    CGContextRef _Nullable c,
    CGFloat phase,
    const CGFloat * _Nullable lengths,
    size_t count
);

Declaration
From
void CGContextSetPatternPhase (
    CGContextRef context,
    CGSize phase
);
To
void CGContextSetPatternPhase (
    CGContextRef _Nullable c,
    CGSize phase
);

Declaration
From
void CGContextSetRenderingIntent (
    CGContextRef context,
    CGColorRenderingIntent intent
);
To
void CGContextSetRenderingIntent (
    CGContextRef _Nullable c,
    CGColorRenderingIntent intent
);

Declaration
From
void CGContextSetRGBFillColor (
    CGContextRef context,
    CGFloat red,
    CGFloat green,
    CGFloat blue,
    CGFloat alpha
);
To
void CGContextSetRGBFillColor (
    CGContextRef _Nullable c,
    CGFloat red,
    CGFloat green,
    CGFloat blue,
    CGFloat alpha
);

Declaration
From
void CGContextSetRGBStrokeColor (
    CGContextRef context,
    CGFloat red,
    CGFloat green,
    CGFloat blue,
    CGFloat alpha
);
To
void CGContextSetRGBStrokeColor (
    CGContextRef _Nullable c,
    CGFloat red,
    CGFloat green,
    CGFloat blue,
    CGFloat alpha
);

Declaration
From
void CGContextSetShadow (
    CGContextRef context,
    CGSize offset,
    CGFloat blur
);
To
void CGContextSetShadow (
    CGContextRef _Nullable c,
    CGSize offset,
    CGFloat blur
);

Declaration
From
void CGContextSetShadowWithColor (
    CGContextRef context,
    CGSize offset,
    CGFloat blur,
    CGColorRef color
);
To
void CGContextSetShadowWithColor (
    CGContextRef _Nullable c,
    CGSize offset,
    CGFloat blur,
    CGColorRef _Nullable color
);

Declaration
From
void CGContextSetShouldAntialias (
    CGContextRef context,
    bool shouldAntialias
);
To
void CGContextSetShouldAntialias (
    CGContextRef _Nullable c,
    bool shouldAntialias
);

Declaration
From
void CGContextSetShouldSmoothFonts (
    CGContextRef context,
    bool shouldSmoothFonts
);
To
void CGContextSetShouldSmoothFonts (
    CGContextRef _Nullable c,
    bool shouldSmoothFonts
);

Declaration
From
void CGContextSetShouldSubpixelPositionFonts (
    CGContextRef context,
    bool shouldSubpixelPositionFonts
);
To
void CGContextSetShouldSubpixelPositionFonts (
    CGContextRef _Nullable c,
    bool shouldSubpixelPositionFonts
);

Declaration
From
void CGContextSetShouldSubpixelQuantizeFonts (
    CGContextRef context,
    bool shouldSubpixelQuantizeFonts
);
To
void CGContextSetShouldSubpixelQuantizeFonts (
    CGContextRef _Nullable c,
    bool shouldSubpixelQuantizeFonts
);

Declaration
From
void CGContextSetStrokeColor (
    CGContextRef context,
    const CGFloat components[]
);
To
void CGContextSetStrokeColor (
    CGContextRef _Nullable c,
    const CGFloat * _Nullable components
);

Declaration
From
void CGContextSetStrokeColorSpace (
    CGContextRef context,
    CGColorSpaceRef space
);
To
void CGContextSetStrokeColorSpace (
    CGContextRef _Nullable c,
    CGColorSpaceRef _Nullable space
);

Declaration
From
void CGContextSetStrokePattern (
    CGContextRef context,
    CGPatternRef pattern,
    const CGFloat components[]
);
To
void CGContextSetStrokePattern (
    CGContextRef _Nullable c,
    CGPatternRef _Nullable pattern,
    const CGFloat * _Nullable components
);

Declaration
From
void CGContextShowGlyphs (
    CGContextRef c,
    const CGGlyph g[],
    size_t count
);
To
void CGContextShowGlyphs (
    CGContextRef _Nullable c,
    const CGGlyph * _Nullable g,
    size_t count
);

Declaration
From
void CGContextShowGlyphsAtPoint (
    CGContextRef context,
    CGFloat x,
    CGFloat y,
    const CGGlyph glyphs[],
    size_t count
);
To
void CGContextShowGlyphsAtPoint (
    CGContextRef _Nullable c,
    CGFloat x,
    CGFloat y,
    const CGGlyph * _Nullable glyphs,
    size_t count
);

Declaration
From
void CGContextShowGlyphsAtPositions (
    CGContextRef context,
    const CGGlyph glyphs[],
    const CGPoint positions[],
    size_t count
);
To
void CGContextShowGlyphsAtPositions (
    CGContextRef _Nullable c,
    const CGGlyph * _Nullable glyphs,
    const CGPoint * _Nullable Lpositions,
    size_t count
);

Declaration
From
void CGContextShowGlyphsWithAdvances (
    CGContextRef context,
    const CGGlyph glyphs[],
    const CGSize advances[],
    size_t count
);
To
void CGContextShowGlyphsWithAdvances (
    CGContextRef _Nullable c,
    const CGGlyph * _Nullable glyphs,
    const CGSize * _Nullable advances,
    size_t count
);

Declaration
From
void CGContextStrokeEllipseInRect (
    CGContextRef context,
    CGRect rect
);
To
void CGContextStrokeEllipseInRect (
    CGContextRef _Nullable c,
    CGRect rect
);

Declaration
From
void CGContextStrokeLineSegments (
    CGContextRef c,
    const CGPoint points[],
    size_t count
);
To
void CGContextStrokeLineSegments (
    CGContextRef _Nullable c,
    const CGPoint * _Nullable points,
    size_t count
);

Deprecation
FromiOS 7.0
To--

Deprecation
From--
ToiOS 7.0

Deprecation
From--
ToiOS 7.0

CGDataConsumer.h

Declaration
From
CGDataConsumerRef CGDataConsumerCreate (
    void *info,
    const CGDataConsumerCallbacks *callbacks
);
To
CGDataConsumerRef _Nullable CGDataConsumerCreate (
    void * _Nullable info,
    const CGDataConsumerCallbacks * _Nullable cbks
);

CGFont.h

Added CGGlypDeprecatedEnum
Declaration
From
CFDataRef CGFontCreatePostScriptSubset (
    CGFontRef font,
    CFStringRef subsetName,
    CGFontPostScriptFormat format,
    const CGGlyph glyphs[],
    size_t count,
    const CGGlyph encoding[256]
);
To
CFDataRef _Nullable CGFontCreatePostScriptSubset (
    CGFontRef _Nullable font,
    CFStringRef _Nullable subsetName,
    CGFontPostScriptFormat format,
    const CGGlyph * _Nullable glyphs,
    size_t count,
    const CGGlyph encoding[256]
);

Declaration
From
bool CGFontGetGlyphAdvances (
    CGFontRef font,
    const CGGlyph glyphs[],
    size_t count,
    int advances[]
);
To
bool CGFontGetGlyphAdvances (
    CGFontRef _Nullable font,
    const CGGlyph * _Nonnull glyphs,
    size_t count,
    int * _Nonnull advances
);

Declaration
From
bool CGFontGetGlyphBBoxes (
    CGFontRef font,
    const CGGlyph glyphs[],
    size_t count,
    CGRect bboxes[]
);
To
bool CGFontGetGlyphBBoxes (
    CGFontRef _Nullable font,
    const CGGlyph * _Nonnull glyphs,
    size_t count,
    CGRect * _Nonnull bboxes
);

CGGradient.h

Declaration
From
CGGradientRef CGGradientCreateWithColorComponents (
    CGColorSpaceRef space,
    const CGFloat components[],
    const CGFloat locations[],
    size_t count
);
To
CGGradientRef _Nullable CGGradientCreateWithColorComponents (
    CGColorSpaceRef _Nullable space,
    const CGFloat * _Nullable components,
    const CGFloat * _Nullable locations,
    size_t count
);

Declaration
From
CGGradientRef CGGradientCreateWithColors (
    CGColorSpaceRef space,
    CFArrayRef colors,
    const CGFloat locations[]
);
To
CGGradientRef _Nullable CGGradientCreateWithColors (
    CGColorSpaceRef _Nullable space,
    CFArrayRef _Nullable colors,
    const CGFloat * _Nullable locations
);

CGImage.h

Declaration
From
CGImageRef CGImageCreate (
    size_t width,
    size_t height,
    size_t bitsPerComponent,
    size_t bitsPerPixel,
    size_t bytesPerRow,
    CGColorSpaceRef space,
    CGBitmapInfo bitmapInfo,
    CGDataProviderRef provider,
    const CGFloat decode[],
    bool shouldInterpolate,
    CGColorRenderingIntent intent
);
To
CGImageRef _Nullable CGImageCreate (
    size_t width,
    size_t height,
    size_t bitsPerComponent,
    size_t bitsPerPixel,
    size_t bytesPerRow,
    CGColorSpaceRef _Nullable space,
    CGBitmapInfo bitmapInfo,
    CGDataProviderRef _Nullable provider,
    const CGFloat * _Nullable decode,
    bool shouldInterpolate,
    CGColorRenderingIntent intent
);

Declaration
From
CGImageRef CGImageCreateWithJPEGDataProvider (
    CGDataProviderRef source,
    const CGFloat decode[],
    bool shouldInterpolate,
    CGColorRenderingIntent intent
);
To
CGImageRef _Nullable CGImageCreateWithJPEGDataProvider (
    CGDataProviderRef _Nullable source,
    const CGFloat * _Nullable decode,
    bool shouldInterpolate,
    CGColorRenderingIntent intent
);

Declaration
From
CGImageRef CGImageCreateWithMaskingColors (
    CGImageRef image,
    const CGFloat components[]
);
To
CGImageRef _Nullable CGImageCreateWithMaskingColors (
    CGImageRef _Nullable image,
    const CGFloat * _Nullable components
);

Declaration
From
CGImageRef CGImageCreateWithPNGDataProvider (
    CGDataProviderRef source,
    const CGFloat decode[],
    bool shouldInterpolate,
    CGColorRenderingIntent intent
);
To
CGImageRef _Nullable CGImageCreateWithPNGDataProvider (
    CGDataProviderRef _Nullable source,
    const CGFloat * _Nullable decode,
    bool shouldInterpolate,
    CGColorRenderingIntent intent
);

Declaration
From
CGImageRef CGImageMaskCreate (
    size_t width,
    size_t height,
    size_t bitsPerComponent,
    size_t bitsPerPixel,
    size_t bytesPerRow,
    CGDataProviderRef provider,
    const CGFloat decode[],
    bool shouldInterpolate
);
To
CGImageRef _Nullable CGImageMaskCreate (
    size_t width,
    size_t height,
    size_t bitsPerComponent,
    size_t bitsPerPixel,
    size_t bytesPerRow,
    CGDataProviderRef _Nullable provider,
    const CGFloat * _Nullable decode,
    bool shouldInterpolate
);

CGPath.h

Declaration
From
void CGPathAddLines (
    CGMutablePathRef path,
    const CGAffineTransform *m,
    const CGPoint points[],
    size_t count
);
To
void CGPathAddLines (
    CGMutablePathRef _Nullable path,
    const CGAffineTransform * _Nullable m,
    const CGPoint * _Nullable points,
    size_t count
);

Declaration
From
void CGPathAddRects (
    CGMutablePathRef path,
    const CGAffineTransform *m,
    const CGRect rects[],
    size_t count
);
To
void CGPathAddRects (
    CGMutablePathRef _Nullable path,
    const CGAffineTransform * _Nullable m,
    const CGRect * _Nullable rects,
    size_t count
);