I am the person who voted to close the question. The close reason states (emphasis added):
Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers.
You don't necessarily have to have any specific code for this close reason to apply.
Xcode is showing you an error and you posted a picture of it instead of including it as text in your question. This makes it both unsearchable for anyone else who has the same problem and extremely hard to read (even for people on a desktop - let alone anyone who is on a mobile version of the site). Since this was also pointed out in a comment by the time I saw the question I didn't see a reason to add an explanation for my close vote.
Also, you could generally still add more information to the question. Currently, I can only assume that the code is written in Swift 3 based on the fact that your friend doesn't see this error and that he is running the latest Xcode version. Is that true? Either way it would be helpful to directly include this kind of information in the question as well so that anyone trying to help won't have to make educated guesses about your exact situation.
Adding a specific version of Xcode wouldn't be too bad either. While it might not be necessary at the moment (because it is clear what the currently latest version of Xcode is) it could be useful for anyone in the future who encounters the same issue and is running a (by then) old version of Xcode.
Edit: I wrote "because it is clear what the currently latest version of Xcode is" but thinking about it again made me realize that it's actually not clear at all. There's a current latest stable version (Xcode 8.3.3) and then there's the "latest latest" version which would be whatever beta they're at right now for Xcode 9. This could very well be the cause for that error, so you should definitely add that information to the question.