Is there a way to get a Xcode-packaged theme back if I accidentally deleted it? I deleted a theme entirely in the process of getting rid of redundant copies of that theme.
There are tons of color themes for Xcode (in fact, any text editor) on Github. This repo has Default.dvtcolortheme, which is the default that came from Apple.
Choose one (preview) and place it under ~/Library/Developer/Xcode/UserData/FontAndColorThemes/
Related
I was testing out some new swift code. I knew that if I made any mistake I could simply revert back to my old code by pressing Command+Z.
But I accidentally closed my Xcode Editor while writing new code.
How would I undo the new changes and go back to my old original code? I did not make use of github for this.
There might be a chance you can view the file's old history. Check out George Marmaridis' answer
Here is what he says:
You might not be out of luck. Although Git can't help you, Finder may be able to come to the rescue!
If you have not turned off the Versions feature (which by default is turned on and you need a Terminal command to disable), then do the following:
Quit Xcode.
Open the file you wish to bring back your lost changes to using TextEdit.
Go to File > Revert To > Browse All Versions...
Scroll through the available versions. Hopefully you will have many available to choose from.
Select a version and hit Restore.
Follow 2-5 for all necessary files.
Launch Xcode. You should now see the M next to these files in Project Navigator indicating they include uncommited changes (the changes you previously discarded).
Xcode > Preferences > Fonts & Colors > Plus Button > Duplicate Theme > Name The New Theme > Update The New Scheme > Close Preferences > Coffee & Code > Kill Xcode > Launch Xcode > Preferences > Fonts & Colors > New Theme Missing!?!
Xcode Version 9.2 (9C40b)
I cannot reproduce the problem you've described, the theme I created was preserved after killing and re-launching Xcode. Interestingly, my custom theme was moved to the bottom of the list, maybe that's the case for you as well.
If your theme legitimately went missing, it can be because of a software or a hardware bug/fault. What you can do is make a backup from your .xccolortheme file before quitting Xcode to make sure that it survives the relaunch.
For this, you should navigate to
~/Library/Developer/Xcode/UserData/FontAndColorThemes/
and make a copy of the file you want to preserve. If it ever disappears, you can move the copy back to this location.
I had this problem in Xcode 10. It was caused by the name I gave the theme: AI/ML. I headed to ~/Library/Developer/Xcode/UserData/FontAndColorThemes/, the directory in which the themes are stored, as pointed to by Tamás Sengel.
In FontAndColorThemes, there was a directory named AI, containing the theme, with the name ML. I moved the theme one level up, deleted the directory, and renamed the theme file. I then had to restart Xcode again, to get the theme back on the list.
Xcode read / not as part of the name, but as a separator between a directory and the file. Xcode should've managed this situation, but as it doesn't, don't name your files this way; at least I won't.
I could duplicate the xccolortheme file without a problem. The issue was permissions. It had the wrong permissions! What the deuce!
I have renamed my project name, And it is working fine to me and building successfully. And I committed these changes to my Server, other person working on same project with different branch.
So, Once he got pull from server xcode asked him "Revert" or "Keep Xcode version", we selected revert option, then code project name came as red colour and files not showing.
We tried somany ways to fix this, we are not found any solution, can anyone suggest us to fix this issue.
For renaming app name,
I have just renamed the appname.xcodeproj in left panel of xcode and then created new scheme.
We are using Gitlab source control.
I will suggest to take a new clone.
When you are adding complex project structural/configuration level changes, then it is always better to take a new clone to avoid the misleading behavior. Merging the remote code will create a conflicts with local project workspace and behavior may weird.
I've been working on a project the last few weeks in Xcode and everything's been great. Main.Storyboard all of a sudden, will not load or open. Other projects open fine. There hasn't been any significant changes in this project. The last thing I tried doing was adding a navigation bar to one of my view controllers, to add buttons or items. I also tried adding a navigation item. Things started to complicate after trying to do these things. I have the latest version of Xcode, my project settings are linked correctly and tried rebooting my Mac but it doesn't solve anything. Does anybody know what may have caused this error and how to resolve?
The easy way:
Check out the latest working version of the storyboard file and try the changes again. Likely something odd and transient happened that corrupted the existing storyboard file (I've seen it happen with managed object model files before which are also XML underneath).
If there are too many changes to redo them:
Make a copy of the current storyboard file outside the repo and then checkout the latest working version of the file from the repo.
Diff the two files moving over changes that make sense from the troublesome file keeping an eye out for balanced tags (i.e. if a view has an opening tag but no closing tag Xcode will get confused).
Try opening the modified storyboard in Xcode. With luck it will open and be fine. Otherwise you will need to do a bit more digging or go back to option one and redo the changes.
I downloaded your repo and I can open Main.storyboard just fine:
I'd like the default theme of Xcode but for TextMate.
Is there anyone who knows where I could find this?
I just created it, check it out.
You could always just make it yourself, duplicate one of the TextMate themes and then apply the font styles from Xcode to the textmate theme. It won't take too long and will let you fix the bits that you think are broken!
Since I couldn't get Paolino or El's themes to install in TextMate 2.0, I've created a new Xcode Default theme from scratch here:
https://github.com/jrodatus/xcodedefault-tmtheme-ng
Installation
Theme extension must be ".tmTheme" (exactly)
Double-click to install in TextMate, select "Themes" bundle when prompted
View->Theme->Xcode Default
View->Font->Show Fonts...: Menlo Regular 10.3 or 10.5
TextMate->Preferences->Projects->Open files on single click
Show file browser on: Left side
Extra
To change the selection color from orange, change the hex color code after the "selection" key in the tmTheme file.
To suppress tab creation when clicking on a file in the browser:
Method 1) Hold the Option key every time you click on a file.
Method 2) Clone the TextMate repository and edit textmate/Frameworks/DocumentWindow/src/DocumentWindowController.mm, replacing the occurences of OakIsAlternateKeyOrMouseEvent() with YES, and rebuild.
Method 3) If you don't want to install the build prerequisites, you can patch the binary directly. See GitHub README.