adding a library for iOS app - ios

I am building an iOS app that requires the use of the glm library(link to site). I don't necessarily want to place the entire library in the app folder every time I want to use it. Is it possible to
A) point xcode to the library folder so it knows where to find the headers
or
B) place the library in the standard iOS library folder.
Im sure this is something developers must do all the time, but Ive been unable to find a simple solution on the web.

Related

Importing a .bundle for iOS with executable code

I am trying to make an application in Objective C where a user can download a .mlmodel file from Google Drive and then dynamically load this model as a class and run its methods that come from CoreML's MLModel interface.
Looking at Apple's documentation, it appears I should be able to do this using bundles: "You can make your application extensible by designing a plug-in architecture. This way, you or third-party developers can easily add new features without recompiling the whole application or even having access to its source code."
My existing code downloads their .mlmodel file from Google Drive and saves it to the Documents folder. However, not finding a way to instantiate this as a class, I switched approaches, and will instead download a .bundle file from their Google Drive and then try to make the class from the files within it. I am struggling to find any examples of how to do this. First, I do not know how to get a .bundle file after making an App, setting the principal class, and setting the BundleID as described here. Second, I am concerned that although the documentation seems to indicate that what I want to achieve is possible, I have run across several SO posts that say that running any sort of uncompiled code, dynamically linked code is impossible on iOS. I would appreciate any clarity on the matter.

ios Static Library - how obfuscate directly?

I have an application Unity that uses the iOS static library. Then this application Unity is build in XCode. I found several utilities that allow you to obfuscate the library in the application. for example this - PPiOS-Rename.
I carefully read their documentation "Obfuscate Static Libraries", but at the time of building, the iOS static library are already "hidden in the root" of the Unity app, and XCode cannot obfuscate this.
So I need to first obfuscate the library and then add it to the application. or is it not possible?
In my understanding of the documentation PPiOS-Rename stays an external tool, just the files *.plist can be added into the releases, for being able to use the tool on the compiled releases.
I might be completely wrong about it, especially as without iOS I can't test it, but I'd check if my statement is right and if you can omit the step to include the library in your compiled releases.
About handling of *.plist files, follow the instructions on the linked page, I'm not sure if you have one or more in the end. As it doesn't seem relevant to the core of your question, I never verified it deeper.

iOS Build app extension base on existing app. How to avoid code duplication?

I have an iOS app that add Sound FX to videos. Now I want to build app extension target to support stocked Photo App. However, I have to duplicate almost every codes from the iOS app. And my solution that I have so far is to put common functions in a shared files and use it for both targets, because some codes in the app linked to AppDelegate and I can't use it in App Extension. Is there any better way to avoid code duplication in this case?
One more question: most extensions that I saw on AppStore only have 1 screen, is there any rules for this?
In my app, I have to let users to choose sounds from folder & library, and it requires navigation controller. But Navigation Controller is not usable in App Extension, should I build my own Navigaion Controller or is there a better way?
As long as you don't need to target iOS 7 or earlier, you can put the common classes into a shared framework and load that framework from both targets. This avoids having two instances of the code on disk.
As an added bonus, because of the way the OS handles shared library loading, all of the actual code pages get shared between the app and the extension, so you aren't wasting RAM, either.

iOS custom framework, libraries, and bundles

I have a general question regarding bundles, libraries and custom frameworks on the iOS. I've seen many topics about this on SO and searched far and wide on the net, but I still can't come to an answer without finding another site or post contradicting or confusing me some more. If someone could give me a solid answer to the below questions regarding what is allowed on the iOS or what would get rejected I would be really grateful.
I've seen posts and sites say that you cannot create bundles on the iOS. Does this also apply to bundles with only images in them?
Is it possible to create a library with .xib files in them? If not then how would one go about including one if custom frameworks are not allowed?
Does using a xCode dynamic library put my application for grounds of rejection (ex. libxml2.dylib)?
Apologies if this is too general or mentioned multiple times, but this whole library and what is allowed and what isn't allowed just doesn't seem to be very clear for me. What I am trying to do is to create some apps and perhaps include some controls that I frequently use in some sort of library or bundle, but I would like to know my limitations before moving further.
1.: No, you cannot create any framework even if it contains images only, as you can't write to the root partition of the iOS filesystem (the part where /System/Library/Frameworks resides).
Of course, if jailbreaking is an option, then all this stuff becomes invalid. You do what you want with a jailbroken phone, so you can create frameworks, add libraries to the filesystem etc.
2.: Yes, it is possible to create a library with XIB/NIB files with it, but then you'll need to share both the source or a static library built from the sources AND the XIB files and guide the other developers to do so in order iOS to correctly handle your library and be able to build the UI from the InterfaceBuilder files.
3.: No, because those libraries are already on the iPhone, you don't have to hack it to get them on the filesystem. libxml2, libsqlite3, etc. are allowed and can be used in any AppStore app.

Can PhoneGap be used in apps built with theos?

I want to use PhoneGap to make a Cydia app, however the iOS instructions on their website only show how to use it with Xcode.
I don't have a Mac, but I'd like to be able to make my app for Cydia, with theos. Is this possible with PhoneGap, or is it only usable with Xcode?
I've never done this, but YES it should be entirely possible. The Xcode instructions set it up for you to have a specific template with all of the phonegap files already in the proper locations. So it's easy to get going. But it doesn't do anything else that is particularly special. Theoretically you could simply setup all of the files in a theos project.
To do this you will need to 'reconstruct' exactly what goes into a phonegap template. I have no experience with theos, but a rough idea of what you will need to be able to do includes the following:
Import PhoneGap.framework
Reconstruct AppDelegate code
Import Supporting Files (PhoneGap.plist)
Additionally you will need to configure the folder structure with the www folder (that the webview loads from) including the index.html file and the phonegap-1.0.0.js file.
So yes, it should be possible. Let me know if you are successful. Good luck!

Resources