Search code examples
c#ios.netxamarinnative

C# Native IOS with .NET


I was looking to start learning Xamarin and IOS development. A book I found had in its description

for building native Android, iOS, and Windows Phone apps using C# and .NET.

This put my off completely. I thought native is synonymous with unmanaged code, but then how can it be using .NET?

No doubt, my understanding of these terms are flawed, so when clarifying, can you try to be as simple as possible as to take into consideration a lack of knowledge.


Solution

  • At the end of the day, the application has to run using the native code. .NET brings its APIs and garbage collection on the top of the native APIs and acts as a middle layer between the application and native APIs.

    But in doing so it may do it in a way that it supports only its own subset of APIs (with the ability to P-invoke non-supported APIs), or that it also supports all native APIs. Xamarin supports all native APIs out of the box. That is why it is called 'native'.

    The second thing is that application code can be converted to native on the fly or it might be precompiled. Microsoft also calls this precompiled code as .NET native in UWP (https://blogs.windows.com/buildingapps/2015/08/20/net-native-what-it-means-for-universal-windows-platform-uwp-developers/#eZpcAqAsHbO5CMeU.97), and it can be compared to what Xamarin does.