This thread is old, but it still comes on top of search results, so I'd like to save you some headaches. Do not do these complicated repository things or suboptimal screen sharing.
Just set your Documents folder to sync with iCloud on both Macs. Then make sure that the Xcode project file is under the Documents folder structure so it is exactly the same on both Macs. I'm saying this, because when you already have content on the Documents folder and enable iCloud, Apple will create a subfolder under Documents called Documents - [your Mac's name]. Move your project out of that folder and place it under Documents in the same way your Xcode project was saved before enabling iCloud for Documents. This will preserve the file paths of all the files in your project.
Then simply open the project on the Mac you want to work on. Xcode would not see the difference.
Added notes: if you have frameworks, save them in the same way. If you want to update pods, make sure you have Cocoapods installed on both Macs.