0

I am working on an application where I want to have some way where I will be able to run only selected project target at run time, maybe on click of a button. But I am not able to get the idea of how to link these targets and call the appropriate one at run time.

Below are some screenshots of my project:

Screenshot 1

Screenshot 2

Here, I have created multiple project in a single one. But getting confused about how to connect these.

What I want is, for example, if I click on button 1 on login page, then only first project should run and similarly, if I click on button 2 , then only second project should run, and so on.

halfer
  • 19,824
  • 17
  • 99
  • 186
Muju
  • 884
  • 20
  • 54
  • are you talking about to do this from xcode or from running app? – Ellen Jul 26 '17 at 11:44
  • no , because you need to select manually targets, once application runs its compile resources for only one project. – Matloob Hasnain Jul 26 '17 at 11:47
  • right. but could you explain more in detail then what are you trying to do. – Ellen Jul 26 '17 at 11:51
  • i want this when i run the app @Ellen – Muju Jul 26 '17 at 12:02
  • Means i have two different types of projects, and i want the user to select the type of app he wants to run. For eg, If he selects country 1, then the project for first country must run, and if he select country 2 , then project for second country must run. All this should be happening at run time. How can we achieve this? – Muju Jul 26 '17 at 12:05
  • @Ellen Actually I created multiple project in one single project. When I run app first screen will be same for all when I click on button it will change project target and rest file will call from that project. Is it is possible because creating multiple project is possible. – Muju Jul 26 '17 at 12:09
  • @JoshCaswell this question is not duplicate because I am trying to open different project not a different app. App must be same and different project will open on button click. How to do this?? – Muju Jul 26 '17 at 12:24
  • There's no project or target after you build and install. You have one app. Anything you want to do needs to be in that one app. Or it can be in a completely separate app that is also installed on the device. What I linked you to is how you do the latter, because that's the only way to do exactly what you're talking about. – jscs Jul 26 '17 at 12:27
  • @JoshCaswell Is it is possible to change project target on button click. – Muju Jul 26 '17 at 12:29
  • It is not possible. – jscs Jul 26 '17 at 12:30
  • @JoshCaswell Can you Please tell me other way how to achieve this thing without creating multiple app.Is there is an way to call different target view controller not a whole target. – Muju Jul 26 '17 at 12:32
  • [What is a "target", in plain language?](https://stackoverflow.com/questions/20637435/xcode-what-is-a-target-and-scheme-in-plain-language) [What are "targets" in Xcode?](https://stackoverflow.com/questions/12056213/xcode-targets) – jscs Jul 26 '17 at 13:09
  • You can not load any framework/code at run time which is not linked in your target as per Apple Guidelines. You can have your assets etc as ondemand resource content & can download as per your requirements.https://developer.apple.com/library/content/documentation/FileManagement/Conceptual/On_Demand_Resources_Guide/ – Ellen Jul 26 '17 at 13:21

1 Answers1

0

If you have more than one target app, go to set the active schema menu (next to the stop build target) and choose the respective target app and run.

Balasubramanian
  • 5,274
  • 6
  • 33
  • 62
  • ok. But i want this to be happening after i run the app , and allow the user to select the appropriate project which he wants to run. Is this possible?? If yes, then how. If no, then is there any alternate to it? – Muju Jul 26 '17 at 12:07