What is the right way to "save as" an iPad project? - ios

I would like to build a new project based upon my existing. Since there are internal names that need to be changed to correspond with the project file names, I don't know the simple way to accomplish this without a mess.

Here are steps I have done:
Copy the whole folder of that project and rename the folder to whatever new name you want.
Following the direction in the answer from this SO to change the "product name".
That is it.

I would suggest you do NOT "save as" any project. Because to handle two copies of a same code is very very painful.
If you just want give your project a new name or make some new build settings, add a new "target" is good enough.
And if you want to use your existing project in another project, simply add it as a sub-project is a better way.
But just try to avoid to have many copies of one code, it's hard to maintain in the future.

Related

Create a framework from existing iOS project

I'm new to iOS development and I got this project and need to convert it to a framework so that I can simply add it into different projects. Can someone please help me with this.
I tried different tutorials, but all of them is to create one from new projects
When you want to make a framework, or module, from a project, the first thing you’ll need to do is, if you don’t have one already, make an Xcode project workspace (File > Save as Workspace) . The next step is to add a new framework “project” to your workspace (that could’ve been why you saw some resources telling you to make a new project) with File > New Project and choosing Cocoa Touch framework. When you add it, make sure you pick your workspace under both Add to and Group. Then you will need to migrate in the files that you wanted to be in this module — make sure to choose copy items if needed.
Here’s an article with more specific details on the process if you need it:
https://medium.com/kinandcartacreated/modular-ios-splitting-a-workspace-into-modules-331293f1090

How to copy paste my Mvc asp.net project?

My project name called Hotel, and I want to create another project called Hotel2 containing all files of Hotel for testing purposes.
What are the steps to copy it without getting any errors?
I've tried doing this a few different ways. I've found the safest way is to create a new project, add the files/components you need, and copy the contents of the files from project Hotel to the blank/default files in project Hotel2.
There is no fast and easy way to do it. If you try any shortcuts, it almost always causes problems and more work.

Loading a different plist depending on the target

I thought it would be interesting to attempt building multiple apps using the same code base, where the only differentiating data is held in a few plists. For example, one plist holds some theme info - a few key/values to drive the color scheme used in the app. I'll call the original version of this theme.plist.
I soon learned that I should create multiple targets in my project, and have been able to add these successfully. Each one, via it's own appname-info.plist, has a different name and bundle id - it's neat seeing all three on my home screen without any real extra work.
But right now they are all identical. I haven't figured out how to use a different set of data for each one.
My first thought was to have some folder for each target - each with its own theme plist named theme.plist - and somehow distribute each target with a different folder. But researching that idea doesn't get me much google juice.
So what about multiple theme files? Ok, so far that looks better - I can create an app1-theme.plist and 'app2-theme.plist' with different values for the same keys in each. And Xcode even lets me use some flags to say which targets should include each resource.
But I don't know how to load the appropriate plist at runtime. I need to examine something (the bundle ID?) and then assign the appropriate name of the theme plist to something (what)?
It seems like this might have something to with #ifdef, whatever that might be...?
Can someone explain how I should be looking to accomplish this? Am I on the right track? I'm happy to put some reading time in but I don't even know what to look up yet.
You are just about there. Xcode supports having multiple files with the same name in a project, one way you can do this by storing them in different folders within your project folder.
Unfortunately at this point Xcode won't give you a lot of help, so open your project in the Finder, create one subfolder for each of your apps, in those folders place a copy of the plist. Now add each copy in turn to your project, making sure you add each to just one of your targets.
You might want to create a group in Xcode called, say, "Theme files", to keep them altogether.
HTH
What you are trying to do is trivial. If you select a file from your project, and bring up the "File Inspector" in the utilities area (Press Command option 1) you should see a section "Target membership". Each target in your project will be listed, with a checkbox next to it. If you check the checkbox for a file and target, that file is built into that target. Un-check the checkbox for a file and target and that file is not copied over to the specified target (you may need to run a clean, and delete the app from the target device, to get rid of files that used to be included but that you have un-checked. Xcode generally won't automatically remove things that used to be included.
You could create a directory in your bundle and teach your app to scan that directory for plist files. Then include a different set of files in that directory for each target and each target app's behavior will change.

Duplicating a project and changing its name

I was creating a new project that is a copy of another project. The thing is that when I want to rename the project, some connection problems appear when I want to execute my app. Can someone tell me a good way to replace all the names of the old project? The classe names are the same in the new one, so I don't have to change them.
Thanks!
I have done this recently and it was a straightforward process.
I suggest you start again. Make a copy of the project then click twice slowly on the project name in the project navigator. You can then rename the project.
Xcode then suggests which files/resources to change - you can accept all changes or amend if you like.
Once complete your project will build and run with no problems.

XCode - Workspaces

i'm developing a framework and i would like to know if there is a method for share the code across multiple project. Example : i have my workspace with my framework project and a test application project for the fw; then, i have another project of an app and i need to use the framework, but i want to link the framework so that when i modify the original code in workspace even the code in the project is updated without import every time the .framework file.
Is it possible?
If not, how can i do to share code across projects?
Thanks
Yes, this can easily be done by importing files from the other project. You could create a group called external, right click and choose "add files". Make sure the option "copy items into destination group`s folder" is unchecked.
If you now change the files in the other project, the changes will be reflected in the dependent one.

Resources