Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you run an iOS app inside another iOS App [closed]

Is it possible for me to write an application that is supposed to be a wrapper around a few other applications and then run those apps inside my main app?

The idea is there's going to be a menu I just want to write once, but I want to integrate it as the very top layer of a number of other applications.

Another way I thought of is possibly creating a UIWindow at the top level and running it in there but I'm having issues passing touches through.

Thanks!

like image 353
Brian L. Clark Avatar asked Sep 18 '25 01:09

Brian L. Clark


2 Answers

I think this is the wrong approach to take overall. If you want your code to be reusable, write a library.

like image 65
Matt Ball Avatar answered Sep 20 '25 16:09

Matt Ball


You can't host 'multiple applications' in one app, because as far as I know, Apple's sandbox prevents this, and only allows apps to run one at a time.

You have a couple options to emulate your desired functionality, though:

  • Use a UINavigationController or UITabViewController to navigate between different viewcontrollers, thus allowing the top level menu to lead to different 'functionalities' within the app. (meaning you don't really need to explicitly use UIWindow; you can use Storyboard and Storyboard segues to hook up these different functional parts) Advantage: it's all one app. Disadvantage: one listing on the app store.

  • Use custom URL schemes to move between two separate iOS apps. Every iOS app is (usually) its own project, (if you don't count 'targets', which can omit specific files from each build) and not every app is installed on every device. But assuming a customer has both of your apps, you could open one app from another using such a URL scheme, and even pass data. My own app uses a URL scheme to pass data from the 'lite' version to the 'pro' version. Advantage: multiple listings on the app store. Disadvantage: won't work if the user hasn't installed both apps.

  • Reuse the 'top level menu' code in multiple apps, and then do some logic so the app only uses the custom URL schemes when your other apps are installed. Then you could also lead them to the app store page for any apps they haven't installed yet. Advantage: multiple listings on the store, unified experience, and brings user to app store if the app isn't installed yet. (I haven't yet implemented code to check whether an app is installed... Looks like this question has been asked here.)

Edit: I read your other question. It looks like by 'top level' you mean something that is graphically sticky on the screen, and is not removed by other views as the user navigates the app? I'm not sure how to do this with Foundation, but you might be able to do it with Quartz2D (geared toward utility apps) or Cocos2D (geared toward games).

like image 22
Ben Avatar answered Sep 20 '25 15:09

Ben