What's New / Graphics & Metal

What's new in CoreGraphics

+12 NewiOS · macOS · tvOS · watchOS

CoreGraphics is Apple's 2D drawing and imaging C API. It covers paths, colors, color spaces, images, and the Quartz coordinate system.

The 27 SDK adds 12 APIs, with no deprecations or removals. The additions are Codable conformance for CGColor and CGColorSpace, including nested CodingKeys enums and their RawValue types on both.

New

12
extension

CGColor

NewiOSmacOStvOSwatchOS
extension CGColor : Codable
Declaration
extension CGColor : Codable {

    public enum CodingKeys : String, CodingKey {

        case space

        case contentHeadroom

        case components

        /// Creates a new instance with the specified raw value.
        ///
        /// If there is no value of the type that corresponds with the specified raw
        /// value, this initializer returns `nil`. For example:
        ///
        ///     enum PaperSize: String {
        ///         case A4, A5, Letter, Legal
        ///     }
        ///
        ///     print(PaperSize(rawValue: "Legal"))
        ///     // Prints "Optional(PaperSize.Legal)"
        ///
        ///     print(PaperSize(rawValue: "Tabloid"))
        ///     // Prints "nil"
        ///
        /// - Parameter rawValue: The raw value to use for the new instance.
        public init?(rawValue: String)

        /// Creates a new instance from the given string.
        ///
        /// If the string passed as `stringValue` does not correspond to any instance
        /// of this type, the result is `nil`.
        ///
        /// - parameter stringValue: The string value of the desired key.
        public init?(stringValue: String)

        /// Creates a new instance from the specified integer.
        ///
        /// If the value passed as `intValue` does not correspond to any instance of
        /// this type, the result is `nil`.
        ///
        /// - parameter intValue: The integer value of the desired key.
        public init?(intValue: Int)

        /// The raw type that can be used to represent all values of the conforming
        /// type.
        ///
        /// Every distinct value of the conforming type has a corresponding unique
        /// value of the `RawValue` type, but there may be values of the `RawValue`
        /// type that don't have a corresponding value of the conforming type.
        @available(macOS 27.0, iOS 27.0, tvOS 27.0, watchOS 27.0, *)
        public typealias RawValue = String

        /// The value to use in an integer-indexed collection (e.g. an int-keyed
        /// dictionary).
        public var intValue: Int? { get }

        /// The corresponding value of the raw type.
        ///
        /// A new instance initialized with `rawValue` will be equivalent to this
        /// instance. For example:
        ///
        ///     enum PaperSize: String {
        ///         case A4, A5, Letter, Legal
        ///     }
        ///
        ///     let selectedSize = PaperSize.Letter
        ///     print(selectedSize.rawValue)
        ///     // Prints "Letter"
        ///
        ///     print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
        ///     // Prints "true"
        public var rawValue: String { get }

        /// The string to use in a named collection (e.g. a string-keyed dictionary).
        public var stringValue: String { get }
    }
}
extension

CGColor.CodingKeys

NewiOSmacOStvOSwatchOS
extension CGColor.CodingKeys : Equatable
Declaration
extension CGColor.CodingKeys : Equatable {
}
extension

CGColor.CodingKeys

NewiOSmacOStvOSwatchOS
extension CGColor.CodingKeys : Hashable
Declaration
extension CGColor.CodingKeys : Hashable {
}
extension

CGColor.CodingKeys

NewiOSmacOStvOSwatchOS
extension CGColor.CodingKeys : RawRepresentable
Declaration
extension CGColor.CodingKeys : RawRepresentable {
}
extension

CGColorSpace

NewiOSmacOStvOSwatchOS
extension CGColorSpace : Codable
Declaration
extension CGColorSpace : Codable {

    public enum CodingKeys : String, CodingKey {

        case iccData

        case extendedRange

        case indexedBaseColorSpace

        case lastIndex

        case indexedColorTable

        /// Creates a new instance with the specified raw value.
        ///
        /// If there is no value of the type that corresponds with the specified raw
        /// value, this initializer returns `nil`. For example:
        ///
        ///     enum PaperSize: String {
        ///         case A4, A5, Letter, Legal
        ///     }
        ///
        ///     print(PaperSize(rawValue: "Legal"))
        ///     // Prints "Optional(PaperSize.Legal)"
        ///
        ///     print(PaperSize(rawValue: "Tabloid"))
        ///     // Prints "nil"
        ///
        /// - Parameter rawValue: The raw value to use for the new instance.
        public init?(rawValue: String)

