Xcode by default displays project file in a seperate window when the user double clicks on the file. And if you want to change this behavior and to open the file in the same window as that of single click then you can use the options provided as part of Xcode Preferences.
Step 1: Launch the XCode Preferences, XCode menu -> Preferences or ? + ,
Step 2: In the General tab, navigate to Double Click Navigation option.
Step 3: Select Same as Click value from the drop down list.
Now when a user double clicks on a file, XCode will display the file in the same window.