Xamarin.SwiftUI
.NET bindings for SwiftUI
Install / Use
/learn @chkn/Xamarin.SwiftUIREADME
Xamarin.SwiftUI
A managed binding to SwiftUI.
Build Status
Project Status:
✅ Active.
Xamarin.SwiftUI provides a managed binding to Apple's next-generation SwiftUI toolkit. Using your favourite .NET language, you should be able to create SwiftUI apps. However, only a handful of APIs are currently bound. Work is ongoing on a binding generator to automatically cover the entire API surface.
<!-- ## Nuget Status [](https://nuget.org/packages/SwiftUI.NET) [](https://nuget.org/packages/SwiftUI.NET) ## Nuget Download 📦 [NuGet](https://nuget.org/packages/SwiftUI.NET): `dotnet add package SwiftUI.NET` -->Example
A simple custom view with state:
using SwiftUI;
using static SwiftUI.Views;
public partial record ClickView : View
{
readonly State<int> clicks = new State<int> (0);
public View Body
=> Button ($"Clicked {clicks.Value} times", () => clicks.Value++);
}
Building from Source
Prerequisites
- .NET 6 SDK
- Xcode 13 or newer
Building
dotnet msbuild /restore build.proj
If you need to make changes to the SwiftUIGlue native glue library during development, you can rebuild just those bits by running:
dotnet msbuild build.proj /t:SwiftUIGlue
Packaging
The major and minor version of nuget packages created by the CI pipeline is controlled by the VERSION file. This does not need to be bumped for patch releases.
For local development, the version of the package produced can be overridden:
dotnet msbuild /restore build.proj /t:Pack /p:Version=X.X.XXX
For more information about the internals and guidance on developing the binding itself, see the document titled Hacking.
Related Skills
node-connect
346.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
