-
Notifications
You must be signed in to change notification settings - Fork 571
PencilKit macOS xcode27.0 b1
Alex Soto edited this page Jun 9, 2026
·
1 revision
#PencilKit.framework
diff -ruN /Applications/Xcode_26.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PKContentVersion.h /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PKContentVersion.h
--- /Applications/Xcode_26.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PKContentVersion.h 2026-04-19 03:03:15
+++ /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PKContentVersion.h 2026-06-04 00:09:28
@@ -2,31 +2,31 @@
// PKContentVersion.h
// PencilKit
//
-// Copyright © 2023 Apple. All rights reserved.
+// Copyright © 2023-2026 Apple Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
-
-/// A version specifying which PencilKit features are used/allowed.
+/// A version that specifies which PencilKit features a drawing uses or requires.
API_AVAILABLE(ios(17.0), macos(14.0))
NS_SWIFT_SENDABLE
typedef NS_ENUM(NSInteger, PKContentVersion) {
- /// Version for inks introduced in iOS 14.0.
- ///
- /// Inks included are Pen, Pencil, and Marker.
+
+ /// The version for inks introduced in iOS 14, including Pen, Pencil, and Marker.
PKContentVersion1 NS_SWIFT_NAME(version1) = 1,
- /// Version for inks introduced in iOS 17.0.
- ///
- /// Inks included are Pen, Pencil, Marker, Monoline, Fountain Pen, Watercolor, and Crayon.
+
+ /// The version for inks introduced in iOS 17, adding Monoline, Fountain Pen, Watercolor, and Crayon.
PKContentVersion2 NS_SWIFT_NAME(version2),
-
- /// New Fountain Pen
+
+ /// The version that includes the updated Fountain Pen ink.
PKContentVersion3 NS_SWIFT_NAME(version3) API_AVAILABLE(ios(17.5), macos(14.5)),
-
- /// New Reed Pen
+
+ /// The version that adds the Reed Pen ink.
PKContentVersion4 NS_SWIFT_NAME(version4) API_AVAILABLE(ios(26.0), macos(26.0), visionos(26.0)),
- /// The latest version including all features.
- PKContentVersionLatest = 4
+ /// The version that adds stroke render state support.
+ PKContentVersion5 NS_SWIFT_NAME(version5) API_AVAILABLE(ios(27.0), macos(27.0), visionos(27.0)),
+
+ /// The latest version, which includes all available PencilKit features.
+ PKContentVersionLatest = 5
};
diff -ruN /Applications/Xcode_26.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PKDrawing.h /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PKDrawing.h
--- /Applications/Xcode_26.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PKDrawing.h 2026-04-19 03:03:15
+++ /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PKDrawing.h 2026-06-04 00:22:17
@@ -19,55 +19,57 @@
#ifdef __cplusplus
extern "C" {
#endif
-/// The UTType for storing drawing data.
+/// The UTType identifier for PencilKit drawing data.
extern const CFStringRef PKAppleDrawingTypeIdentifier API_AVAILABLE(ios(13.0), macos(10.15));
#ifdef __cplusplus
}
#endif
-@class PKStroke;
+@class PKStroke, PKStrokePath;
-/// The data model object for storing drawing data created from PKCanvasView.
+/// The data model for a drawing that a `PKCanvasView` displays.
API_AVAILABLE(ios(13.0), macos(10.15))
NS_SWIFT_SENDABLE
@interface PKDrawing : NSObject <NSCopying, NSSecureCoding>
-/// Initializes and returns a blank drawing.
+/// Creates a blank drawing.
- (instancetype)init NS_DESIGNATED_INITIALIZER;
-/// Initializes a drawing with an array of strokes.
+/// Creates a drawing with the specified strokes.
+///
+/// When setting strokes, duplicate IDs are automatically resolved by generating
+/// new UUIDs for conflicting strokes. The first occurrence keeps its original ID.
- (instancetype)initWithStrokes:(NSArray<PKStroke *> *)strokes API_AVAILABLE(ios(14.0), macos(11.0));
-/// Initializes and returns the drawing with the specified data.
+/// Creates a drawing from the specified encoded data.
///
-/// @param data The data containing the drawing data.
-/// @param error If an error occurs, upon return the NSError object describes the error.
-/// Set to NULL to ignore errors.
-/// @return On success, an initialized PKDrawing object. If nil, the outError parameter
-/// contains an NSError instance describing the problem.
+/// @param data The data containing the encoded drawing.
+/// @param error If an error occurs, upon return the `NSError` object describes the error.
+/// Pass `NULL` to ignore errors.
+/// @return An initialized `PKDrawing` object on success, or `nil` if the data is invalid.
- (nullable instancetype)initWithData:(NSData *)data error:(NSError * _Nullable *)error NS_DESIGNATED_INITIALIZER;
-/// Generate a data representation of the drawing.
+/// Returns a data representation of the drawing.
///
-/// @return A NSData object containing a representation of the drawing.
+/// @return An `NSData` object containing the drawing data.
- (NSData *)dataRepresentation;
-/// The strokes that this drawing contains.
+/// The strokes the drawing contains.
@property (nonatomic, readonly) NSArray<PKStroke *> *strokes API_AVAILABLE(ios(14.0), macos(11.0));
-/// The bounds of the drawing's contents, taking into account the rendered width of all content.
-/// If these bounds are used to render an image with `imageFromRect:scale:`, no contents will be cropped.
+/// The bounds of the drawing's contents, accounting for the rendered width of all strokes.
+///
+/// Passing these bounds to `imageFromRect:scale:` produces an image that includes all content without cropping.
@property (nonatomic, readonly) CGRect bounds;
/// The PencilKit version required to use this drawing.
@property (nonatomic, readonly) PKContentVersion requiredContentVersion API_AVAILABLE(ios(17.0), macos(14.0));
-/// Renders the drawing to an image.
+/// Returns a non-opaque image of the drawing rendered from the specified rectangle at the given scale.
///
/// @param rect The rect in the drawing to render.
-/// @param scale The scale of image to render. If you specify a value of 0.0, the scale factor is set to the
-/// scale factor of the device’s main screen.
+/// @param scale The scale of image to render. Specify `0.0` to use the scale factor of the device’s main screen.
/// @return A non-opaque image of this drawing with pixel dimensions `rect.size * scale`.
#if TARGET_OS_IPHONE
- (UIImage *)imageFromRect:(CGRect)rect scale:(CGFloat)scale;
@@ -75,24 +77,39 @@
- (NSImage *)imageFromRect:(CGRect)rect scale:(CGFloat)scale;
#endif
-/// Returns a new drawing with `transform` applied.
+/// Returns a new drawing with the specified transform applied.
///
/// @param transform The transform to apply to this drawing.
/// @return A new copy of this drawing with `transform` applied.
- (PKDrawing *)drawingByApplyingTransform:(CGAffineTransform)transform;
-/// Returns a new drawing by appending the contents of `drawing` on top of the receiver’s contents.
+/// Returns a new drawing by appending the contents of the specified drawing on top of the receiver's contents.
///
/// @param drawing The drawing to append.
-/// @return A new copy of this drawing with `drawing` appended onto it.
+/// @return A new copy of this drawing with `drawing` appended.
+///
+/// The combined array of strokes is uniqued by `strokeID`.
- (PKDrawing *)drawingByAppendingDrawing:(PKDrawing *)drawing;
-/// Create a new drawing by appending an array of strokes to this drawing.
-/// This is a convenience method, to quickly add strokes to a drawing.
+/// Returns a new drawing with the specified strokes appended.
///
/// @param strokes The strokes to append.
-/// @return A new copy of this drawing with `strokes` appended onto it.
+/// @return A new copy of this drawing with `strokes` appended.
+///
+/// The combined array of strokes is uniqued by `strokeID`.
- (PKDrawing *)drawingByAppendingStrokes:(NSArray<PKStroke *> *)strokes API_AVAILABLE(ios(14.0), macos(11.0));
+
+/// Returns a new drawing with strokes erased along the specified stroke path.
+///
+/// @param eraserPath The path to erase through this drawing.
+/// @param mask An optional mask to constrain the eraser’s effect to a specific region.
+/// @param transform The transform to apply to the path being erased.
+/// @return A new copy of this drawing with strokes erased by the path.
+#if TARGET_OS_IPHONE
+- (PKDrawing *)drawingByErasingStrokePath:(PKStrokePath *)eraserPath mask:(nullable UIBezierPath *)mask transform:(CGAffineTransform)transform API_AVAILABLE(ios(27.0), visionos(27.0));
+#else
+- (PKDrawing *)drawingByErasingStrokePath:(PKStrokePath *)eraserPath mask:(nullable NSBezierPath *)mask transform:(CGAffineTransform)transform API_AVAILABLE(macos(27.0));
+#endif
@end
diff -ruN /Applications/Xcode_26.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PKStroke.h /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PKStroke.h
--- /Applications/Xcode_26.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PKStroke.h 2026-04-19 03:03:15
+++ /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PKStroke.h 2026-05-29 00:45:48
@@ -2,7 +2,7 @@
// PKStroke.h
// PencilKit
//
-// Copyright © 2023 Apple Inc. All rights reserved.
+// Copyright © 2020-2026 Apple Inc. All rights reserved.
//
#import <PencilKit/PKContentVersion.h>
@@ -13,7 +13,7 @@
#import <Cocoa/Cocoa.h>
#endif
-@class PKInk, PKStrokePath, PKFloatRange;
+@class PKInk, PKStrokePath, PKFloatRange, PKStrokeRenderState;
NS_ASSUME_NONNULL_BEGIN
@@ -22,62 +22,129 @@
NS_SWIFT_SENDABLE
@interface PKStroke : NSObject <NSCopying>
-/// Create a new stroke.
+/// Creates a stroke with the specified ink, path, transform, and mask.
///
/// @param ink The ink for the stroke.
-/// @param strokePath The B-spine stroke path for the stroke.
+/// @param strokePath The B-spline stroke path for the stroke.
/// @param transform The affine transform of the stroke.
/// @param mask The mask for the stroke.
#if TARGET_OS_IPHONE
-- (instancetype)initWithInk:(PKInk *)ink strokePath:(PKStrokePath *)strokePath transform:(CGAffineTransform)transform mask:(nullable UIBezierPath *)mask;
+- (instancetype)initWithInk:(PKInk *)ink
+ strokePath:(PKStrokePath *)strokePath
+ transform:(CGAffineTransform)transform
+ mask:(nullable UIBezierPath *)mask;
#else
-- (instancetype)initWithInk:(PKInk *)ink strokePath:(PKStrokePath *)strokePath transform:(CGAffineTransform)transform mask:(nullable NSBezierPath *)mask;
+- (instancetype)initWithInk:(PKInk *)ink
+ strokePath:(PKStrokePath *)strokePath
+ transform:(CGAffineTransform)transform
+ mask:(nullable NSBezierPath *)mask;
#endif
-/// Create a new stroke.
+/// Creates a stroke with the specified ink, path, transform, mask, and random seed.
///
/// @param ink The ink for the stroke.
-/// @param strokePath The B-spine stroke path for the stroke.
+/// @param strokePath The B-spline stroke path for the stroke.
/// @param transform The affine transform of the stroke.
/// @param mask The mask for the stroke.
/// @param randomSeed The random seed for the stroke.
#if TARGET_OS_IPHONE
-- (instancetype)initWithInk:(PKInk *)ink strokePath:(PKStrokePath *)strokePath transform:(CGAffineTransform)transform mask:(nullable UIBezierPath *)mask randomSeed:(uint32_t)randomSeed API_AVAILABLE(ios(16.0), macos(13.0));
+- (instancetype)initWithInk:(PKInk *)ink
+ strokePath:(PKStrokePath *)strokePath
+ transform:(CGAffineTransform)transform
+ mask:(nullable UIBezierPath *)mask
+ randomSeed:(uint32_t)randomSeed API_AVAILABLE(ios(16.0), macos(13.0));
#else
-- (instancetype)initWithInk:(PKInk *)ink strokePath:(PKStrokePath *)strokePath transform:(CGAffineTransform)transform mask:(nullable NSBezierPath *)mask randomSeed:(uint32_t)randomSeed API_AVAILABLE(ios(16.0), macos(13.0));
+- (instancetype)initWithInk:(PKInk *)ink
+ strokePath:(PKStrokePath *)strokePath
+ transform:(CGAffineTransform)transform
+ mask:(nullable NSBezierPath *)mask
+ randomSeed:(uint32_t)randomSeed API_AVAILABLE(ios(16.0), macos(13.0));
#endif
+/// Creates a stroke with the specified ink, path, transform, mask, random seed, ID, render group, and render state.
+///
+/// @param ink The ink for the stroke.
+/// @param strokePath The B-spline stroke path for the stroke.
+/// @param transform The affine transform of the stroke.
+/// @param mask The mask for the stroke.
+/// @param randomSeed The random seed for the stroke.
+/// @param strokeID The unique identity of the stroke.
+/// @param renderGroupID See this property for more information.
+/// @param renderState See this property for more information.
+#if TARGET_OS_IPHONE
+- (instancetype)initWithInk:(PKInk *)ink
+ strokePath:(PKStrokePath *)strokePath
+ transform:(CGAffineTransform)transform
+ mask:(nullable UIBezierPath *)mask
+ randomSeed:(uint32_t)randomSeed
+ strokeID:(NSUUID *)strokeID
+ renderGroupID:(nullable NSUUID *)renderGroupID
+ renderState:(nullable PKStrokeRenderState *)renderState
+ NS_SWIFT_NAME(init(ink:strokePath:transform:mask:randomSeed:strokeID:renderGroupID:renderState:))
+ API_AVAILABLE(ios(27.0), macos(27.0), visionos(27.0));
+#else
+- (instancetype)initWithInk:(PKInk *)ink
+ strokePath:(PKStrokePath *)strokePath
+ transform:(CGAffineTransform)transform
+ mask:(nullable NSBezierPath *)mask
+ randomSeed:(uint32_t)randomSeed
+ strokeID:(NSUUID *)strokeID
+ renderGroupID:(nullable NSUUID *)renderGroupID
+ renderState:(nullable PKStrokeRenderState *)renderState
+ NS_SWIFT_NAME(init(ink:strokePath:transform:mask:randomSeed:strokeID:renderGroupID:renderState:))
+ API_AVAILABLE(ios(27.0), macos(27.0), visionos(27.0));
+#endif
+
+/// The PencilKit version required to use this stroke.
+@property (nonatomic, readonly) PKContentVersion requiredContentVersion API_AVAILABLE(ios(17.0), macos(14.0));
+
/// The ink used to render this stroke.
@property (nonatomic, readonly) PKInk *ink;
+/// The unique identity of the stroke.
+@property (nonatomic, readonly) NSUUID *strokeID API_AVAILABLE(ios(27.0), macos(27.0), visionos(27.0));
+
/// The affine transform of the stroke when rendered.
@property (nonatomic, readonly) CGAffineTransform transform;
/// The B-spline path that describes this stroke.
@property (nonatomic, readonly) PKStrokePath *path;
-/// The mask pre-transform that is used to clip the
-/// rendering of the stroke.
+/// The pre-transform mask that clips the stroke rendering, set by tools such as the bitmap eraser or ruler.
#if TARGET_OS_IPHONE
@property (nonatomic, readonly, nullable) UIBezierPath *mask;
#else
@property (nonatomic, readonly, nullable) NSBezierPath *mask;
#endif
-/// The bounds of the rendered stroke.
-/// This includes the width & ink of the stroke after the transform
-/// is applied.
+/// The bounds of the rendered stroke, including its width and ink after the transform is applied.
@property (nonatomic, readonly) CGRect renderBounds;
-/// These are the parametric parameter ranges of points in `strokePath`
-/// that intersect the stroke's mask.
+/// The parametric ranges of points in the stroke path that intersect the mask.
@property (nonatomic, readonly) NSArray<PKFloatRange *> *maskedPathRanges;
/// The random seed for drawing strokes that use randomized effects.
@property (nonatomic, readonly) uint32_t randomSeed API_AVAILABLE(ios(16.0), macos(13.0));
-/// The PencilKit version required to use this stroke.
-@property (nonatomic, readonly) PKContentVersion requiredContentVersion API_AVAILABLE(ios(17.0), macos(14.0));
+/// A UUID that groups strokes for wet-ink compositing with compatible inks such as marker.
+///
+/// Set this to the same value for a run of strokes to render them as if drawn while the previous
+/// stroke with the same ink was still wet.
+@property (nonatomic, readonly, nullable) NSUUID *renderGroupID API_AVAILABLE(ios(27.0), macos(27.0), visionos(27.0));
+
+/// The render details of the stroke, such as particle positioning. Uses default rendering when nil.
+///
+/// This may be set on substrokes returned by `-substrokeWithRange:`.
+@property (nonatomic, readonly, nullable) PKStrokeRenderState *renderState API_AVAILABLE(ios(27.0), macos(27.0), visionos(27.0));
+
+/// Returns a copy of the stroke containing the control points in the specified range.
+///
+/// Maintains rendering information so the returned substroke renders the same as the corresponding
+/// portion of the receiver. The returned stroke may have a `renderState` set to maintain this information.
+///
+/// @param range The range of control points in the receiver to copy to the returned stroke.
+/// @returns A new stroke containing only the control points within the specified range.
+- (PKStroke *)substrokeWithRange:(PKFloatRange *)range API_AVAILABLE(ios(27.0), macos(27.0), visionos(27.0));
@end
diff -ruN /Applications/Xcode_26.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PKStrokePath.h /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PKStrokePath.h
--- /Applications/Xcode_26.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PKStrokePath.h 2026-04-19 01:02:13
+++ /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PKStrokePath.h 2026-05-23 03:15:17
@@ -2,7 +2,7 @@
// PKStrokePath.h
// PencilKit
//
-// Copyright © 2020 Apple Inc. All rights reserved.
+// Copyright © 2020-2026 Apple Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
@@ -12,77 +12,155 @@
@class PKStrokePoint;
+/// Information about a B-spline control point converted from a Bézier path.
+///
+/// Provided to the `pointProvider` closure of ``PKStrokePath-class/initWithBezierPath:creationDate:pointProvider:``
+/// to initialize each ``PKStrokePoint-class`` of the resulting path.
+API_AVAILABLE(ios(27.0), macos(27.0), visionos(27.0))
+NS_SWIFT_NAME(PKConvertedBezierPointReference)
+@interface PKConvertedBezierPoint : NSObject
+
+/// The index of the point along the path.
+@property (nonatomic, readonly, assign) NSInteger index;
+
+/// The total number of B-Spline control points in the path.
+@property (nonatomic, readonly, assign) NSInteger pointCount;
+
+/// The location of the cubic uniform B-Spline control point.
+@property (nonatomic, readonly, assign) CGPoint location;
+
+/// The index of the Bézier segment the point originates from, not including `move to` elements.
+@property (nonatomic, readonly, assign) NSInteger bezierSegmentIndex;
+
+- (instancetype)init NS_UNAVAILABLE;
+
+@end
+
/// A uniform cubic B-spline representing the point data of a `PKStroke`.
API_AVAILABLE(ios(14.0), macos(11.0))
NS_SWIFT_SENDABLE
@interface PKStrokePath : NSObject <NSCopying>
-/// Create a stroke path value with the given cubic B-spline control points.
+/// Creates a stroke path with the specified cubic B-spline control points.
///
/// @param controlPoints An array of control points for a cubic B-spline.
/// @param creationDate The start time of this path.
- (instancetype)initWithControlPoints:(NSArray<PKStrokePoint *> *)controlPoints creationDate:(NSDate *)creationDate NS_DESIGNATED_INITIALIZER;
-/// The number of control points in this stroke path.
+/// Creates a stroke path with the specified control points and a unique identifier.
+///
+/// @param controlPoints An array of control points for a cubic B-spline.
+/// @param creationDate The start time of this path.
+/// @param strokePathID The unique identity of the stroke path.
+///
+/// > Warning: Using multiple stroke paths with identical IDs but different control points
+/// will result in undefined rendering behavior. Ensure each stroke path has a unique identifier.
+- (instancetype)initWithControlPoints:(NSArray<PKStrokePoint *> *)controlPoints creationDate:(NSDate *)creationDate strokePathID:(NSUUID *)strokePathID API_AVAILABLE(ios(27.0), macos(27.0), visionos(27.0));
+
+/// Creates a stroke path recreating the specified Bézier path as a cubic uniform B-Spline.
+///
+/// @param bezierPath The Bézier path to convert to a cubic uniform B-Spline.
+/// @param creationDate The start time of this path.
+/// @param pointProvider Block to initialize the `PKStrokePoint`s of the path. A single `PKConvertedBezierPoint` instance is shared across all converted points.
+///
+/// The count of control points of the generated spline is not guaranteed to be a specific value
+/// except when the provided path is the output of ``bezierRepresentation->CGPathRef``, where it will match the original curve.
+///
+/// The output B-Spline will have continuous curvature and 0 curvature at the endpoints. In cases where the B-Spline
+/// cannot fully recreate the Bézier path, it will be an approximation. For example, if the given Bézier path includes
+/// `line to` elements, these will produce straight line segments in the resulting B-Spline, but if a `line to` element
+/// is adjacent to a `curve to` element, the resulting curve may not match the original.
+///
+/// > Warning: For a Bézier path with multiple subpaths, only the first will be converted.
+- (instancetype)initWithBezierPath:(CGPathRef)bezierPath creationDate:(NSDate *)creationDate pointProvider:(PKStrokePoint *(NS_NOESCAPE ^)(PKConvertedBezierPoint *convertedPoint))pointProvider API_AVAILABLE(ios(27.0), macos(27.0), visionos(27.0));
+
+/// The unique identity of the stroke path.
+///
+/// > Warning: Using multiple stroke paths with identical IDs but different control points
+/// will result in undefined rendering behavior. Ensure each stroke path has a unique identifier.
+@property (nonatomic, readonly) NSUUID *strokePathID API_AVAILABLE(ios(27.0), macos(27.0), visionos(27.0));
+
+/// The number of control points in the stroke path.
@property (nonatomic, readonly) NSUInteger count;
-/// The time at which this stroke path was started.
-/// The `timeOffset` of contained PKStrokePoints is relative to this date.
+/// The time at which the stroke path started.
+///
+/// The `timeOffset` of each contained `PKStrokePoint` is relative to this date.
@property (nonatomic, readonly) NSDate *creationDate;
-/// Returns B-spline control point at index `i`.
+/// A Bézier path representation of the path's curve, computed in linear time.
+@property (nonatomic, readonly) CGPathRef bezierRepresentation API_AVAILABLE(ios(27.0), macos(27.0), visionos(27.0));
+
+/// Returns a copy of the path containing the control points in the specified parametric range.
+///
+/// @param range The parametric range to copy. Values must be within [0, count-1].
+/// @return A new stroke path containing the portion within the specified parametric range.
+- (PKStrokePath *)subpathWithRange:(PKFloatRange *)range API_AVAILABLE(ios(27.0), macos(27.0), visionos(27.0));
+
+/// Returns the B-spline control point at the specified index.
- (PKStrokePoint *)pointAtIndex:(NSUInteger)i;
-/// Returns B-spline control point at index `i`.
+/// Returns the B-spline control point at the specified index.
- (PKStrokePoint *)objectAtIndexedSubscript:(NSUInteger)i;
-/// The on-curve location for the floating point [0, count-1] `parametricValue` parameter.
+/// Returns the on-curve location for the specified parametric value.
///
+/// The floating-point `parametricValue` must be in the range [0, count-1].
+///
/// This has better performance than `[self interpolatedPointAt: parametricValue].location`
-/// for when only the location is required.
+/// when only the location is required.
- (CGPoint)interpolatedLocationAt:(CGFloat)parametricValue;
-/// The on-curve point for the floating point [0, count-1] `parametricValue` parameter.
+/// Returns the on-curve stroke point for the specified parametric value.
- (PKStrokePoint *)interpolatedPointAt:(CGFloat)parametricValue;
-/// Executes a given block using each point in a range with a distance step.
+/// Executes a block for each interpolated point in the specified range, stepping by distance.
///
/// @param range The parametric range to enumerate points in.
/// @param distanceStep The distance to step between points.
-/// @param block The block to execute for each point. This block takes two parameters
-/// point The interpolated point on the spline.
-/// stop A reference to a Boolean value. Setting the value to YES within the block stops further enumeration of the array. If a block stops further enumeration, that block continues to run until it’s finished.
-- (void)enumerateInterpolatedPointsInRange:(PKFloatRange *)range strideByDistance:(CGFloat)distanceStep usingBlock:(void (^)(PKStrokePoint *point, BOOL *stop))block;
+/// @param block The block to execute for each point. The block receives the interpolated point
+/// and a stop flag; set the flag to `YES` to stop enumeration.
+- (void)enumerateInterpolatedPointsInRange:(PKFloatRange *)range strideByDistance:(CGFloat)distanceStep usingBlock:(void (^)(PKStrokePoint *point, BOOL *stop))block
+#if __swift__
+API_DEPRECATED("Use `PKStrokePath.interpolatedPoints(in:by:)`", ios(14.0, API_TO_BE_DEPRECATED), macos(11.0, API_TO_BE_DEPRECATED))
+#endif
+;
-/// Executes a given block using each point in a range with a time step.
+/// Executes a block for each interpolated point in the specified range, stepping by time interval.
///
/// @param range The parametric range to enumerate points in.
/// @param timeStep The time interval to step between points.
-/// @param block The block to execute for each point. This block takes two parameters
-/// point The interpolated point on the spline.
-/// stop A reference to a Boolean value. Setting the value to YES within the block stops further enumeration of the array. If a block stops further enumeration, that block continues to run until it’s finished.
-- (void)enumerateInterpolatedPointsInRange:(PKFloatRange *)range strideByTime:(NSTimeInterval)timeStep usingBlock:(void (^)(PKStrokePoint *point, BOOL *stop))block;
+/// @param block The block to execute for each point. The block receives the interpolated point
+/// and a stop flag; set the flag to `YES` to stop enumeration.
+- (void)enumerateInterpolatedPointsInRange:(PKFloatRange *)range strideByTime:(NSTimeInterval)timeStep usingBlock:(void (^)(PKStrokePoint *point, BOOL *stop))block
+#if __swift__
+API_DEPRECATED("Use `PKStrokePath.interpolatedPoints(in:by:)`", ios(14.0, API_TO_BE_DEPRECATED), macos(11.0, API_TO_BE_DEPRECATED))
+#endif
+;
-/// Executes a given block using each point in a range with a parametric step.
+/// Executes a block for each interpolated point in the specified range, stepping by a parametric step.
///
/// @param range The parametric range to enumerate points in.
/// @param parametricStep The parametric step between points.
-/// @param block The block to execute for each point. This block takes two parameters
-/// point The interpolated point on the spline.
-/// stop A reference to a Boolean value. Setting the value to YES within the block stops further enumeration of the array. If a block stops further enumeration, that block continues to run until it’s finished.
-- (void)enumerateInterpolatedPointsInRange:(PKFloatRange *)range strideByParametricStep:(CGFloat)parametricStep usingBlock:(void (^)(PKStrokePoint *point, BOOL *stop))block;
+/// @param block The block to execute for each point. The block receives the interpolated point
+/// and a stop flag; set the flag to `YES` to stop enumeration.
+- (void)enumerateInterpolatedPointsInRange:(PKFloatRange *)range strideByParametricStep:(CGFloat)parametricStep usingBlock:(void (^)(PKStrokePoint *point, BOOL *stop))block
+#if __swift__
+API_DEPRECATED("Use `PKStrokePath.interpolatedPoints(in:by:)`", ios(14.0, API_TO_BE_DEPRECATED), macos(11.0, API_TO_BE_DEPRECATED))
+#endif
+;
/// Returns a parametric value on the B-spline that is a specified distance from the given parametric value.
///
/// @param parametricValue The floating point [0, count-1] parametric value.
-/// @param distanceStep The distance to offset `parametricValue`. `distanceStep` can be positive or negative.
+/// @param distanceStep The distance to offset `parametricValue`. Can be positive or negative.
/// @return A parametric value offset by `distanceStep` from `parametricValue`.
- (CGFloat)parametricValue:(CGFloat)parametricValue offsetByDistance:(CGFloat)distanceStep;
/// Returns a parametric value on the B-spline that is a specified time from the given parametric value.
///
/// @param parametricValue The floating point [0, count-1] parametric value.
-/// @param timeStep The time to offset `parametricValue`. `timeStep` can be positive or negative.
+/// @param timeStep The time to offset `parametricValue`. Can be positive or negative.
/// @return A parametric value offset by `timeStep` from `parametricValue`.
- (CGFloat)parametricValue:(CGFloat)parametricValue offsetByTime:(NSTimeInterval)timeStep;
diff -ruN /Applications/Xcode_26.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PKStrokePoint.h /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PKStrokePoint.h
--- /Applications/Xcode_26.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PKStrokePoint.h 2026-04-19 03:03:15
+++ /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PKStrokePoint.h 2026-05-23 03:15:17
@@ -2,57 +2,100 @@
// PKStrokePoint.h
// PencilKit
//
-// Copyright © 2020 Apple Inc. All rights reserved.
+// Copyright © 2020-2026 Apple Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
-/// A point value stores all the attributes of a PKStroke at a specific point.
-/// `PKStrokePoint` stores its properties compressed, the value read for a property may not
-/// exactly equal the value set for a property.
+/// A value that stores all attributes of a stroke at a specific point.
+///
+/// Properties are stored in a compressed format, so the value you read back may not exactly equal the value you set.
API_AVAILABLE(ios(14.0), macos(11.0))
NS_SWIFT_SENDABLE
@interface PKStrokePoint : NSObject <NSCopying>
- (instancetype)init NS_UNAVAILABLE;
-/// Create a new point with the provided properties.
-- (instancetype)initWithLocation:(CGPoint)location timeOffset:(NSTimeInterval)timeOffset size:(CGSize)size opacity:(CGFloat)opacity force:(CGFloat)force azimuth:(CGFloat)azimuth altitude:(CGFloat)altitude NS_DESIGNATED_INITIALIZER;
+/// Creates a stroke point with the specified properties.
+- (instancetype)initWithLocation:(CGPoint)location
+ timeOffset:(NSTimeInterval)timeOffset
+ size:(CGSize)size
+ opacity:(CGFloat)opacity
+ force:(CGFloat)force
+ azimuth:(CGFloat)azimuth
+ altitude:(CGFloat)altitude NS_DESIGNATED_INITIALIZER;
-/// Create a new point with the provided properties.
-- (instancetype)initWithLocation:(CGPoint)location timeOffset:(NSTimeInterval)timeOffset size:(CGSize)size opacity:(CGFloat)opacity force:(CGFloat)force azimuth:(CGFloat)azimuth altitude:(CGFloat)altitude secondaryScale:(CGFloat)secondaryScale NS_DESIGNATED_INITIALIZER;
+/// Creates a stroke point with the specified properties, including secondary scale.
+- (instancetype)initWithLocation:(CGPoint)location
+ timeOffset:(NSTimeInterval)timeOffset
+ size:(CGSize)size
+ opacity:(CGFloat)opacity
+ force:(CGFloat)force
+ azimuth:(CGFloat)azimuth
+ altitude:(CGFloat)altitude
+ secondaryScale:(CGFloat)secondaryScale API_AVAILABLE(ios(17.0), macos(14.0)) NS_DESIGNATED_INITIALIZER;
-/// Create a new point with the provided properties.
-- (instancetype)initWithLocation:(CGPoint)location timeOffset:(NSTimeInterval)timeOffset size:(CGSize)size opacity:(CGFloat)opacity force:(CGFloat)force azimuth:(CGFloat)azimuth altitude:(CGFloat)altitude secondaryScale:(CGFloat)secondaryScale threshold:(CGFloat)threshold NS_DESIGNATED_INITIALIZER;
+/// Creates a stroke point with the specified properties, including a rendering threshold.
+- (instancetype)initWithLocation:(CGPoint)location
+ timeOffset:(NSTimeInterval)timeOffset
+ size:(CGSize)size
+ opacity:(CGFloat)opacity
+ force:(CGFloat)force
+ azimuth:(CGFloat)azimuth
+ altitude:(CGFloat)altitude
+ secondaryScale:(CGFloat)secondaryScale
+ threshold:(CGFloat)threshold API_AVAILABLE(ios(26.0), macos(26.0), visionos(26.0)) NS_DESIGNATED_INITIALIZER;
-/// Location of the point.
+/// Creates a stroke point with the specified properties, including lateral jitter.
+- (instancetype)initWithLocation:(CGPoint)location
+ timeOffset:(NSTimeInterval)timeOffset
+ size:(CGSize)size
+ opacity:(CGFloat)opacity
+ force:(CGFloat)force
+ azimuth:(CGFloat)azimuth
+ altitude:(CGFloat)altitude
+ secondaryScale:(CGFloat)secondaryScale
+ threshold:(CGFloat)threshold
+ lateralJitter:(CGFloat)lateralJitter API_AVAILABLE(ios(27.0), macos(27.0), visionos(27.0)) NS_DESIGNATED_INITIALIZER;
+
+/// The location of the point.
@property (nonatomic, readonly) CGPoint location;
-/// Time offset since the start of the stroke path in seconds.
+
+/// The time offset in seconds from the start of the stroke path.
@property (nonatomic, readonly) NSTimeInterval timeOffset;
-/// Size of the point.
+
+/// The size of the point.
@property (nonatomic, readonly) CGSize size;
-/// Opacity of the point 0-2.
+
+/// The opacity of the point, in the range 0 to 2.
@property (nonatomic, readonly) CGFloat opacity;
-/// Azimuth of the point in radians, 0.0-2π radians
-@property (nonatomic, readonly) CGFloat azimuth;
-/// Force used to create this point.
+/// The force used to create the point.
@property (nonatomic, readonly) CGFloat force;
-/// Altitude used to create this point in radians, 0.0-π/2 radians
+
+/// The azimuth of the point in radians, in the range 0.0 to 2π.
+@property (nonatomic, readonly) CGFloat azimuth;
+
+/// The altitude used to create the point in radians, in the range 0.0 to π/2.
@property (nonatomic, readonly) CGFloat altitude;
-/// The scaling of the point for secondary effects.
+/// The scale factor for secondary rendering effects at this point.
///
-/// For example the scaling of the pigment in the watercolor ink.
+/// For example, this controls the pigment spread in watercolor ink.
@property (nonatomic, readonly) CGFloat secondaryScale API_AVAILABLE(ios(17.0), macos(14.0));
-/// The threshold for clipping the stroke rendering.
+/// The alpha threshold for clipping the stroke rendering for supported inks.
///
-/// When rendering only pixels with an alpha greater than the threshold are drawn. A threshold of 0 has no affect on rendering,
-/// a threshold of 1 does not draw anything. Thresholds are only used for some inks, eg. `PKInkIdentifierReed`.
+/// Only pixels with an alpha greater than the threshold are drawn. A threshold of `0` has no effect
+/// on rendering; a threshold of `1` draws nothing. Thresholds apply only to some inks, such as `PKInkIdentifierReed`.
@property (nonatomic, readonly) CGFloat threshold API_AVAILABLE(ios(26.0), macos(26.0), visionos(26.0));
+
+/// The amount of lateral particle jitter at the stroke edge for supported inks.
+///
+/// Lateral jitter applies only to some inks, such as `PKInkIdentifierPencil`.
+@property (nonatomic, readonly) CGFloat lateralJitter API_AVAILABLE(ios(27.0), macos(27.0), visionos(27.0));
@end
diff -ruN /Applications/Xcode_26.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PKStrokeRenderState.h /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PKStrokeRenderState.h
--- /Applications/Xcode_26.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PKStrokeRenderState.h 1969-12-31 19:00:00
+++ /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PKStrokeRenderState.h 2026-06-04 00:09:28
@@ -0,0 +1,24 @@
+//
+// PKStrokeRenderState.h
+// PencilKit
+//
+// Copyright © 2026 Apple Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/// The render details of a stroke, including particle positioning and grain texture offset.
+///
+/// Some state is exposed, but other state is opaque. Use `NSSecureCoding` to persist all stored information.
+NS_REFINED_FOR_SWIFT
+API_AVAILABLE(ios(27.0), macos(27.0), visionos(27.0))
+@interface PKStrokeRenderState : NSObject <NSCopying, NSSecureCoding>
+
+/// The pre-transform position of the grain texture for strokes with a backing grain texture such as crayon.
+@property (nonatomic, assign) CGPoint grainOffset;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_26.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PencilKit.h /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PencilKit.h
--- /Applications/Xcode_26.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PencilKit.h 2026-04-19 03:03:14
+++ /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/PencilKit.framework/Headers/PencilKit.h 2026-06-04 00:09:28
@@ -2,7 +2,7 @@
// PencilKit.h
// PencilKit
//
-// Copyright © 2020 Apple Inc. All rights reserved.
+// Copyright © 2019-2026 Apple Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
@@ -31,5 +31,6 @@
#import <PencilKit/PKFloatRange.h>
#import <PencilKit/PKStrokePath.h>
#import <PencilKit/PKStrokePoint.h>
+#import <PencilKit/PKStrokeRenderState.h>
#import <PencilKit/PKInk.h>
#import <PencilKit/PKInkType.h>