Repository inventory

redth/maui-skillz

Skills indexed from this repository, with install-style signals scoped to the repo.
2 skills22 GitHub stars0 weekly installsGitHubOwner profile

Overview

This skill guides creating and updating slim Native Library Interop (NLI) bindings for iOS to use native Swift/Objective‑C code from .NET MAUI and .NET for iOS projects. It focuses on thin native wrappers, Xcode project configuration, generating C# API definitions, and integrating xcframeworks, CocoaPods, or Swift Package Manager dependencies. The approach minimizes surface area and maintenance compared to full traditional bindings.

How this skill works

It walks you through making a small native wrapper that exposes only the APIs you need, generating an Xcode project (optionally with XcodeGen), building an xcframework, and referencing that output from a C# binding project. The skill shows how to create Obj‑C/Swift @objc entry points, produce ApiDefinition.cs files, and configure the .csproj to invoke Xcode build and package the binding. It also covers pod/spm integration and common build verification steps.

When to use it

  • You need a subset of a native iOS SDK exposed to .NET
  • You want easier maintenance when native SDKs change
  • You prefer writing a small Swift/Obj‑C wrapper instead of full binding metadata
  • You need to integrate an xcframework into a MAUI or net-ios project
  • You must resolve Swift interop or build errors when binding iOS libraries

Best practices

  • Limit the wrapper surface to only the APIs your app uses to reduce breaking changes and simplify ApiDefinition.cs
  • Use XcodeGen or scripted Xcode workspace generation for reproducible builds and CI compatibility
  • Prefer static frameworks or xcframeworks built with BUILD_LIBRARY_FOR_DISTRIBUTION=YES for stable ABI across Swift versions
  • Expose @objc methods and simple bridged types (NSString, NSNumber, UIView, NSError, completion blocks) to simplify C# signatures
  • Keep a sample MAUI app in the workspace to validate runtime behavior and view embedding quickly

Example use cases

  • Wrap a Swift-only SDK by writing a tiny @objc Swift wrapper that exposes init, async callbacks, and a view factory, then generate ApiDefinition.cs
  • Integrate a third‑party xcframework into a MAUI binding project and configure the .csproj to build the native framework and package it
  • Add CocoaPods dependencies: create a Podfile in the native project, run pod install, switch the binding project to reference the .xcworkspace, and rebuild
  • Update bindings when the SDK changes: regenerate the Swift header (-Swift.h), adjust ApiDefinition.cs, and rebuild to catch signature or naming changes

FAQ

Choose slim bindings when you only need a subset of APIs, want lower maintenance, or can implement a small Swift/Obj‑C wrapper. Use traditional bindings when you must expose the entire API surface or support external binding consumers.

How do I handle async native callbacks in C#?

Expose native async operations with completion blocks that map to delegates or Action callbacks in ApiDefinition.cs. Mark them with [Async] where appropriate so the binding generator treats them as asynchronous.

What if Swift changes break the generated -Swift.h header?

Keep the wrapper stable: avoid exposing complex Swift generics or enums directly. If the header changes, update ApiDefinition.cs to match the new Objective‑C signatures and rebuild the binding.

2 skills

More from this maintainer
Other repositories and skills published under the same GitHub owner.
Skills library
Jump back to the full directory or explore grouped topics.
Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational