Space replaced by 'u' character Xcode 7 beta 5 - xcode

In my Xcode editor view all the space characters appear to have been replaced by an unrecognizable character (like a u but with square corners). I am using Xcode 7 beta 5. How can I fix this ?

You've inadvertently turned on Show Invisibles. Go to the Editor menu and select Hide Invisibles to turn this feature off.

Related

Shrinking and Expanding code blocks in Xcode 9

Xcode 9 introduces a new text editor which is fine, but is there a way to but back feature with shrinking and expanding blocks of code as of Xcode 9.0 (9A235) ?
Put the cursor somewhere in the block and press ⌥⌘←. That's much more convenient than the old way.

Line height in Xcode

How do I increase the distance between the lines in Xcode?
I mean in the actual code.
Even when I change the font and font sizes in the Xcode preferences, the code lines are still too close together and it is very annoying.
Also check out the Meslo font; an open source customized version of Menlo that comes with much nicer line-spacing.
Prior to Xcode 9, there was no way to change line height. However, now in Xcode 9 the option is available under Xcode>Preferences...>Fonts & Colors at the bottom there is a popup that has the options of "Tight Spacing", "Normal Spacing", and "Relaxed Spacing".
Since Xcode 9 you can open your theme file and specify the desired line spacing through the property DVTLineSpacing. Example for 1.5 line spacing:
<key>DVTLineSpacing</key>
<real>1.5</real>
Try using the free, open source Droid Mono font.
It has more line spacing build into the font itself.
The tight line spacing in XCode 4 was driving me crazy too!
Create a custom font with whitespace on the top and bottom of the glyphs, install it and set is as the editing font in Xcode.
Read this:
http://hivelogic.com/articles/top-10-programming-fonts
and download your favorite font and decompress it. After that, open Mac's TextEdit and Format-->Font-->Show Fonts-->click the setting in the left corner beside "+-" -->Manage Fonts-->Click "+" to add the font you just downloaded.
Now you've successfully added a font in your Mac, and you can choose this font in your Xcode preference. The line height of the new font is changed.
Edit the DVTLineSpacing property in the .xccolortheme file to change the line height.
Open any .xcolortheme file from ~/Library/Developer/Xcode/UserData/FontAndColorThemes
Edit the DVTLineSpacing key. If there isn't one, add this to the file, replacing 1.8 with the line spacing you want:
<key>DVTLineSpacing</key>
<real>1.4</real>
Close and re-open Xcode
By default Xcode uses 1 for tight spacing, no key for regular spacing, and 1.2 for relaxed spacing.
Tested with Xcode 12.2 and Mac OS 10.15.

Moving caret back/forward to previous/next editing position within a document in Xcode 4?

In Xcode 3, I could go back to previous editing point within a document by pressing Command+Control+[Left|Right]. (I'm confusing it was Control or Option... However) In Xcode 4, the key combination is assigned to other feature. Code folding..? What did this key change into?
The shortcut in XCode 4 for "Go forward/backward" is "Control" + "Command" + "Arrow"
This is super annoying for me. When I tried to change the shortcut in the Shortcut Editor back to the Xcode 3 way, Xcode crashes. Fun.
Another option for switching to Previous/Next editing position (Go Back/Go Forward) is using two finger swipe (left for Go Back, right for Go Forward). I realize that this is not a keyboard shortcut but if you are using a Trackpad, it is much faster than trying to click on the buttons.
Note: The pointer does need to be in the editor for swiping to work.
Not 100% sure what you mean by "previous editing point", but Command+Option+Left|Right is code folding. I use Option+Left|Right and Control+Left|Right to move back and forth within the code to get to particular points.
A list of Xcode keyboard shortcuts can be found here

Xcode History (back/forward) Keyboard Shortcut?

Back Arrow Broken In Xcode?
Is there keyboard command to go back/forward one file at a time.
Xcode 3.2 changed the behavior of Cmd-Opt <-- and -->. As noted in another question, they do not operate on a file level like in previous versions of Xcode, but on an "edit point", making it cumbersome to flip through a list of files (the quick way to do it, since Xcode does not support Tabs, as in Eclipse).
Rob Keniger found a partial solution that he noted in another post:
"Hold down the option key while you click the forward/backward arrows ..."
But this requires fiddling with the mouse. Is there any way to do it with the keyboard only?
EDIT:
Later versions of Xcode (v7.2+) now have a Navigate menu (and it changes the keyboard shortcuts yet again):
In XCode 4.4 the following sequence works:
Cmd + Ctrl + ←
and it operates on a file level.
On Xcode 8 I use 2 fingers left / right
Beginning in XCode 3.2.3, the following key sequence works:
Cmd + Option + Shift + ←
Without the Shift key, it just goes back to the previous cursor position. Adding Shift jumps to the previous file (next file, in combination with →).
Navigation shortcuts for Xcode

How can I turn on parenthesis matching in Xcode?

Curly brace matching was pretty easy to turn on. How can I turn on parenthesis matching in Xcode?
on Xcode Version 6.1 (6A1052d), you just need to double click on one of the parenthesis and the entire code that the parenthesis is scoping out is highlighted.
for example, if you have a code like the one below and you double click '{' or '}' bracket the entire code in their scope is highlighted :
if(condition == true)
{
//do something
}
Choose editor -> code folding -> focus
Edit
In XCode 9 the only solution is to put mouse over parentheses while pressing command button. Only this works.
Previous
To extend the other answers
it is possible to roll in/out code inside brackets.
Choose Editor > Structure > Balance Delimiter
url
Nevertheless, as already written earlier, the major feature is
Editor > Code Folding > Focus Follows Selection
press command key and its hover the brace and parenthesis ...
You must be running Xcode in Snow Leopard and install Xcode from the Snow Leopard disc that you got at WWDC. If you did not get a Snow Leopard disk, then you are out of luck unless you find one elsewhere.
The version of Xcode needed is 3.2 and the other components in the about page are:
Component versions
Xcode IDE: 1600.0
Xcode Core: 1599.0
ToolSupport: 1591.0
Please have a look at below answer for Xcode 9.0 and above:
Xcode highlights an opening delimiter (brace, bracket, parenthesis) when you move the cursor left-to-right over the matching closing delimiter. The highlight animation lasts about 1 second total, which is plenty in the case where you need a hint (and as you say the other delimiter is nearby).
If you need a more persistent indication, you can double-click either the opening or the closing delimiter, and Xcode will select both delimiters and their contents. (You can also use this, for example, to get quickly to one delimiter from another, even if they're far apart — double-click the delimiter you can see, use the left or right arrow to get the other end of the selection.)
With latest xcode13 we can permanent active this option with
"Xcode" --> "Preference" ---> "Text Editing" and by enabling "Code folding ribbon"
Thanks

Resources