GitHub Copilot uses the OpenAI Codex to suggest code and entire functions in real-time, right from your editor.
https://github.com/features/copilot
Whilst I’m hoping that Apple will announce something like this for Xcode at WWDC if you can’t wait it is possible to use Copilot within Xcode, installation is a little convoluted but this video takes you through it step by step.