Include Rstudio script in i OS swift project - ios

I am building an application in swift for iOS. I have also built a project in RStudio that generates complex graphs from a user's raw data. I would like to embed these graphs into my iOS application.

Related

Exporting from Azure Custom vision to ios CoreML doesn't work on xcode or ios

I am using the Azure Custom Vision service customvision.ai for data labelling. I trained my data from Azure and it can detect the objects via API or via quicktesting from the customvision.ai. I exported it to CoreML by the insturctions from Microsoft's documentation, but I couldn't make it work for ios or xcode.
There is a preview tab for coreML files on xcode. The sample models I downloaded from the internet works as expected. However, I cannot get the expected results for my model from xcode, compared to the API or quicktest via website.
How can I get it work on my ios app. I am using General (compact) [S1] domain for my model.
Progress Update:
I have found a sample code from Azure's github. It works with their model. However when I change the model and config files to my ones, it throws Bad access error somewhere.
Also I recognized the exporter versions are different and there is an extra metadata_properties.json in my version. So even if the readme from the repo states any 2.x version is supported, (mine is 2.1 but their model is 2.0) I guess that sample code doesn't support the version I exported.
Can I downgrade my model's version or are there any sample swift projects for the updated version.
Changing the domain from General (compact) [S1] to General (compact) [S1] and feeding this new model into my project fixed everything. I don't know if this was coincidence but without replacing a single line of the code, it worked.

Is it possible to do code analysis of an iOS framework?

I have a requirement where we need to perform code analysis to find vulnerabilities like how sonarqube does for an iOS Project, not for the actual swift files but for .framework created using the swift files.
Is it possible to do this using sonarqube or swiftlint? Are there any code analysis tool available to analyse the .framework?

Binding a Swift library to use in Xamarin, without Mac OS, is it possible?

I have not used Xamarin before, I'm coming from a native development background.
I have a question about the feasibility of binding a native iOS library written in Swift, in order to use it in an Xamarin project. Is this possible and more importantly is it possible to do without any access to a Mac OS computer?
As a side question, is Objective-C library binding doable without Mac OS?
To do the entire process: No.
You can create a Xamarin Binding project from within Visual Studio, but there are a lot of dependencies you will need that you can only get by having access to a macOS.
1 - If you don't have the compiled and fat library you will need a macOS to build using Xcode and use Lipo to create the fat library.
2 - Supposing you already have it, you will need to create the ApiDefinition.cs, to do so you might use Objective Sharpie (macOS only). You can get around it by creating it manually, but unless you are binding a very tiny library - just for the sake of proving the point - you will not want to do so.
Those two apply to any Xamarin.iOS Binding, as it is the same process for Objective-C Bindings
3 - For Swift Bindings you will also need to include all Swift dependencies inside SwiftSupport folder inside your IPA file. This step is required before publishing the App, not creating the binding - I have only tried to do so using a shell script. But for this case you need a macOS to publish the app to App Store as well.
So just to prove the point: Maybe.

Using java code in ipad application

I have .jar file containing java code (Business Layer) of an android application.Is there anyway i can use the same .jar file for developing corresponding iPad application in xcode?
Since ipad applications are built using objective c,you must convert your java code in jar file to objective c.Use the tools like j2objc
http://code.google.com/p/j2objc/
Also refer:
https://stackoverflow.com/questions/4185334/is-there-a-good-java-to-objective-c-converter

Shared code base for iOS and OS X development

We have a fairly rich e-learning app, built mostly using cocos2d. Currently we are in alpha and want to setup our project structure so we can also build a Mac version to target the Mac App store. It is about 80% cocos2d with some intitial screens in UIKit which will have to be ported to Mac (re-written).
What is the recommended setup for targeting both the Mac and iOS app stores from a single code base? I assume the choices are:
Create 2 xCode projects in the same application source code root folder and use each project to build a single target. This would be: Project.xcodeproj and ProjectMac.xcodeproj
Add a new Mac target to our existing iPad application project and then fiddle with target membership to get the desired results. This would be just: Project.xcodeproj
Further complicating the situation is that we currently use cocos2d as a static library for the iOS app. We also have a library called CoreInfrastructure that has a lot of code we use across all our projects. Recently I have figured out that I can create a project to simultaneously build a framework targeting Mac and a library targeting iOS from the same code base. This is done by starting with a framework project and adding a target to build a static lib for iOS.
So just wanted to get everyone's opinion and insight. Anyone know of any caveats to watch out for in the above choices? Anyone who is building for Mac and iOS app stores simultaneously care to share their structure? Adding a target worked on our library code ... is that the way to go for the application as well?
Are there any issues doing archive and distribution builds for either choice?
Thanks in advance.
WWDC session "Sharing code between iOS and OS X" answers all the basic questions in this topic. iWork team presented how they have got away with creating Pages, Keynote and Numbers with shared code base for both iOS and OS X.
The key for their project was using:
separate Xcode targets for iOS and OS X
separate project for the shared code in a form of a .framework
target dependency on the framework from the point above
I encourage to watch the video or read the transcript from this session:
WWDC 2014 Sharing code between iOS and OS X
ASCIIWWDC transcript
I recently used kstenerud's iOS Universal Framework to build a shared framework codebase that works for both iOS and Mac apps. I just needed to manually add a target for a Cocoa framework after I had created a project for an iOS framework. That way I can develop the sharable code once in the framework and link it in both the iOS and Mac apps. You can even make the framework contain UIKit-specific code for your iOS app and AppKit-specific code for your Mac apps. I wrote about it in my blog if you are interested.
For the applications use two separate projects. Using multiple targets for iOS and Mac in one project is very useful if they are sharing a library or framework. However, in your top level application almost nothing is shared. The UIKit code will need to be totally rewritten to use AppKit, the dependencies will be different, and even most of the project settings will vary.
Of course if you really want to see everything at once you can put both platform specific application projects and all the shared dependent library/framework projects in a single workspace. This is more a question of work style. If you want to switch back and forth between the two frequently this makes the most sense. If you want to simplify what you are looking at you can put them in separate workspaces that share many of the same projects. Separate workspaces has the disadvantage that a project can only be open in one workspace at a time so you effectively can only work on one at a time.
I just use multi-platform static library targets for the shared sources. You will need to expand that to the dependencies, however. If you have platform dependent implementations, you may want to create supplemental export libraries for those symbols.
So your structure might take this form:
CoreInfrastructure - cross platform static library.
PlatShared - cross platform static library.
PlatSpecific-OS X - OS X static library (or framework).
PlatSpecific-iOS - iOS static library.
The OS X app links to CoreInfrastructure, PlatShared, PlatSpecific-OSX, Cocos for OS X, and system libs.
The iOS app links to CoreInfrastructure, PlatShared, PlatSpecific-iOS, Cocos for iOS, and sys libs.
Problem (I've found) is, there are a lot of people who have not had much/any experience developing and maintaining complex project structures in Xcode. It's a pain (IMO) to setup duplicate targets, and properly maintain them as they grow -- even when they all refer to the same source files. That's why i prefer minimal targets and proper dependency structure.

Resources