I am trying to make use of an swift based iOS Framework in xamarin.iOS
But after some research, I found that xamarin doesn't support swift language using Embedding Mono too.
How can I make use of Framework in Xamarin.iOS ?
Binding Objective C based static library is officially supported in Xamarin.
But there is no official support for Swift based framework in Xamarin.iOS
You can import Swift based framework in Objective C based project and
you can expose the APIs using Objective C and you can convert that into .a static library then you can turn that static library into a binding library in xamarin studio and make use of that in xamarin
Try porting the Swift to C# and it should be faster as well
Related
I have developed a UWP class library , and it is already used in various projects.
Now I want to make this UWP class library to support WindowsAppSdk apps too.
When I try to refer UWP Library in WindowsAppSdk app, getting error like "Project is not compatible".
My UWP class library min supported version - Windows 10 fall creators update (16299).
Should I recreate my UWP Library as WindowsAppSdk library ?
Can anyone help me understand this
Thanks
Noorul.
Should I recreate my UWP Library as WindowsAppSdk library ?
No, but you should convert it into a .NET Standard library that can be consumed by both UWP and WinUI (.NET) applications, and any other type of application whose runtime implementation supports the version of the .NET Standard specification that you choose to target.
UWP apps cannot consume librararies that are targeted against a specific platform such as .NET and vice versa. That's where .NET Standard comes in. It enables you to share code across multiple .NET implementations and platforms.
I've recently started learning about Xamarin so please bear with me. I'm not sure if this is an obvious question
Creating a cross-platform mobile app in VS2017 will create 3 projects: Xamarin.Forms, iOS, Android.
So in my Xamarin.Forms project I was able to add a map to my Form, and now I can see the map in my Android emulator. That works great. I havent't touched the other two projects.
Now I have to add some functionality that's native of each platform, so I would need to go, for example, to the Android project to add the widgets, logic, etc.
Is C# used in these native projects or do I need to learn a new language?
I'm asking because Android Studio uses java and iOS uses Objective C, so I'm not sure if I need to learn these languages for cha
If you check the Microsoft website for Xamarin.Forms it answers your question then and there;
Xamarin.Forms expose a complete cross-platform UI toolkit for .NET developers. Build fully-native Android, iOS, and Universal Windows Platform apps using C# in Visual Studio.
But even F# is available as an option.
As far as your platform-specific question goes there is a whole separate guide that teaches you how and when you need platform specific code which can be found here
Is C# used in these native projects or do I need to learn a new language?
I'm asking because Android Studio uses java and iOS uses Objective C, so I'm not sure if I need to learn these languages.
Yes, that is the whole point for the Xamarin native and Xamarin.Forms framework that pure C#/F# developers can become mobile application developers without learning a new language.So existing .Net teams can execute mobile projects.
But in some cases, you might have to convert native Java and Objective-C code to C# so it's always better if you have a basic level of understanding in them.
I will suggest you read the Code Sharing Strategies available in Xamarin Forms before deciding which method do you wanna follow: I personally and the Community prefers using The .Net Standard methodology to share the code you can choose for yourself.
Good luck with your future endeavours and feel free to revert in case of further queries.
Yes, all Xamarin projects use C# (or F#). You do not need to use java or Obj-C/Swift, although there are ways to incorporate native libraries written in those languages into Xamarin projects.
Xamarin has a entire section of docs on how to incorporate platform specific behavior into a Xamarin Forms app.
I'm integrating WebRTC in a Xamarin.IOS app, and working through making the required C# bindings for the WebRTC library.
All of the info I've found on the web involves wrapping the Objective C framework with the help of Objective Sharpie, but the WebRTC iOS/MacOS framework seems to only be an Objective C wrapper around the internal C++ WebRTC library, so my question is:
Won't I be better off using P/Invoke around the native WebRTC C++ library and cutting the Objective C part out of it? Has anyone done this, and how?
I'll be doing an Android version of the app next. If I make a Xamarin Binding for the C++ lib, will I be able to use the same binding project for both iOS and Android versions of my app?
I am trying to port cocoapods to xamarin.
Objective C based cocoapods can be ported by converting it into a static library(.a) and subsequently converting that as binding library in xamarin studio or visual studio
But Swift based cocoapods can not be converted into a static library and so it can't be ported to xamarin.
but swift can be converted into a dynamic framework but I couldn't find any way to port that to xamarin
Is there any other way to port swift based cocoapods or ios project into xamarin ?
Binding a Swift Library in Xamarin.iOS follows the same process for Objective-C as shown in xamarin documentation
but with some caveats.
A swift class must inherit from NSObject to be binded.
Swift compiler will translate class and protocol names into something else, so you must specify the final name in the
ApiDefinition.
In runtime your APP must include some swift core libraries alongside your binded framework in a folder called Frameworks;
When the App is pushed to AppStore it must include a SwiftSupport folder alongside your Payload folder. Those are inside the IPA file.
Here you can find a simple sample binding: https://github.com/Flash3001/Xamarin.BindingSwiftLibrarySample
And a full binding sample: https://github.com/Flash3001/iOSCharts.Xamarin
I'd like to look into the possibility of building a (cross-platform) library (no UI) using MonoTouch. From what I've seen so far, the Mono project looks like a very good candidate for such an endeavor.
Can MonoTouch compile libraries or frameworks for iOS?
It can compile them for use within MonoTouch apps for iOS, however don't expect it to compile into a native library that an obj-c application can then utilize...
checking here:
http://xamarin.com/monotouch
CROSS PLATFORM
Easily share code between iOS, Android and Windows Phone 7.
and then:
C# & .NET
Everything you love about .NET, including LINQ, Delegates and Events.
so apparently the answer is yes :)
also check this one: http://blog.xamarin.com/2011/10/12/monotouch-5-with-ios-5-support/