Why can't UE4 detect Xcode on my Mac?

It is on the App Store. You need to download it, then run Xcode-Select