Skip to main content
net10.0-ios26.2net10.0-maccatalyst26.2net10.0-macos26.2

Native Swift interop bindings for Apple WorkoutKit

Published
Sep 5, 2026
1mo ago
Total Downloads
1.5K
1,491

Install

dotnet add package SwiftBindings.Apple.WorkoutKit --version 26.2.14
ProductVersions
.NET
net10.0-ios26.2net10.0-maccatalyst26.2net10.0-macos26.2

README

SwiftBindings.Apple.WorkoutKit

Native .NET bindings for Apple's WorkoutKit framework β€” building custom workouts, single-goal and pacer workouts, interval blocks, and scheduling them to Apple Watch. These are not Objective-C proxy wrappers; they use .NET 10's native Swift interop for direct, high-performance calls into Swift APIs from C#.

πŸ“– Full usage guide β†’ β€” goals, steps, interval blocks, alerts, the four workout types, plans, and scheduling, with the exact emitted C# signatures.

Installation

dotnet add package SwiftBindings.Apple.WorkoutKit

Requirements

  • .NET 10.0+
  • Target framework: net10.0-ios26.2 (or -macos26.2 / -maccatalyst26.2) or higher. The package is compiled against the iOS 26.2 SDK supplement, so your app's <TargetFramework> platform version must be β‰₯ 26.2 to restore it β€” an explicit lower TPV (e.g. net10.0-ios18.0) or a bare net10.0-ios whose installed workload defaults below 26.2 fails restore with NU1202. This is the compile-SDK pin, not your app's deployment minimum.
  • Deployment minimum is separate β€” set your app's real minimum OS with <SupportedOSPlatformVersion> (independent of the TFM above). Individual APIs that need a newer OS at runtime are gated by generated [SupportedOSPlatform] attributes; the C# compiler flags a call that isn't valid for your target.
  • macOS host for development
  • A paired Apple Watch and the companion watchOS app for scheduling to actually deliver

Usage

using WorkoutKit;

// Inspect scheduler authorization and capability
var status = WorkoutScheduler.AuthorizationStateKind.Authorized;
// var maxScheduled = WorkoutScheduler.Shared.MaxAllowedScheduledWorkoutCount;
// var isSupported = WorkoutScheduler.IsSupported;

// Build workout primitives
var step = new IntervalStep(IntervalStep.PurposeKind.Work);

CustomWorkout, SingleGoalWorkout, PacerWorkout, SwimBikeRunWorkout, IntervalBlock, IntervalStep, WorkoutPlan, ScheduledWorkoutPlan, the alert types, and WorkoutScheduler are all bound. See Apple's documentation for the full builder/scheduling flow.

Documentation

Caveats

WorkoutScheduler (Shared, MaxAllowedScheduledWorkoutCount, IsSupported, ScheduleAsync) is bound and exercised end-to-end. HealthKit-backed writes are out-of-scope for this SDK version β€” the scheduler can schedule workouts, but mutating HealthKit data models from the bound surface is not yet supported.

How It Works

These bindings are auto-generated by Swift Dotnet Bindings using .NET 10's native Swift interop via the SwiftBindings SDK.

License

The bindings are MIT licensed. WorkoutKit is part of the Apple SDK; refer to Apple's licensing for the underlying framework.

Changes from Previous Version

No structural changes between v26.2.13 and v26.2.14.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

Compatibility metadata lists 3 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.