top of page

Work with AI assistant in the Xcode - Github Copilot, ChatGPT

  • 作家相片: Mason Chang
    Mason Chang
  • 2024年12月9日
  • 讀畢需時 2 分鐘

已更新:1月23日

Currently, both GitHub Copilot and ChatGPT Desktop have been integrated into Xcode. We are stepping into the future of coding with “AI Pair Programming,” leveraging the power of AI to boost our efficiency and creativity.

(Make your boss think you’re indispensable! 😂)



GitHub Copilot

GitHub Copilot code completion in Xcode is now available in public preview (2024.10.29)(link)


Step 1:

  • Enable GitHub Copilot (Skip this step if already enabled)


Step 2:


Step 3:

  • Grant Permissions

    • Open GitHub Copilot for Xcode.

    • Grant Accessibility Permission (as shown in the image).

      • ree
    • Select Extension Permission and grant access to Xcode Source Editor (as shown in the image).

      • ree

Step 4:

  • Verify All Permissions Have Been Successfully Granted

    • ree

Step 5:

  • Open Xcode to Test

    • Type

func CalculateDaysBetweenDates(
  • You should see a suggestion like the image below (if not, ensure that your GitHub Copilot for Xcode is enabled).

  • ree

Step 6:

  • Let AI Complete the Entire Code (Feel free to test the following key combinations):

    • Press Tab to complete the current line of code.

    • Press Option to display the full recommended code.

    • Press Option + Tab to automatically complete the entire block of code.



ChatGPT Desktop for Xcode


前置:

  • You need to subscribe to the Plus plan to access the Work with Apps feature. (link)

This early beta is available to Plus and Teams users.

Step 1:


Step 2:

  • Click Settings

    • ree

Step 3:

  • Turn on Enable Work with Apps

    • ree

Step 4 (optional):

  • If you don’t want your code to be used by ChatGPT to train its model, make sure to disable the “Improve the model for everyone” option.

    • ree
      ree
 
 
 

留言


follow me
  • Facebook
  • LinkedIn

Thanks for submitting!

IMG_5625_edited_edited.jpg
Mason
Small habits, repeated daily, lead to extraordinary results.
bottom of page