This repository has been archived by the owner on Mar 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
372 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
using System; | ||
using System.Drawing; | ||
|
||
using ObjCRuntime; | ||
using Foundation; | ||
using UIKit; | ||
|
||
namespace Estimotes.iOS.Binding { | ||
// The first step to creating a binding is to add your native library ("libNativeLibrary.a") | ||
// to the project by right-clicking (or Control-clicking) the folder containing this source | ||
// file and clicking "Add files..." and then simply select the native library (or libraries) | ||
// that you want to bind. | ||
// | ||
// When you do that, you'll notice that MonoDevelop generates a code-behind file for each | ||
// native library which will contain a [LinkWith] attribute. VisualStudio auto-detects the | ||
// architectures that the native library supports and fills in that information for you, | ||
// however, it cannot auto-detect any Frameworks or other system libraries that the | ||
// native library may depend on, so you'll need to fill in that information yourself. | ||
// | ||
// Once you've done that, you're ready to move on to binding the API... | ||
// | ||
// | ||
// Here is where you'd define your API definition for the native Objective-C library. | ||
// | ||
// For example, to bind the following Objective-C class: | ||
// | ||
// @interface Widget : NSObject { | ||
// } | ||
// | ||
// The C# binding would look like this: | ||
// | ||
// [BaseType (typeof (NSObject))] | ||
// interface Widget { | ||
// } | ||
// | ||
// To bind Objective-C properties, such as: | ||
// | ||
// @property (nonatomic, readwrite, assign) CGPoint center; | ||
// | ||
// You would add a property definition in the C# interface like so: | ||
// | ||
// [Export ("center")] | ||
// CGPoint Center { get; set; } | ||
// | ||
// To bind an Objective-C method, such as: | ||
// | ||
// -(void) doSomething:(NSObject *)object atIndex:(NSInteger)index; | ||
// | ||
// You would add a method definition to the C# interface like so: | ||
// | ||
// [Export ("doSomething:atIndex:")] | ||
// void DoSomething (NSObject object, int index); | ||
// | ||
// Objective-C "constructors" such as: | ||
// | ||
// -(id)initWithElmo:(ElmoMuppet *)elmo; | ||
// | ||
// Can be bound as: | ||
// | ||
// [Export ("initWithElmo:")] | ||
// IntPtr Constructor (ElmoMuppet elmo); | ||
// | ||
// For more information, see http://docs.xamarin.com/ios/advanced_topics/binding_objective-c_types | ||
// | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectTypeGuids>{8FFB629D-F513-41CE-95D2-7ECE97B6EEEC};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> | ||
<ProjectGuid>{1DC35113-BF49-4B3C-BC9B-DF55A421A9E2}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<RootNamespace>Estimotes.iOS.Binding</RootNamespace> | ||
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix> | ||
<AssemblyName>Estimotes.iOS.Binding</AssemblyName> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug</OutputPath> | ||
<DefineConstants>DEBUG;</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<ConsolePause>false</ConsolePause> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>full</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release</OutputPath> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<ConsolePause>false</ConsolePause> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
<Reference Include="Xamarin.iOS" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Folder Include="Resources\" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ObjcBindingApiDefinition Include="ApiDefinition.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ObjcBindingCoreSource Include="StructsAndEnums.cs" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.ObjCBinding.CSharp.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
|
||
using Foundation; | ||
|
||
// This attribute allows you to mark your assemblies as “safe to link”. | ||
// When the attribute is present, the linker—if enabled—will process the assembly | ||
// even if you’re using the “Link SDK assemblies only” option, which is the default for device builds. | ||
|
||
[assembly: LinkerSafe] | ||
|
||
// Information about this assembly is defined by the following attributes. | ||
// Change them to the values specific to your project. | ||
|
||
[assembly: AssemblyTitle("Estimotes.iOS.Binding")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("Estimotes.iOS.Binding")] | ||
[assembly: AssemblyCopyright("Copyright © 2015")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". | ||
// The form "{Major}.{Minor}.*" will automatically update the build and revision, | ||
// and "{Major}.{Minor}.{Build}.*" will update just the revision. | ||
|
||
[assembly: AssemblyVersion("1.0.*")] | ||
|
||
// The following attributes are used to specify the signing key for the assembly, | ||
// if desired. See the Mono documentation for more information about signing. | ||
|
||
//[assembly: AssemblyDelaySign(false)] | ||
//[assembly: AssemblyKeyFile("")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
using System; | ||
|
||
namespace Estimotes.iOS.Binding { | ||
} | ||
|
Oops, something went wrong.