        /// Creates a new instance from the given string.
        ///
        /// If the string passed as `stringValue` does not correspond to any instance
        /// of this type, the result is `nil`.
        ///
        /// - parameter stringValue: The string value of the desired key.
        public init?(stringValue: String)

        /// Creates a new instance from the specified integer.
        ///
        /// If the value passed as `intValue` does not correspond to any instance of
        /// this type, the result is `nil`.
        ///
        /// - parameter intValue: The integer value of the desired key.
        public init?(intValue: Int)

        /// The raw type that can be used to represent all values of the conforming
        /// type.
        ///
        /// Every distinct value of the conforming type has a corresponding unique
        /// value of the `RawValue` type, but there may be values of the `RawValue`
        /// type that don't have a corresponding value of the conforming type.
        @available(macOS 27.0, iOS 27.0, tvOS 27.0, watchOS 27.0, *)
        public typealias RawValue = String

        /// The value to use in an integer-indexed collection (e.g. an int-keyed
        /// dictionary).
        public var intValue: Int? { get }

        /// The corresponding value of the raw type.
        ///
        /// A new instance initialized with `rawValue` will be equivalent to this
        /// instance. For example:
        ///
        ///     enum PaperSize: String {
        ///         case A4, A5, Letter, Legal
        ///     }
        ///
        ///     let selectedSize = PaperSize.Letter
        ///     print(selectedSize.rawValue)
        ///     // Prints "Letter"
        ///
        ///     print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
        ///     // Prints "true"
        public var rawValue: String { get }

        /// The string to use in a named collection (e.g. a string-keyed dictionary).
        public var stringValue: String { get }

Truncated.

extension

CGColorSpace.CodingKeys

NewiOSmacOStvOSwatchOS
extension CGColorSpace.CodingKeys : Equatable
Declaration
extension CGColorSpace.CodingKeys : Equatable {
}
extension

CGColorSpace.CodingKeys

NewiOSmacOStvOSwatchOS
extension CGColorSpace.CodingKeys : Hashable
Declaration
extension CGColorSpace.CodingKeys : Hashable {
}
extension

CGColorSpace.CodingKeys

NewiOSmacOStvOSwatchOS
extension CGColorSpace.CodingKeys : RawRepresentable
Declaration
extension CGColorSpace.CodingKeys : RawRepresentable {
}
extension

CGInterpolationQuality

NewiOSmacOStvOSwatchOS
extension CGInterpolationQuality : Codable
Declaration
extension CGInterpolationQuality : Codable {
}
extension

CGInterpolationQuality

NewiOSmacOStvOSwatchOS
extension CGInterpolationQuality : CustomDebugStringConvertible
Declaration
extension CGInterpolationQuality : CustomDebugStringConvertible {

    /// A textual representation of this instance, suitable for debugging.
    ///
    /// Calling this property directly is discouraged. Instead, convert an
    /// instance of any type to a string by using the `String(reflecting:)`
    /// initializer. This initializer works with any type, and uses the custom
    /// `debugDescription` property for types that conform to
    /// `CustomDebugStringConvertible`:
    ///
    ///     struct Point: CustomDebugStringConvertible {
    ///         let x: Int, y: Int
    ///
    ///         var debugDescription: String {
    ///             return "(\(x), \(y))"
    ///         }
    ///     }
    ///
    ///     let p = Point(x: 21, y: 30)
    ///     let s = String(reflecting: p)
    ///     print(s)
    ///     // Prints "(21, 30)"
    ///
    /// The conversion of `p` to a string in the assignment to `s` uses the
    /// `Point` type's `debugDescription` property.
    public var debugDescription: String { get }
}
typealias

CGColor.CodingKeys.RawValue

NewiOSmacOStvOSwatchOS
public typealias RawValue = String

The raw type that can be used to represent all values of the conforming type.

Every distinct value of the conforming type has a corresponding unique value of the RawValue type, but there may be values of the RawValue type that don't have a corresponding value of the conforming type.

typealias

CGColorSpace.CodingKeys.RawValue

NewiOSmacOStvOSwatchOS
public typealias RawValue = String

The raw type that can be used to represent all values of the conforming type.

Every distinct value of the conforming type has a corresponding unique value of the RawValue type, but there may be values of the RawValue type that don't have a corresponding value of the conforming type.

No APIs match your filter.

← More in Graphics & Metal