Linking is done in the file ApiDefinition.cs. You have to translate the header file contents into some C# interfaces. Finally you have to annotate the interfaces/methods/parameters that name the library's objects.
Detailed information about translation and annotation may be found on Xamarins web site: http://docs.xamarin.com/ios/Guides/Advanced_Topics/Binding_Objective-C_Libraries.
To use the library, adapt the following:
| Library's header file content | Linking in ApiDefiniton.cs |
|---|---|
| @interface ObjCClass | |
| ... | [BaseType (typeof (NSObject))] |
| interface ObjCClass { | |
| @end | ... |
| } | |
| +(void)method1:(int)parameter; | [Static, Export(''method1:'')] |
| void method1(int parameter); | |
| -(NSString |
[Export''method2'')] |
| NSString method2(); | |
| @protocol MyDelegate | |
| -(int)method3; | |
| @end | [BaseType (typeof(NSObject))] |
| [Model] | |
| interface MyDelegate { | |
| [Export(''method3'')] | |
| [Abstract] | |
| int method3(); | |
| } |