Challenges moving from Visual Studio to XCode...

Hi,

I have moved from MS development to OSX-based development and the move from Visual Studio to XCode is doing my head in. 😁


I cannot find any logic to how XCode is displaying a source editor window based on how you work in the Project Navigator - can someone please point me to some good explanation which I just cannot find?


The most frustrating thing for me is that a single click on a file in the Project Navigator opens the file in the editor - replacing the one you are working on. But even worse is that if you already have that file open in a tab you end up with two tabs editing the same file.


Is there a way to stop XCode opening a file when you single click in the Project Navigator?


Also, in the preferences there is a setting in Navigation for Primary or Focussed editor. I canot find a definition of the difference between them - and when I change the setting I experience no difference.


Finally, all I have find is canned scripted tutorials for the UI and nothing covers my question. Is there an actual document that describes all these features?


Thanks in advance,


Bryon

Answered by QuinceyMorris in 118200022

You're just going to have to be patient with yourself. The IDE paradigms are very different, and Xcode's choices will seem "wrong" to you for quite a while.


— Think of the Navigator as more like the row of tabs across the top of your VS window than the solution navigator down the side (assuming that's where things are in your VS setup). You wouldn't complain that single clicking on the the file's tab shows the file.


— Get used to the idea that you can have a file being edited in multiple places at one time. It's useful. I wouldn't suggest that it's better or worse, just different, so you may as well look for ways to exploit it.


— The "Primary" editor is the editor pane on the left of the window. The "Assistant" editor is the editor pane on the right of the window, when you've requested that it be split. Note that this is not a split view of the file (though you can display the same file in both panes if you want, and you open more assistant editors if you want more splits), but an opportunity to have two editors side by side. The "focussed" editor is the one whose cursor is active — the one which responds to keystrokes.


I would say — though other people might disagree with me, possibly vehemently — that Xcode is like it is now as a reaction to the million-window madness that seemed to hit Xcode version 3. Within a project, Xcode works well with a single tab for your main editing tasks, often split into primary and assistant editors. Other tabs are useful for different UI setups, less so for having lots of editors open at one time.


(Normally, I have 3 tabs. One is for main editing tasks. The second is for debugging. During debugging, variable and output panes appear, similar to VS, and it's useful to have the (primary) editor show the source around the execution location, and the main pane available for looking at source code that accounts for how it got to the execution location. My third tab is for IB (editing resources). It has only the primary editor, because the larger canvas is helpful, and it has the Utility pane permanently shown on the right, though I only need that occasionally in the other panes.)


For jumping around, get used to clicking on things in the navigator, or by using swipe-left and swipe-right in the editor pane to revisit things in the order you used them. Use Command-click on a symbol to jump to editing the file where the symbol is defined, and get used to adding the Option key to most navigation commands to make them apply to the assistant editor (in some semantic sense or other) instead of the primary editor.


If you're the kind of person who really, really wants to have lots of editors open and arranged visibly around the screen, you're probably going to really, really hate Xcode. It is (and has been since version 4) designed for much more focussed and context-sensitive editing workflows than some other IDEs.


Note that I'm not saying anything bad about VS. It has its attractions too. (For example, I like using Peek Definition. In Xcode, you would Command-Click and then swipe back when you're done.) Perhaps what I am saying is that Xcode feels chaotic to users of other IDEs, but if you trust that it's designed and used by people who think hard about developer workflows, and are prepared to give it a chance, you should grow to like it, in time.

You've used Xcode Help?

Accepted Answer

You're just going to have to be patient with yourself. The IDE paradigms are very different, and Xcode's choices will seem "wrong" to you for quite a while.


— Think of the Navigator as more like the row of tabs across the top of your VS window than the solution navigator down the side (assuming that's where things are in your VS setup). You wouldn't complain that single clicking on the the file's tab shows the file.


— Get used to the idea that you can have a file being edited in multiple places at one time. It's useful. I wouldn't suggest that it's better or worse, just different, so you may as well look for ways to exploit it.


— The "Primary" editor is the editor pane on the left of the window. The "Assistant" editor is the editor pane on the right of the window, when you've requested that it be split. Note that this is not a split view of the file (though you can display the same file in both panes if you want, and you open more assistant editors if you want more splits), but an opportunity to have two editors side by side. The "focussed" editor is the one whose cursor is active — the one which responds to keystrokes.


I would say — though other people might disagree with me, possibly vehemently — that Xcode is like it is now as a reaction to the million-window madness that seemed to hit Xcode version 3. Within a project, Xcode works well with a single tab for your main editing tasks, often split into primary and assistant editors. Other tabs are useful for different UI setups, less so for having lots of editors open at one time.


(Normally, I have 3 tabs. One is for main editing tasks. The second is for debugging. During debugging, variable and output panes appear, similar to VS, and it's useful to have the (primary) editor show the source around the execution location, and the main pane available for looking at source code that accounts for how it got to the execution location. My third tab is for IB (editing resources). It has only the primary editor, because the larger canvas is helpful, and it has the Utility pane permanently shown on the right, though I only need that occasionally in the other panes.)


For jumping around, get used to clicking on things in the navigator, or by using swipe-left and swipe-right in the editor pane to revisit things in the order you used them. Use Command-click on a symbol to jump to editing the file where the symbol is defined, and get used to adding the Option key to most navigation commands to make them apply to the assistant editor (in some semantic sense or other) instead of the primary editor.


If you're the kind of person who really, really wants to have lots of editors open and arranged visibly around the screen, you're probably going to really, really hate Xcode. It is (and has been since version 4) designed for much more focussed and context-sensitive editing workflows than some other IDEs.


Note that I'm not saying anything bad about VS. It has its attractions too. (For example, I like using Peek Definition. In Xcode, you would Command-Click and then swipe back when you're done.) Perhaps what I am saying is that Xcode feels chaotic to users of other IDEs, but if you trust that it's designed and used by people who think hard about developer workflows, and are prepared to give it a chance, you should grow to like it, in time.

>If you're the kind of person who really, really wants to have lots of editors open and arranged visibly around the screen, you're probably going to really, really hate Xcode


Not if you're sitting in front of two/three monitors and legitimate screen space.


The majority of users you describe are confined to MBP screens w/perhaps unrealistic expectations when it comes to Apple's IDE. Don't blame that on the tools.

Thanks @QuincyMorris. You have given me some things to think about. It is a different way of working that is doing my head in.

Regards

Bryon

Challenges moving from Visual Studio to XCode...
 
 
Q