How to pass objects/data between my iOS applications - ios

I have an existing iOS application on the app store, and I am building a new companion app to work with this existing app.
I need to pass objects/data from this new app to my existing app when a certain action is taken. The behaviour I'm looking for is very similar to AirDrop but the data is passed to another app on the same device.
The objects I want to pass locally between apps are simply NSObject's.

As per your comment you wants to share NSObjects between your iOS apps. The best approach would be "Custom URL Schemes". But in this approach you may need to add or re write some parts in your old iOS App as well.
checkout this SO Answer for more info on implementing custom url scheme and history of sharing data between ios apps.
Apple documentation for sharing data is also available.
If your app supports greater than iOS 8 you can also use the new feature called "App Group Functionality"

Related

How updating dynamic framework will affect App Store build

I have an app on the App Store and I have to create another app. This other app has some of the same functionalities as the first app. So I wanted to create a framework to put the common code in and use it inside the apps. Unfortunately, this framework has to change to add more features and improvements.
I saw that dynamic libraries can update the library code without any change to an app already pushed to the App Store. But this is reserved for Apple. Also, since iOS 8, we can create a dynamic framework which includes dynamic libraries. So is it possible to have the same, meaning if I update my dynamic framework, it also updates the app without having to push to the App Store again and face app review process?
If not, do you have some clues/recommendation to achieve that?
Dynamic Framework is a bit different from the understanding you have. Please read apple documents in more detail for that.
Currently only way to achieve what you expect is to push code on App Store as hidden, and based on some server API configuration update your content accordingly (Firebase Remote Config is one such good example if security is not that big a concern)

Swift - how to access all pdf files on device

I am trying to build an app that will allow users to see all pdf files that are on the device (in some kind of a list with a preview) [Regardless of which app it belongs to on the device, all should be shown]. Is there anyway to achieve this?
Sorry but this is not possible on an iOS device because of a feature called sandboxing. Apple does not allow an app to access the sandbox of another app. Each app sits inside a sandbox of its own. This is iOS's security feature. There is no way to go around this feature.
Reference - About App Sandbox

Role of framework in between Extension and App in ios

I'm bit confused about the concepts of Extension in ios. After going through some tutorials I still have doubt how an app and an extension in ios communicate each other, does this has to do anything with Framework. If Yes, why we are adding Frameworks...
Hoping for a response, Thanks
App extensions are not stand alone apps. They are providing extended functionality of the app (which can be accessed from main app, called the host app) that is meant to be efficient and focused towards a single task.
For example, Today widget in iPhone is an extension. We can create a today widget for an iOS app which is an extension of the existing iOS app. For example, let us consider an app which shows current weather in detail. Then you can create an extension for this app, to show only current temperature without much detail in a widget.
The extension uses the data which is shared between both the main app and the extension. Embedded framework is a technique to share same code between two targets. You can share data using NSUserdefaults and app group concept.

App Groups and iCloud in iOS

I am familiar with iCloud syncing, but I am new to app groups. There may be a simple answer to this question, but I haven't found it yet. Basically, I have an app in which I have iCloud integration, and now I want to try to add a today extension. I am currently using Core Data as a backend and would like to continue to do so. However, from what I have read, I need to move my data store to a shared location by defining an "App Group". (http://blog.sam-oakley.co.uk/post/92323630293/sharing-core-data-between-app-and-extension-in-ios-8 and Accessing Core Data SQL Database in iOS 8 Extension (Sharing Data Between App and Widget Extension)) I haven't been able to find out if this location is synced using iCloud or not. Or, because I"m using iCloud, do I need an App Group at all? I appreciate any and all help/suggestions.
If you're already using iCloud, you don't need to use app groups, because your extension can access the same iCloud container as your app does. As long as your entitlements and provisioning are configured correctly, you can literally just use the same Core Data stack setup in the extension as in the app.
Apple's Lister demo project does this, but there's nothing special about it. Just use iCloud as usual.
App groups are usually necessary to share data between apps and extensions. But a big exception is when the data is already stored external to the app-- as with iCloud.

Bundled iOS app using two IPAs

I am exploring into the possibility of creating a bundled app out of TWO of my apps (app1.ipa & app2.ipa). Is it possible to create a shell app (bundle.ipa) which would load app1 or app2 using their respective ipa’s (app1.ipa or app2.ipa) based on user selection? Or Do I have to merge the source codes and assets on both apps to create a bundled app? Basically, is it possible to load an ipa with-in an ipa?
No. It's not possible to create apps with more then one binary.
Instead of trying to have more than one .ipa - which I'm pretty sure isn't possible - creating a class by which the app can introspect whether or not the person has paid for the app. So if they have, the feature is available, and if not... its not available.
Use Facebook's SDK integration as a reference of how this works: before an app can retrieve items from the user's Facebook, the app must make sure that the user has signed in with Facebook.
I wish I knew of a more precise example, but honestly, this should give you the gist of it all.

Resources