Xcode .gitignore files within directories - ios

I am looking to .gitignore my plist file found within a subdirectory within my project. When I ignore individual files at the root level where .gitignore is located I have no problems with the exclusion, but when I try to exclude files within the a subdirectory I can't seem set up the proper way to exclude this and my file still appears. I think what is throwing me off the most is the way that my Xcode projects appear in my finder compared to my Xcode program. In Xcode, my .plist appears within a Supporting Files folder. Once would assume that this would mean my gitignore request would be /app-name/Supporting Files/Info.plist, but in the finder, there is no Supporting Files folder, just Info.plist.
Any advice as to what I should do?
Should my .gitignore look like:
facebook-login-template/Info.plist
or
/facebook-login-template/Supporting Files/Info.plist
or should it be something else?

I think you are looking for this:
*Info.plist
If you only want to avoid the one inside "facebook-login-template", it should work with
facebook-login-template/Info.plist
but remember you have to reset the file on git if you've already tracked it.

Related

Change Xcode 11 Template files

how can i change the Xcode Template files, when i want to create a new File? I searched online but the path to changes these wasn't correct with Xcode 11
I tried these:
~/Library/Developer/Xcode/Templates
~/Library/Developer/Xcode/Templates/File Templates/Source
~/Library/Application Support/Developer/Shared/Xcode/File Templates/
But couldn't find the template files.
Adding/detailling on Mark's answer:
Xcode path is for me:
/Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/File Templates
Target path indeed matches (but Templates folder does not exist), so I did:
cp -fr /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates ~/Library/Developer/Xcode
Now, where are the C++ templates? Hidden in:
/Users/michael/Library/Developer/Xcode/Templates/File Templates/MultiPlatform/Source/C++ File.xctemplate
What has <cstdio> to do in C++ project template files?? Someone at Apple's side has been sleeping here for some decades.
Anyways, it works but I have duplicated entries now. I tried removing the original folder but it does not work:
sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates
But anyways. Just picking the right files works. You can also rename the "C++ File.xctemplate" name... whatever is before "File" seems to work as a label in Xcode.
Alternatively, you can just change the templates directly in /Applications/Xcode.app but then suffer from having them overwritten after update.
Apple's file templates are inside the Xcode app bundle.
Xcode/Contents/Developer/Library/Xcode/Templates/File Templates
You should not modify the file templates in the Xcode app bundle because you will lose them when you update Xcode. Copy the file templates you want to change to the user file template location.
~/Library/Developer/Xcode/Templates/File Templates
You may have to manually create some of the folders in this path. You may also want to create an additional folder to store your templates to make finding them easier when creating a new file.
After copying the file templates to the user file template location, you can make changes to the files.

What UserInterfaceState.xcuserstate file stores?

Started a new project in Xcode, and although I change only some codeine, UserInterfaceState.xcuserstate file become always part of the stage files. Why, what is this file good for?
It just manages the state of XCode. You don't need to store this for any reason and *.xcuserstate should probably be added to your .gitignore file.

Legacy iOS app didn't use folder structure for it's files at all. How to refactor without individually telling each file where it now lives?

I have inherited an iOS app where all the class files were dumped into the root directory. In the project there are groups but the files themselves are not in folders.
How do I go about refactoring and redoing the project so I can create folders and put the files into them, without having to manually tell each file where it now lives in the xcode sidebar.
I'm going to assume there's some sort of 'auto-scan for files' feature but I'm worried that this could end up causing all sorts of compilation issues.
If there's a safe way to do this appreciate the help!

Moving files around in XCode and IOS 7

I move some files into a subdirectory but now I get linking errors saying files can't be found. Where do I go (like a projects file) to tell XCODE where to look for the new files?
I tried removing everything and adding them back in but I still get missing files even though they are one directory in and added to the project.
Select a file in left panel, open inspector panel on the right and choose a path to file there.
Note: it's more efficient to do that if your files are organized into folders; that way, you only need to change the path to folder and the elements are relative to it.

location of custom plist file

I have created a plist file for my App. 2 questions:
1) If I have added the plist file to the Xcode project, will the file get automatically bundled and distributed with the App?
2) The Simulator always seems to 'locate' the file upon startup. Even if I manually remove the file from the App's root folder. This is where the Simulator is looking for the file:
/Users/Joe/Library/Application Support/iPhone Simulator/5.0/Applications/28C13BB3-xxxx....
Where should my plist file be located?
1) Yes it will as long as it is in the Target/Build Phases/Copy bundle resources.
2) It will be located on your application documents directory, you don't really need to worry about it, except you have to add the file to your project and make sure number 1 of this list has been done.
The simulator finds it even after remove, because it keeps state, unless you manually reset the simulator. Therefore it already had a copy of the file in the folder you mention, even if you removed it.
1) Yes. If Xcode project lists the file, it will be automatically bundled and distributed.
2) You can place your plist file anywhere under the top level project folder. Everything under your top level folder is your project bundle.
What do you mean when you say you remove the file from app's root folder ?

Resources