Network calls are taking around 6-7 times more time on Kotlin Multiplatform mobile compared to native when integrating in Xcode for iOS - kotlin-multiplatform

Generated a framework for a demo project / POC to be integrated in Xcode, but when comparing the network calls I found a weird 6-7 times more time taken for network calls done through KMM, compared to the same calls when done in native swift.
I tried search a lot online but couldn't find any resource / use case who could have faced a similar issue with KMM in iOS.

Related

How do I send messages from my swift file to Unity (NOT from Unity to swift)

I have been having the hardest time watching tutorials and reading documentation on how to bridge Unity and Swift together. It seems most people are looking for a way to have Unity send messages to the swift file. I am looking for the exact opposite. I would like to specifically send screenshot detection messages back to my Unity project.
So far, I have tried using the NotificationCenter.addObserver methods.
Combined with the built-in "UnitySendMessage" function (in the XCode main.mm file) I was expecting it to update my Unity project with no problem.
Is there anybody else that has achieved this?

Can I use apple libraries like CoreML and PencilKit with react-native apps?

I really want to make use of the pencil kit in my react-native application. I just want to know whether I can do it. If yes, then how?
TLDR: Doesn't exist as of 2/6/2021 and you will need to write bridge code between react native (js) and native (swift/ObjC). There are big performance limitations with this approach. I recommend you create a native Swift based app for your project.
I was also curious if this is available.
For those willing to use Swift, here's the sample shown during the demo.
For those that want to use PencilKit / CoreML native libraries from React native you need need to write bridge code between Javascript (please use typescript) and the native code.
Here's more information on bridging and a guide.
For me, I will be building a note taking app and it needs to be performant. Despite being a react / react native developer I will be choosing Swift to build this project due to performance concerns.
Last point to make is that you can use react native and native together. But this is more of a headache than an enabler. AirBnB used this for some time but moved away from this approach.
For anyone new to React Native, it's a great platform. I personally like to use it for simple applications (not graphically intensive). You can also use it with the Expo tooling which speeds up prototyping but be warned some functionalities are not available bluetooth is one example.
Yes I Did it.
I created a native view for iOS Pencil Kit in React Native with Swift.
You can check basic examples for native module in my Repo

Confusion about swift framework build processes

Im currently working on a Swift Framework using OpenCV (3.4.3), and im having some troubles or getting confused about how the build processes work.
Note I'm not using CocoaPods, Im using the framework file/folder provided by OpenCV
So my problem is that I'm creating the swift framework that depends on OpenCV, once I've built my framework and add/link it to a App (Its added to the embedded frameworks section), the app runs fine with no errors. This is where my confusion lies, I would expect to also add OpenCV to my app then have them link at runtime/compile time, but that's not the case OpenCV is magically linked and working. I have also double, triple checked that there is no references of OpenCV in the app to ensure its not getting pulled in anywhere.
For some sanity checks I created a basic framework called TestFramework, which had 1 class, with a static function just so I can test the above process. I added TestFramework to the main framework im working on, and built it. I then added that Framework to my app, and it would not build because the TestFramework was not present in the App as a dependency. Then adding the framework allowed it to build, and the main framework then was able to call the code within the TestFramework.
There seems to be some discrepancy between how the two work, unless the OpenCV framework is built in a different way allowing it to work without the app depending on it.
Any help or thoughts would be great, thanks.

combining flex UI with native objective c into single ios application

I am running out of time can anyone suggest me a good solution for my problem
Problem:
I am working in a ios project in which they have a UI designed already in flex a year ago..Now I have done all the backend coding with objective-c using apple native (IDE) xcode ,Now i dont know how I am going to combine the flex UI with the backend Objective c coding to integrate into a single application.
With Adobe Native Extensions you can do it, but I warn you, it'll be a hard game to get it start. http://www.adobe.com/devnet/air/articles/building-ane-ios-android-pt1.html

iPhone PhoneGap restKit / jsonkit duplicate symbols

I was ask to take a existing website make it PhoneGap so all went well I converted it to backbone included phonecap.js for the more funky stuff. Then I was ask to create a AR view so I told the people I will do this in native rather because I am not sure it will be possible in PhoneGap or it will just take to long.
So I created a separate project where I did the AR component tested it and it worked fine. It uses RestKit to download data and then in camerapreview shows little bubbles representing data.
This week my job was to combine them so you click a button in PhoneGap and then it opens the native viewcontroller. Again all went well. I created the plug-in it calls the function so next step was to copy all the AR logic over and that where all hell broke loose.
I keep on getting duplicate symbols a whole lot of them I spend 6-7 hours trying to solve it but nothing I went thru 100 of websites with different solutions and none worked.
So 3 o'clock I decide f* restkit let me use just jsonkit and do the mapping myself but the same thing happened duplicate symbols and each time it cordova / PhoneGap and then the library.
Am i doing something wrong or is cordova just no good?
Found the problem. Basically my application and the library I used RESTKit/JSONKit used the same library. So to fix you remove the library that's conflicting either from yours or from the library most cases just remove yours. And then reference the libraries library .h file if you removed yours.

Resources