MLKitDigitalInkRecognition Framework Reference

  • MLKStrokePoint represents a single touch point from the user, containing horizontal (x), vertical (y) coordinates, and optionally, timestamp (t).

  • Coordinates are arbitrary but must use consistent units and origins for a given ink.

  • Timestamp t is measured in milliseconds and represents the time the point was recorded.

  • MLKStrokePoint can be initialized with or without a timestamp, but including a timestamp is recommended for better recognition accuracy.

  • Using init(x:y:t:) is preferred for creating MLKStrokePoint instances, while init() is unavailable.

MLKStrokePoint


@interface MLKStrokePoint : NSObject

A single touch point from the user.

  • x

    Horizontal coordinate. Increases to the right.

    Declaration

    Objective-C

    @property (nonatomic, readonly) float x;
  • y

    Vertical coordinate. Increases downward.

    Declaration

    Objective-C

    @property (nonatomic, readonly) float y;
  • t

    Time when the point was recorded, in milliseconds.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSNumber *t;
  • Unavailable. Use init(x:y:t:) instead.

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • Creates a StrokePoint object using the coordinates provided as argument.

    Scales on both dimensions are arbitrary but be must be identical: a displacement of 1 horizontally or vertically must represent the same distance, as seen by the user.

    Spatial and temporal origins can be arbitrary as long as they are consistent for a given ink.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithX:(float)x y:(float)y t:(long)t;

    Parameters

    x

    Horizontal coordinate. Increases to the right.

    y

    Vertical coordinate. Increases going downward.

    t

    Time when the point was recorded, in milliseconds.

  • Creates a StrokePoint object using the coordinates provided as argument, without specifying a timestamp. This method should only be used when it is not feasible to include the timestamp information, as the recognition accuracy might degrade.

    Scales on both dimensions are arbitrary but be must be identical: a displacement of 1 horizontally or vertically must represent the same distance, as seen by the user.

    Spatial origin can be arbitrary as long as it is consistent for a given ink.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithX:(float)x y:(float)y;

    Parameters

    x

    horizontal coordinate. Increases to the right.

    y

    vertical coordinate. Increases going downward.