Here's my attempt to answer dogcoder's issue (3rd paragraph):
Like grb2007, I've found out the following through experimentation rather than through Apple's Xcode documentation, though I tried hard to go that route.
If you open a project and close all the document (not window) tabs, to start fresh, then open a file in the project navigator, a temporary document tab is opened. Ignoring the tabs for a moment, if you click a couple more files in the project navigator, their contents will be displayed in the editor window. After doing that a few times, you'll find that swiping left or right works as you expected. It will go back and forth between the files you opened in the order that you opened them.
However, the more valuable use of swiping left and right, which matches the behavior of clicking the back and forward buttons in the document tab bar, is to do a manual "stack trace" through your functions and methods.
If you're examining a function's code and it calls another function, you can Cmd-Cntrl-click that second function's name to immediately open its file with it's declaration selected. As you go through its code, you Cmd-Cntrl-click a function it calls to move deeper into the logic. Again, that function's file will open with it selected. Let's say you repeat that sequence three or four more times. Now you're pretty deep in the calling sequence but how do you get back? The incredibly valuable answer is either the back button or swiping. Each back button click (or swipe right) will take you back to the calling function, so you can very conveniently move right back up the calling stack.
This approach includes clicks on any symbol, as far as I can tell, so you can use it to examine type and named value (let or var) declarations as well as function declarations and find your way back up to the top of the reference "stack" when you're done. Of course, if you go half way back up, then click the forward button (or swipe left), you'll retrace your steps back down the stack.
As you'd expect, if you go half way back up, then Cmd-Cntrl-click another symbol, the original stack below you will be lost and replaced by this new reference. Of course, this works whether the symbol you clicked was in another file or the same file you were already in. In either case, your editor window will display the referenced symbol's definition which will be added to the stack. This means that sometimes when you go back up the "stack trace", you will move within a file rather than opening a new file in the editor.
I just discovered this yesterday and haven't yet experimented with the relationship between these clicks and the document tabs but I thought this might be helpful for some.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: