Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interoperability of Xamarin.iOS and Swift

For an existing App written in C# using Xamarin.iOS is there a way that Swift can take over and use the existing App as a library?

The App uses different frameworks like Vici CoolStorage, Google Maps, SQL Cipher and they are all included in the C# Solution, so I think that it will be very important that they stay in the C# Solution, but are accessible from the Swift part.

I ask this because Swift looks very good to me (I always liked scala) and it seems to me that Xcode has improved itself a lot, so I would like to try to get closer to the iOS, but I do not wish to lose the complete effort that was done for the App (months of development).

like image 375
n.t Avatar asked Sep 02 '25 07:09

n.t


1 Answers

This is not currently possible.

What you could do is keep the main code in C#, and call into Swift from your C# code. You would have to do this by creating a Swift library and surfacing the result to Objective-C, and then provide a binding to the Objective-C code so that you can call it all from C#.

A simpler option is to try F# directly with your project, which is a complete functional language with pretty much all of the features of Swift and a few more.

like image 161
miguel.de.icaza Avatar answered Sep 04 '25 20:09

miguel.de.icaza