Amruta
Amruta

Reputation: 425

Using Swift library in Xamarin

The article https://developer.xamarin.com/guides/cross-platform/macios/binding/ mentions how a native library written using Objective-C can be used in Xamarin. Is there any documentation available for doing the same with a native framework written in Swift? https://developer.xamarin.com/guides/ios/advanced_topics/embedded_frameworks/ talks about using embedded frameworks but it does not say anything about swift. Does the same thing work?

Upvotes: 6

Views: 6081

Answers (2)

Alessandro Morvillo
Alessandro Morvillo

Reputation: 49

Sorry to reopen a death thread, but binding Swift library is now officially supported by Xamarin.

https://learn.microsoft.com/en-us/xamarin/ios/platform/binding-swift/walkthrough

The procedure is very similar than the one needed to bind Objective-C libraries. In fact, Swift is compatible only with Swift, and a Swift framework to be accessible to Objective-C or Xamarin needs to export Objective-C headers.

Upvotes: 0

Lucas Teixeira
Lucas Teixeira

Reputation: 734

Binding Swift libraries is not officially supported, but you can find a documentation on how to do it:

https://medium.com/@Flash3001/binding-swift-libraries-xamarin-ios-ff32adbc7c76

Upvotes: 4

Related Questions