compnerd/swift-win32
53.4
Adequate · 1 October 2026
16.8k
lines of production code
Swift
primary language
2
measurements over time
What this system is
SwiftWin32 is a framework that brings iOS-style UI development paradigms to the Windows platform using Swift. It provides a comprehensive set of UIKit-like components, including views, controls, layout systems, and scene-based application lifecycles, while integrating with Windows-specific APIs for window management and input handling. The system also includes a SwiftUI-compatible layer (SwiftWin32UI) to support declarative interface construction on Win32.
How it got here
2019–2020 — Initial framework scaffolding and core UI implementation
27 changes.
This period established the foundational structure of the SwiftWin32 framework, including build systems, dependency management, and the initial Swift Package Manager manifest. It focused on implementing core Windows-specific platform support, such as scene lifecycles, auto-layout with Cassowary, and basic UI controls, while introducing the SwiftWin32UI library to bridge SwiftUI concepts to the Windows environment.
2021 — SwiftUI foundation and UI testing
12 changes.
This period focused on establishing the foundational infrastructure for a SwiftUI-like declarative UI layer on Win32, introducing core protocols, view builders, and app structure components. Concurrently, the team expanded the framework's capabilities with text overflow handling, appearance customization, and property-based animations, while significantly increasing test coverage for UI core, graphics, and system time conversions.
Features
Add Image configuration and symbol variant support
The Image module now includes a Configuration class and specific configuration types for symbol images, allowing users to define traits such as point size, weight (e.g., light, bold, black), scale (small, medium, large), and text style. This change introduces the \SymbolWeight\ and \SymbolScale\ enums and the \SymbolConfiguration\ class to manage how symbol images are rendered, while also explicitly utilizing WIC2 for image handling.
Sources/SwiftWin32/Images and PDF · high confidence
Add InputViewController for app extensions
A new InputViewController class has been added to the App Extensions module, inheriting from ViewController. This provides a base class for implementing input-related app extensions, such as keyboard extensions, within the SwiftWin32 framework.
Sources/SwiftWin32/App Extensions · high confidence
Add LineBreakMode enum for text overflow handling
A new LineBreakMode enum has been added to ParagraphStyle, allowing users to control how text behaves when it exceeds the width of its container. This includes options for wrapping by word or character, clipping, and truncating with ellipses at the head, tail, or middle of the line.
Sources/SwiftWin32/Text Storage · high confidence
Add Spring Loaded Interaction Context API
Introduced the \SpringLoadedInteractionContext\ protocol and \SpringLoadedInteractionEffectState\ enum in the Drag and Drop module, enabling developers to manage and observe spring-loaded interaction states (such as activated, activating, inactive, and possible) for views during drag-and-drop operations.
Sources/SwiftWin32/Drag and Drop · high confidence
Add Swift Calculator example with scene-based UI and precise arithmetic
The Examples/Calculator directory now contains a complete, buildable calculator application. It uses CMake to build the Swift source against SwiftWin32, embedding a Windows manifest for PerMonitorV2 DPI awareness and copying an Info.plist to configure the application scene. The app implements a calculator using NSDecimalNumber for precise arithmetic, handles button interactions via the target-action model, and presents its UI through a scene delegate and view controller.
Examples/Calculator · high confidence
Add SwiftUI-compatible View protocol and ViewBuilder for Win32 controls
The \Sources/SwiftWin32UI/Views and Controls\ directory now includes the foundational types required for a SwiftUI-like declarative UI layer on Win32. A new \View\ protocol defines the standard \body\ property, while a \ViewBuilder\ result builder enables the use of SwiftUI-style view composition syntax. Additionally, a \Label\ struct is introduced to bridge existing \SwiftWin32.Label\ controls into this new view hierarchy, allowing them to be used as SwiftUI-compatible components.
Sources/SwiftWin32UI/Views and Controls · high confidence
Add UIApplicationDelegateAdaptor property wrapper
Introduced a new \UIApplicationDelegateAdaptor\ property wrapper in the SwiftWin32UI framework integration layer. This allows applications to inject and manage an \ApplicationDelegate\ instance directly within their app structure, simplifying the initialization and access of the delegate from Swift/Win32.
Sources/SwiftWin32UI/Framework Integration · high confidence
Add application launch options and scene configuration support
The Application module now includes support for parsing application launch options and scene configurations. New files define \LaunchOptionsKey\ to handle various launch reasons such as URLs, Bluetooth events, and remote notifications, and \Information.swift\ introduces \SceneConfiguration\ and \SceneManifest\ structs to support multiple scenes and principal class settings via decodable properties.
Sources/SwiftWin32/Application · high confidence
Add iOS-style Scene lifecycle support for multi-window applications
This change introduces a new set of source files in the App and Environment/Scenes module that implement the iOS Scene architecture on Windows. It adds the core \Scene\ class with lifecycle notifications (connect, disconnect, foreground, background), the \SceneSession\ and \SceneConfiguration\ classes to manage scene identity and setup, and the \SceneDelegate\ protocol to handle lifecycle events. It also includes \WindowScene\ and \WindowSceneDelegate\ to manage specific window-related tasks, size restrictions, and screen associations, enabling applications to support multiple independent windows with distinct lifecycle states.
Sources/SwiftWin32/App and Environment/Scenes · high confidence
Add property-based animation infrastructure
Introduces new types and protocols to support property-based animations, including \CubicTimingParameters\ and \SpringTimingParameters\ for defining animation curves, the \TimingCurveProvider\ protocol for abstracting timing data, and the \ViewAnimating\ and \ViewImplicitlyAnimating\ protocols for managing animation lifecycle, state, and completion blocks.
Sources/SwiftWin32/Animation and Haptics/Property-Based Animations · high confidence
Added focus-based navigation and pointer interaction APIs
This change introduces the foundational API surface for focus-based navigation and pointer interactions in SwiftWin32. It adds the \FocusEnvironment\ protocol and related types (such as \FocusUpdateContext\, \FocusItem\, and \FocusAnimationCoordinator\) to manage focus updates, validate movements, and coordinate animations. Additionally, it provides the \PointerInteraction\ class and associated protocols (\PointerInteractionDelegate\, \PointerInteractionAnimating\) along with types like \PointerStyle\, \PointerEffect\, and \PointerRegion\ to enable custom pointer effects, region-based interactions, and visual feedback during pointer movements.
Sources/SwiftWin32/Focus-Based Navigation · high confidence
Added initial SwiftUI view components: AnyView, EquatableView, and Group
This change introduces three new view types to the SwiftWin32UI framework to support SwiftUI view composition. AnyView provides type-erasure for views, allowing dynamic changes to the view hierarchy type. EquatableView wraps an equatable view to prevent unnecessary child updates when the content remains unchanged. Group serves as a container for grouping view or scene content, supporting both @ViewBuilder and @SceneBuilder initializers.
Sources/SwiftWin32UI/View Layout and Presentation · high confidence
Added view controller transition animation protocols
The library now exposes a set of Swift protocols to support custom view controller transitions, including \ViewControllerAnimatedTransitioning\ for defining animation logic, \ViewControllerInteractiveTransitioning\ for handling interactive gestures, \ViewControllerTransitioningDelegate\ for coordinating presentation and dismissal, and \ViewControllerTransitionCoordinator\ along with its context types for managing transition state and progress. These additions enable developers to implement custom animated transitions and interactive dismissal/presentation behaviors within the framework.
Sources/SwiftWin32/Animation and Haptics/View Controller Transitions · high confidence
Initial implementation of TableView and related components
This change introduces the core table view infrastructure for SwiftWin32, including the \TableView\ control with support for plain, grouped, and inset-grouped styles, along with \TableViewCell\, \TableViewHeaderFooterView\, and the \TableViewDataSource\ and \TableViewDelegate\ protocols. It also adds \ContextualAction\ and \SwipeActionsConfiguration\ to enable swipe-to-action interactions on rows, providing a foundation for displaying and managing tabular data in Windows applications.
Sources/SwiftWin32/Views and Controls/Table Views · high confidence
Initial implementation of UI components for alerts, screens, and windows
This change introduces the foundational classes for the application's user interface layer. It adds \AlertController\ and \AlertAction\ to support displaying modal alerts and action sheets with configurable styles and handlers. It also introduces \Screen\ to manage display information, including multi-monitor support, scale factors, and trait collections, alongside \Window\ to handle window lifecycle, activation states, DPI changes, and size restrictions. Additionally, a \CoordinateSpace\ protocol is added to enable coordinate conversion between different view hierarchies.
Sources/SwiftWin32/Windows and Screens · high confidence
Initial implementation of core UI views and controls
This release introduces the foundational set of UI components for SwiftWin32, including \Button\, \Label\, \ImageView\, \Slider\, \Stepper\, \DatePicker\, \PickerView\, \ProgressView\, and \BarButtonItem\. It also adds essential layout and styling infrastructure such as \Axis\, \EdgeInsets\, \DirectionalEdgeInsets\, \DirectionalRectEdge\, and \Offset\. These components provide the basic building blocks for constructing user interfaces, with \Control\ serving as the base class for interactive elements and \View\ for visual containers.
Sources/SwiftWin32/Views and Controls · high confidence
Initial project scaffolding and build configuration
The repository has been initialized with the core structure for the Swift/Win32 framework, including the BSD 3-Clause license, Swift formatting rules, and Git configuration files. The build system has been established using CMake (minimum version 3.16) and Swift Package Manager manifests (supporting Swift 5.4 through 5.8), which define the SwiftWin32 and SwiftWin32UI libraries along with demo executables like UICatalog and Calculator. The configuration also integrates external dependencies via Git submodules, specifically swift-log, swift-collections, cassowary, and SwiftCOM, and links against Windows system libraries such as User32 and ComCtl32.
(repo-wide) · high confidence
Initial release of SwiftWin32UI framework
This change introduces the new SwiftWin32UI library, integrating it into the CMake build system and linking it against SwiftWin32. The framework provides foundational SwiftUI components for Windows, including the \EmptyView\ type, the \Never\ type extensions to conform to \View\ and \Scene\, and the initial structure for app and scene definitions (App, Scene, SceneBuilder, WindowGroup, View, ViewBuilder, and Group).
Sources/SwiftWin32UI · high confidence
Introduce SwiftWin32 menu and shortcut abstractions
This change adds the foundational API for menus and shortcuts in SwiftWin32, introducing classes and protocols that mirror iOS UIKit menu concepts. It provides \Menu\ and \MenuElement\ types for defining menu structures, \Action\ and \Command\ classes for handling user interactions via closures or selectors, and a \MenuBuilder\ protocol for programmatically constructing and modifying menu hierarchies. Additionally, it includes \ContextMenuInteraction\ and related delegate protocols to support contextual menus with preview capabilities, along with supporting types like \KeyModifierFlags\ for keyboard shortcuts and \TargetedPreview\ for animation configuration.
Sources/SwiftWin32/Menus and Shortcuts · high confidence
Introduce adaptive presentation controller and application environment APIs
This update adds the \AdaptivePresentationControllerDelegate\ protocol and \PresentationController\ interface, enabling developers to customize how view controllers are presented and adapt their styles based on trait changes (such as size class or idiom shifts). It also introduces the \Application\ singleton for managing app state and scenes, the \ApplicationDelegate\ protocol for handling lifecycle events, and the \ApplicationMain\ entry point which initializes the Windows message loop, COM, and common controls. Additionally, it defines \InterfaceOrientationMask\ for controlling supported screen orientations and expands \ContentSizeCategory\ with accessibility-specific font sizes and change notifications.
Sources/SwiftWin32/App and Environment · high confidence
Introduce appearance customization configuration types
Added a new set of types in the Appearance Customization Configurations module to support declarative view styling. This includes \BackgroundConfiguration\ for defining cell and header backgrounds, \ContentConfiguration\ and \ListContentConfiguration\ for managing list item content and text/image properties, and state structures like \CellConfigurationState\ and \ViewConfigurationState\ to track selection, focus, and highlight states. The \ConfigurationColorTransformer\ type enables dynamic color resolution, allowing backgrounds and text to adapt to system tints and accessibility settings.
Sources/SwiftWin32/Appearance Customization/Configurations · high confidence
Introduce iOS-style typography system for fonts
The Text Display and Fonts module now includes \Font\, \FontDescriptor\, and \FontMetrics\ classes that implement an iOS-style typography system. \Font\ provides \preferredFont(forTextStyle:)\ methods that automatically scale text based on the user's content size category (from extra-small to accessibility extra-extra-extra-large), using predefined weight, size, and leading values derived from Apple's Human Interface Guidelines. \FontDescriptor\ allows querying and modifying font attributes such as name, size, matrix, and symbolic traits, while \FontMetrics\ offers utilities to scale existing fonts according to these metrics. This brings a consistent, adaptive text rendering experience to SwiftWin32 applications.
Sources/SwiftWin32/Text Display and Fonts · high confidence
Introduce programmatic auto-layout system with Cassowary solver integration
This change adds the foundational components for a programmatic auto-layout system in SwiftWin32. It introduces a fluent API for defining constraints via \LayoutAnchor\, \LayoutDimension\, and axis-specific anchors (\LayoutXAxisAnchor\, \LayoutYAxisAnchor\), allowing developers to specify relationships like equality, greater-than, or less-than between view attributes. The system includes \LayoutConstraint\ for managing constraint activation and deactivation, \LayoutGuide\ for defining spatial regions, and \LayoutPriority\ for handling constraint conflicts. Crucially, it integrates the Cassowary constraint solver library to translate these high-level Swift constraints into solvable mathematical equations, enabling dynamic UI resizing and positioning on Win32.
Sources/SwiftWin32/AutoLayout · high confidence
Introduce view controller containment, presentation, and trait environment support
The View Controllers module now includes the \ContentContainer\ protocol, which enables view controllers to adapt to size and trait changes and manage child view controllers. A new \PresentationController\ class has been added to manage transition animations and the presentation of view controllers onscreen, including support for adaptive presentation delegates. Additionally, \ViewController\ now conforms to \TraitEnvironment\, allowing it to respond to interface trait changes, and includes containment callbacks to properly manage parent-child relationships within the view hierarchy.
Sources/SwiftWin32/View Controllers · high confidence
Introduces Appearance customization protocols
Adds the \Appearance\ protocol and the \AppearanceContainer\ protocol to the SwiftWin32 framework. The \Appearance\ protocol provides static methods to access the appearance proxy for a class, allowing customization based on trait collections and container types, while \AppearanceContainer\ defines the requirement for classes to support this API.
Sources/SwiftWin32/Appearance Customization · high confidence
Introduces SwiftUI app structure protocols and builders
Adds the foundational \App\ and \Scene\ protocols, along with \SceneBuilder\ and \WindowGroup\, to define the structure and behavior of SwiftWin32UI applications. These new files establish the API for declaring application bodies and window groups, though the builder and window group implementations currently throw fatal errors as they are not yet fully implemented.
Sources/SwiftWin32UI/App Structure and Behaviour · high confidence
Introduces core touch, press, and gesture recognition APIs
Adds the foundational classes and protocols for handling user interactions in SwiftWin32, including \Event\, \Touch\, \Press\, and \PressesEvent\ to model input data, along with \GestureRecognizer\, \TapGestureRecognizer\, and \GestureRecognizerDelegate\ to interpret and react to gestures. The \Responder\ class is updated with new methods to handle touch, motion, and physical button press events, enabling applications to respond to these interactions.
Sources/SwiftWin32/Touches, Presses, and Gestures · high confidence
New Color and BezierPath drawing primitives
The SwiftWin32 Drawing module now includes the \Color\ and \BezierPath\ types. \Color\ supports creation via RGB, HSB, and grayscale component values, as well as dynamic providers that adapt to the current \TraitCollection\. It exposes methods to retrieve color information in various color spaces (HSB, RGB, grayscale) and handles internal representation and hashing for these values. \BezierPath\ is introduced as a new public class, currently serving as a placeholder for future path-drawing capabilities.
Sources/SwiftWin32/Drawing · high confidence
New UI protocols and scene size restrictions
This update introduces new UI capabilities in the SwiftWin32 framework. It adds the \ContentSizeCategoryAdjusting\ and \ContentSizeCategoryImageAdjusting\ protocols, allowing controls to automatically adjust fonts and images based on accessibility content size settings. An \Interaction\ protocol is also added to manage interactions attached to views. Additionally, \SceneSizeRestrictions\ is introduced, enabling applications to define minimum and maximum window sizes (defaulting to 768x768).
Sources/SwiftWin32/UI · high confidence
New platform support layer for Windows-specific capabilities
The Platform directory now includes new files that provide foundational support for Windows-specific features. BatteryMonitor.swift introduces a mechanism to monitor battery level changes via Windows power notifications. Error.swift adds a unified error type that formats Win32, NT, HRESULT, and errno codes into human-readable descriptions. OrientationSensor.swift implements a COM-based interface to access device orientation sensors. Win32+Menu.swift provides a \_MenuBuilder implementation to construct and manage Win32 window menus. Win32+PropertyWrappers.swift adds a \_Win32WindowText property wrapper for binding window titles. WindowClass.swift and WindowsHandle.swift introduce core types for registering window classes and managing Windows handle lifecycles with ownership semantics.
Sources/SwiftWin32/Platform · high confidence
New support utilities and UI extensions for SwiftWin32
This change introduces a collection of new support files in the SwiftWin32 Support layer to enhance UI development and system integration. It adds managed handle wrappers for Windows GDI objects (Bitmap, Brush, Device Context, Font, Menu) to ensure proper resource cleanup, and provides helper extensions for converting between Swift UI types (Point, Size, Rect) and WinSDK types (POINT, SIZE, RECT), including DPI-aware rectangle scaling. Additionally, it includes utilities for date/time conversion between Windows FILETIME/SYSTEMTIME and Foundation Date, a centralized logging mechanism, and a comprehensive debug description map for Windows window messages to aid in debugging.
Sources/SwiftWin32/Support · high confidence
Behavioural changes
UICatalog demo adopts scene-based lifecycle and showcases new controls
The UICatalog example has been restructured to use the modern scene-based application lifecycle (replacing the previous delegate model) and now demonstrates a broader set of UI controls, including TableView, PickerView, Stepper, and ImageView. The app's build configuration has been updated to use CMake, and it correctly handles resource loading for both SwiftPM and non-package builds.
Examples/UICatalog · high confidence
Test coverage
Added initial test suite for AutoLayout constraints; Added test coverage for CoreGraphics Rect and AffineTransform; Added tests for Windows FILETIME and SYSTEMTIME conversions; Added unit tests for SwiftWin32 UI core components; Consolidated test entry point for AutoLayout, CoreGraphics, and UICore.
Dependencies
Add SwiftCOM, Cassowary, Swift Collections, and Swift Log submodules
The project now includes four new Swift Package Manager submodules: SwiftCOM (synced to commit ebbc617), Cassowary, Swift Collections, and Swift Log. These additions provide underlying libraries for COM interop, constraint solving, collection utilities, and logging respectively, expanding the available tooling for the Swift-based components.
Packages · high confidence
Initial Swift Package Manager manifest for SwiftWin32
The project now includes a \Package.swift\ manifest that defines the SwiftWin32 library and its SwiftWin32UI extension, along with demo executables (UICatalog, Calculator) and test targets. This manifest establishes dependencies on Apple's swift-log (v1.4.3+), swift-collections (v1.0.0+), and external packages cassowary and swift-com, enabling users to build and test the framework using Swift Package Manager.
(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 57 → 53 (-3.9)
- Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.
Lenses
- Code Health 94 → 92 (-2.0)
- Architecture 89 → 88 (-0.9)
- Maturity 37 → 37 (+0.0)
- Readiness 61 → 46 (-15.2)
- Security 82 → 82 (+0.0)
- Event Sourcing 100 → 100 (+0.0)
Resolved (1)
- Documentation: no usage examples (README.md)
New (19)
- ApplicationMain.swift.ApplicationMain (cognitive 33) (Sources/SwiftWin32/App and Environment/ApplicationMain.swift)
- ApplicationMain.swift.ApplicationMain (cyclomatic 22) (Sources/SwiftWin32/App and Environment/ApplicationMain.swift)
- Coverage not measured — Swift suite
- Duplicated block (10 lines × 3) (Sources/SwiftWin32/Text Display and Fonts/Font.swift)
- Duplicated block (11 lines × 2) (Sources/SwiftWin32/Drawing/Color.swift)
- Duplicated block (12 lines × 2) (Sources/SwiftWin32/Text Display and Fonts/Font.swift)
- Duplicated block (15 lines × 15) (Sources/SwiftWin32/Drawing/Color.swift)
- Duplicated block (16 lines × 2) (Sources/SwiftWin32/Text Display and Fonts/Font.swift)
- Duplicated block (21 lines × 2) (Sources/SwiftWin32/App and Environment/Device.swift)
- Duplicated block (4–7 lines × 16) (Sources/SwiftWin32/Drawing/Color.swift)
- Duplicated block (7 lines × 30) (Sources/SwiftWin32/Drawing/Color.swift)
- Duplicated block (9 lines × 2) (Sources/SwiftWin32/Platform/Error.swift)
- FunctionTooLong: ApplicationMain.swift.ApplicationMain (Sources/SwiftWin32/App and Environment/ApplicationMain.swift)
- Members sharing a duplicated core (17 members, 50+ identical tokens) (Sources/SwiftWin32/Drawing/Color.swift)
- Members sharing a duplicated core (30 members, 50+ identical tokens) (Sources/SwiftWin32/Drawing/Color.swift)
- Off the main sequence: CoreAnimation (SwiftPM)
- Off the main sequence: CoreGraphics (SwiftPM)
- Projects may be oversized for their cohesion
- Typo in method name: 'isValidIntefaceOrientation' is missing the 'c' in 'Interface'. This is a spelling error in the public API surface.
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
compnerd/swift-win32 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 d34ff1b8b3f15cfdf2cb71109a3c313001122a54 — 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.