.NET to Xamarin iOS?

chairmanPC

Member
Joined
Apr 19, 2021
Messages
24
Programming Experience
10+
Trying to port a C# winform .NET project to Xamarin iOS version. I wonder if it's possible to do so.
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
3,364
Location
Chesapeake, VA
Programming Experience
10+
It depends. Is it purely a WinForms program, or does it just happen to use WinForms as a shell but does a lot of Windows specific things like calling native methods, send messages, or do other platform specific stuff?
 

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
3,904
Location
Sydney, Australia
Programming Experience
10+
It depends what you mean by "port". You will have to build a new UI but you may well be able to use some or all of the same libraries, so make sure as much of your code is in platform-independent libraries as possible.
 

NoUserHere

Well-known member
Joined
Sep 5, 2018
Messages
2,138
Programming Experience
10+
Short answer is yes, with moderate difficulty!

What the Jm and Skydiver are saying regarding "depends" and to elaborate... It depends on your code, and whether or not you write code properly, by using API's correctly, interfaces, etc. All of these will not be portable since iOS has different targeted API's and you will need to rewire them. Your UI can not be ported, and this will require you to build your UI from scratch as there is no magic tools that can do this for you. You can use the The .NET Portability Analyzer - .NET to analyse your current project, and this will tell (roughly) how much of your current application can be ported to your target platform. In iOS, you will use native iOS design surfaces or storyboards to build up your ui, as xaml is mainly used in forms development. While this will be a new experience, its nothing you can't learn.
 
Top Bottom