Skip to content
CAI
Software that uses CAICheck a score

Harley-xk/MaLiang

48.9

Weak · 1 October 2026

9.3k

lines of production code

Swift

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

MaLiang is a Metal-based iOS drawing framework that provides a high-performance canvas for rendering strokes and textured elements. It supports advanced input features like Apple Pencil pressure sensitivity, force-sensitive gestures, and scrollable large canvases. The system handles document persistence via JSON serialization and allows for complex element management, including grouping and rotation of chartlet textures.

How it got here

2017 — Example app restructuring and CocoaPods integration

8 changes.

The MaLiang example application was restructured to support external file sharing and organized with new sample components and resources. This period also established CocoaPods distribution for the framework and configured the Xcode workspace to manage dependencies and build schemes effectively.

2019–2020 — Metal engine migration and document persistence

10 changes.

The MaLiang drawing engine was migrated to a Metal-based architecture, introducing new brush types, element structures, and canvas interaction models. This period also established core document persistence capabilities, enabling the saving and loading of drawings to disk via JSON serialization. Supporting infrastructure included updated math utilities, gesture handling, and sample applications demonstrating the new features.

Features

Add Chartlet Picker and Editor components to the sample project

The sample project now includes a ChartletPicker and ChartletEditor UI components, allowing users to select and manipulate MLTexture instances. The ChartletPicker presents a horizontal collection of textures with an animated appearance, while the ChartletEditor enables users to pan, pinch-to-zoom, and rotate a selected texture using gesture recognizers. Supporting utilities include a ChartletImageCache for efficient UIImage retrieval and MathUtils for geometric calculations required by the editor's transformation logic.

Example/MaLiang/Components · high confidence

Added Chrysan and Comet example pods to the project

The Example/Pods directory now includes the Chrysan and Comet third-party libraries. Chrysan is a Swift-based HUD (Heads-Up Display) library that provides customizable loading indicators, progress rings, and status messages with blur effects. Comet is a utility library offering features such as keyboard management for scroll views, file path helpers, collection grouping, and task recording. These additions allow the example project to demonstrate and utilize these UI and utility components.

Example/Pods · high confidence

Added MaLiang example workspace configuration

The Example/MaLiang.xcworkspace has been added, configuring the Xcode workspace to include both the MaLiang.xcodeproj and the Pods/Pods.xcodeproj (CocoaPods dependencies). This enables developers to open and build the example project with its dependencies properly linked.

Example/MaLiang.xcworkspace · high confidence

Added Xcode scheme for the MaLiang example app

The MaLiang-Example.xcscheme file has been added to the project, configuring the build, test, launch, profile, analyze, and archive actions for the MaLiang\_Example.app target and its associated unit tests. This enables developers to directly run, debug, and test the example application within Xcode.

Example/MaLiang.xcodeproj/xcshareddata · high confidence

Added custom launch screen for the example app

The example application now includes a dedicated LaunchScreen.xib file, replacing the default launch interface. This custom screen displays the 'MaLiang' title and copyright information, ensuring a consistent visual identity during app startup.

Example/MaLiang/Base.lproj · high confidence

Added file management view for sample files

The example app now includes a SavedFilesViewController that displays a list of sample files stored in the documents directory. Users can view file names in a table, tap a row to open the file in the main editor, use the accessory button to preview files via Quick Look, and swipe to delete files from the local storage.

Example/MaLiang/File Samples · high confidence

Example app now supports opening .maliang files from other apps

The MaLiang example app can now open .maliang files shared from other applications. This is enabled by registering the com.harley.maliang document type in the Info.plist and implementing the application(\_:open:options:) delegate method in AppDelegate to move the incoming file to the app's documents directory and load it in the canvas.

Example/MaLiang · high confidence

Introduction of specialized brush types and enhanced stroke control

The drawing engine now supports new brush variants including ChartletBrush for rendering image-based textures, GlowingBrush for creating neon-style effects with a distinct core line, and Eraser with corrected blend modes. The base Brush class has been updated with new properties allowing users to control stroke scaling relative to the canvas, adjust force sensitivity for pressure-sensitive input, and define specific force values for tap interactions. Additionally, texture rotation options (fixed, random, or aligned to stroke direction) are now available to customize the visual appearance of brush strokes.

MaLiang/Classes/Brush · high confidence

New Chartlet, ElementGroup, and LineStrip element types

The Elements module now supports new canvas element types: Chartlet (a textured, rotatable element with custom Codable logic for file saving), ElementGroup (a container for grouping multiple CanvasElements), and LineStrip (a collection of MLLine segments rendered with brush-specific vertex buffers). These additions enable more complex drawing operations, including grouped elements, textured overlays, and optimized line rendering with rotation and opacity handling.

MaLiang/Classes/Elements · high confidence

New painting samples with chartlet brushes and scrollable canvas support

