objc-to-csharp-binding

Parse Objective-C header files to generate C# binding definitions for Xamarin.iOS.

1|Updated Feb 12, 2026
One-click install
npx skills add https://github.com/dalexsoto/NSSharp --skill objc-to-csharp-binding
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: objc-to-csharp-binding
Source: https://github.com/dalexsoto/NSSharp/tree/main/.agents/skills/objc-to-csharp-binding
Command: npx skills add https://github.com/dalexsoto/NSSharp --skill objc-to-csharp-binding

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the complex and error-prone process of translating Objective-C header files into C# binding definitions required for .NET for iOS (Xamarin.iOS / MAUI).

Core Features & Use Cases

  • API Contract Generation: Creates ApiDefinition.cs and StructsAndEnums.cs files.
  • Comprehensive Mapping: Handles classes, protocols, properties, methods, enums, structs, extern constants, and categories.
  • Attribute Generation: Correctly applies [BaseType], [Export], [Protocol], [Model], [NullAllowed], [Field], [DesignatedInitializer], [Notification], and more.
  • Use Case: You have a large Objective-C library and need to create C# bindings for use in a .NET MAUI application. This Skill will parse the headers and generate the necessary C# binding code.

Quick Start

Use the objc-to-csharp-binding skill to generate C# bindings from the provided Objective-C header file 'MyClass.h'.

Frequently Asked Questions about objc-to-csharp-binding

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate C# bindings from Objective-C headers for Xamarin.iOS?

To generate C# bindings from Objective-C headers for Xamarin.iOS, you parse the header files to produce C# interfaces with attributes like [BaseType] and [Export]. This process creates the necessary ApiDefinition.cs and StructsAndEnums.cs files.

What Objective-C constructs are supported when creating .NET for iOS bindings?

Creating .NET for iOS bindings supports mapping Objective-C classes, protocols, properties, methods, enums, structs, extern constants, and categories. It correctly handles nullability, argument semantics, and type conversions during the translation process.

Can I use this to bind Objective-C protocols and categories for a .NET MAUI application?

Yes, you can bind Objective-C protocols and categories for a .NET MAUI application. The binding generation applies [Protocol], [Model], and other necessary attributes to ensure the mapped C# interfaces integrate correctly.

How does the binding generator handle nullability and extern constants in Objective-C?

The binding generator handles nullability by applying [NullAllowed] attributes and maps extern constants using the [Field] attribute. This ensures that type conversions and argument semantics are accurately reflected in the C# binding definitions.

What files do I need to create C# binding definitions for a large Objective-C library?

To create C# binding definitions for a large Objective-C library, you need the original Objective-C header files. The binding process parses these headers to output the required ApiDefinition.cs and StructsAndEnums.cs files for your .NET project.