Binding Objective-C

PDF for offline use
Related Links:

Let us know how you feel about this

Translation Quality


0/250

last updated: 2016-01

This section includes a variety of documents that cover creating bindings to Objective-C libraries, so they can be called from C# applications created with Xamarin.iOS or Xamarin.Mac.

Overview

This document contains some of the internals of how a binding takes place. It is an advanced document with some technical information.

Binding Objective-C Libraries

This document describes the process used to create C# bindings of Objective-C APIs and how the idioms in Objective-C are mapped to the idioms used in .NET. If you are binding just C APIs, you should use the standard .NET mechanism for this, the P/Invoke framework.

Binding Definition Reference Guide

This is the reference guide that describes all of the attributes available to binding authors to drive the binding generation process.

Objective Sharpie

Objective Sharpie is a command line tool to help bootstrap the first pass of a binding. It works by parsing the header files of a native library to map the public API into the binding definition (a process that can also be done manually).

iOS

The iOS binding page links back to these common binding resources, in addition to the examples below.

Walkthrough: Binding an Objective-C Library

This article provides a step-by-step walkthrough of creating a binding project using the open source InfColorPicker Objective-C project as an example. The InfColorPicker library provides a reusable view controller that allow the user to select a color based on its HSB representation, making color selection more user-friendly. Objective Sharpie will be used to assist in the binding process.

Binding Samples

A collection of third-party bindings that can be used a reference when creating new Binding Projects.

Mac

Historically Mac binding has been a very manual process. There is currently a downloadable preview of Mac Binding Project support for a future release of Xamarin Studio.

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.