The example app now includes new sample projects demonstrating advanced MaLiang features. The main painting sample introduces a 'Chartlet' brush type that renders distinct textures (e.g., shapes) at touch points, along with support for glowing brushes, force-sensitive strokes, and Pencil mode. It also adds a UI for editing chartlet properties like rotation and position. Additionally, new scrollable canvas samples allow users to paint on large canvases that exceed the screen size, with support for multi-touch panning gestures.

Example/MaLiang/Painting Sanples · high confidence

Behavioural changes

Canvas interaction model refactored with new observer architecture and Apple Pencil support

The canvas now uses a new \ActionObserver\ protocol and pool to manage event notifications, replacing the previous direct delegate/callback mechanism for actions like drawing, scrolling, and zooming. This change introduces a \RenderingDelegate\ with default implementations to simplify custom rendering logic. Additionally, a new \isPencilMode\ property allows the canvas to prioritize Apple Pencil input while ignoring other touches, and the \ScrollableCanvas\ implementation has been updated to handle zoom and pan gestures with improved scroll indicator visibility.

MaLiang/Classes/Canvas · high confidence

Document persistence and canvas data management

The app now supports saving and loading drawings to disk. Canvas data, including line strips and chartlets, is exported as JSON with associated textures, and imported back to restore the canvas state. A new observer system notifies components of canvas changes (such as undo, redo, or element completion), and document metadata now includes line and chartlet counts along with a version identifier.

MaLiang/Classes/Data & Documents · high confidence

Example project restructured with new sample components and resources

The MaLiang example project has been reorganized to include new sample files and UI components. The project now features a ChartletPicker and ChartletEditor for managing chartlet elements, along with a ScrollableSample for demonstrating canvas scrolling. Additional resources include new brush, pencil, claw, and glow textures, as well as a SavedFilesViewController for file handling examples. The project structure has been updated to reflect these additions, including new groups for painting samples, scroll samples, file samples, and components.

Example/MaLiang.xcodeproj · high confidence

Metal rendering engine migration and snapshot capabilities

The MaLiang drawing engine has been migrated to a new Metal-based architecture (MetalBase), introducing a dedicated Renderer, RenderTarget, and MetalView to handle drawing operations more efficiently. This change adds support for taking snapshots of the canvas (including single elements) via SnapshotTarget, enables eraser functionality, and improves color handling by converting to sRGB. It also fixes simulator compatibility for iOS 13+ and resolves various color blending and crash issues present in the previous implementation.

MaLiang/Classes/MetalBase · high confidence

New math utilities and gesture handling infrastructure

The Math & Utils module now includes new files for core drawing and interaction logic. BezierGenerator provides quadratic Bezier curve calculation for path generation. Maths.swift introduces helper structs for Metal vertex/uniform data and extensions for CGPoint and CGSize arithmetic. PaintingGestureRecognizer replaces standard pan gestures with a custom implementation that supports pressure sensitivity (force) and corrects gesture begin locations. Utils.swift adds a fix for MTLTexture clearing to prevent uninitialized memory artifacts, along with bundle and coordinate utilities. WeakObjectBox provides a memory-safe object pooling mechanism.

MaLiang/Classes/Math & Utils · high confidence

Reorganized project directory structure

The project workspace has been restructured to reflect a new directory layout. The Xcode workspace file (contents.xcworkspacedata) has been added to explicitly reference the MaLiang project, and a .gitkeep file has been created in the MaLiang/Classes directory to preserve the empty folder in version control.

Example/MaLiang.xcodeproj/project.xcworkspace, MaLiang/Classes · high confidence

Fixes

Added macOS App Sandbox entitlements to the Example app

The Example project now includes a dedicated entitlements file that enables the macOS App Sandbox along with specific permissions for network client access and photos library access. This change aligns the example application with modern macOS security requirements, ensuring it can properly access necessary resources while adhering to sandboxing policies.

Example · medium confidence

Dependencies

Initial CocoaPods support for MaLiang 2.9.2

The MaLiang framework is now distributed via CocoaPods, allowing users to integrate version 2.9.2 into their iOS projects by adding the pod to their Podfile. The example project has been configured to use MaLiang alongside supporting libraries Comet, Chrysan, Zip, and SnapKit, and the podspec enforces Swift 5.0 with a minimum iOS deployment target of 9.0.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 50 → 49 (-1.1)
  • Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 100 → 100 (+0.0)
  • Architecture 97 → 98 (+0.9)
  • Maturity 49 → 49 (+0.0)
  • Readiness 21 → 21 (+0.0)
  • Security 100 → 100 (+0.0)

Resolved (1)

  • Documentation: no installation or build instructions (README.md)

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

Harley-xk/MaLiang was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 1 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 594cd9e7124f270ab6d8f4998987eef0dc83f542 — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.