Is it possible to copy iPhone data to Mac using Xcode?
The window that popped up was probably the Photos app, that will typically auto start when a new device with photos is attached. Your friend did the right thing by closing it when he saw it happen. No copies of your photos would have been made at this time, only thumbnails were downloaded and those would be removed when Photos was closed.

He theoretically could have copied some data, but Xcode will not automatically copy anything sensitive, so unless he is a really sneaky 'friend' that set up his Mac to copy in the background in advance, I think you are probably OK.