Native Swift interop bindings for Apple WeatherKit
Install
| Product | Versions |
|---|---|
| .NET |
README
SwiftBindings.Apple.WeatherKit
Native .NET bindings for Apple's WeatherKit framework — current conditions, hourly and daily forecasts, severe-weather alerts, and historical data. 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#.
Installation
dotnet add package SwiftBindings.Apple.WeatherKit
Requirements
- .NET 10.0+
- iOS 26.2+, macOS 26.2+, Mac Catalyst 26.2+, tvOS 26.2+
- macOS host for development
- WeatherKit capability enabled and a paid Apple Developer Program membership (WeatherKit usage is metered and requires entitlement)
Usage
using WeatherKit;
var service = WeatherService.Shared;
// Get current attribution (logo + URL link required by Apple's terms)
var attribution = await service.GetAttributionAsync();
// Localised condition / phase descriptions
var phase = MoonPhase.Full.GetDescription();
var direction = Wind.CompassDirectionType.North.GetDescription();
Iterating a forecast
Forecast<T> projects to IReadOnlyList<T>, so the standard C# enumeration shape just works:
// `weather` is an instance returned by WeatherService.GetWeatherAsync(...)
foreach (var hour in weather.HourlyForecast)
{
Console.WriteLine($"{hour.Date}: {hour.Temperature}");
}
var firstDay = weather.DailyForecast[0];
var dayCount = weather.DailyForecast.Count;
Documentation
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. WeatherKit is part of the Apple SDK; refer to Apple's licensing for the underlying framework.
Changes from Previous Version
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.