{"id":61820,"date":"2024-05-22T13:02:37","date_gmt":"2024-05-22T07:32:37","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=61820"},"modified":"2024-05-22T17:53:33","modified_gmt":"2024-05-22T12:23:33","slug":"copilot-with-xcode-use-genai-to-accelerate-your-ios-development","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/copilot-with-xcode-use-genai-to-accelerate-your-ios-development\/","title":{"rendered":"Copilot with Xcode: Use genAI to accelerate your iOS development."},"content":{"rendered":"<p>The world of software development is fast-evolving. Today&#8217;s need is not only learning programming but to capitalise on edge cutting tools. GitHub Copilot, an AI-powered code completion tool by GitHub and OpenAI, is making a significant impact by generating code snippets and offering intelligent suggestions based on context. As an iOS developer, I integrated Copilot into my workflow to explore its potential and speed up development cycles.<\/p>\n<p>However, <strong>GitHub Copilot<\/strong> does not natively support Xcode, the primary IDE for iOS development. Through research and using GPT, I learned how to leverage <strong>GitHub Copilot<\/strong> and <strong>Codeium<\/strong> to enhance my coding experience in Xcode.<\/p>\n<p>This guide aims to help developers optimize their coding processes by integrating GitHub Copilot and Codeium within Xcode. We&#8217;ll explore use cases and conclude with an overview of its limitations.<\/p>\n<p>Here is the screenshot of their official page listing some of the IDE they support.<\/p>\n<div id=\"attachment_61832\" style=\"width: 635px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-61832\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-61832 size-large\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-16-at-5.18.50-PM-1024x749.png\" alt=\"Github Copilot Supported IDE\" width=\"625\" height=\"457\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-16-at-5.18.50-PM-1024x749.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-16-at-5.18.50-PM-300x220.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-16-at-5.18.50-PM-768x562.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-16-at-5.18.50-PM-624x457.png 624w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-16-at-5.18.50-PM.png 1528w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><p id=\"caption-attachment-61832\" class=\"wp-caption-text\">Github Copilot Supported IDE<\/p><\/div>\n<p>Let&#8217;s embark on a detailed exploration of the setup process for GitHub Copilot, Codeium, and the Xcode extension.<\/p>\n<h2>Setting up GitHub Copilot:<\/h2>\n<ol>\n<li>To set up <strong>GitHub Copilot<\/strong>, ensure you have access to GitHub Copilot through your GitHub account. Note that GitHub Copilot is a paid service, requiring payment information for setup. A 30-day free trial is available for learning purposes.\n<p><div id=\"attachment_61834\" style=\"width: 635px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-61834\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-61834 size-large\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-16-at-6.29.19-PM-1024x681.png\" alt=\"Enable Xcode Extension\" width=\"625\" height=\"416\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-16-at-6.29.19-PM-1024x681.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-16-at-6.29.19-PM-300x199.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-16-at-6.29.19-PM-768x511.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-16-at-6.29.19-PM-624x415.png 624w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-16-at-6.29.19-PM.png 1414w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><p id=\"caption-attachment-61834\" class=\"wp-caption-text\">Enable Xcode Extension<\/p><\/div><\/li>\n<li>Next, follow the setup instructions provided on the GitHub Copilot setup page, which typically involves installing Visual Studio Code (VS Code). However, using VS Code would mean sacrificing the autocomplete feature and visual interface for UI creation offered by Xcode. To retain these features, we&#8217;ll install a <a href=\"https:\/\/github.com\/intitni\/CopilotForXcode\">third-party extension<\/a> on Xcode.<\/li>\n<li>Manually install the Copilot for <strong>Xcode.app<\/strong> by downloading it from the <a href=\"https:\/\/github.com\/intitni\/CopilotForXcode\/releases\">latest release<\/a>. Install the application in the Application Folder and open it to set up a background running service.<\/li>\n<li>From the Apple menu located in the top-left corner of your screen click System Settings. Navigate to Privacy &amp; Security then toward the bottom click Extensions. Click Xcode Source Editor and tick Copilot.\n<div id=\"attachment_61835\" style=\"width: 1002px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-61835\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-61835 size-full\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-16-at-6.29.28-PM.png\" alt=\"Extension for Xcode Source Editor\" width=\"992\" height=\"496\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-16-at-6.29.28-PM.png 992w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-16-at-6.29.28-PM-300x150.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-16-at-6.29.28-PM-768x384.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-16-at-6.29.28-PM-624x312.png 624w\" sizes=\"(max-width: 992px) 100vw, 992px\" \/><p id=\"caption-attachment-61835\" class=\"wp-caption-text\">Extension for Xcode Source Editor<\/p><\/div><\/dt>\n<\/dl>\n<\/li>\n<li>The first time the app is open and the command runs, the extension will ask for the necessary permissions. To grant permissions for the Accessibility API, click Accessibility, and drag the <strong>CopilotForXcodeExtensionService.app<\/strong> to the list.\n<p>You can locate the extension app by clicking the Reveal Extension App in Finder in the host app.<\/p>\n<p><div id=\"attachment_61836\" style=\"width: 635px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-61836\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-61836 size-large\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-20-at-9.20.16-PM-1024x427.png\" alt=\"Grant permissions for the Accessibility API\" width=\"625\" height=\"261\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-20-at-9.20.16-PM-1024x427.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-20-at-9.20.16-PM-300x125.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-20-at-9.20.16-PM-768x320.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-20-at-9.20.16-PM-1536x640.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-20-at-9.20.16-PM-624x260.png 624w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-20-at-9.20.16-PM.png 1794w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><p id=\"caption-attachment-61836\" class=\"wp-caption-text\">Grant permissions for the Accessibility API<\/p><\/div><\/li>\n<li>Update the Node setting in the Host App by accessing the Service Tab and setting the Node path. If Node is not installed, you can download it from the <a href=\"https:\/\/nodejs.org\/en\/download\/current\/\">official website<\/a>. You may get the node path by running the which node command in the terminal.\n<p><div id=\"attachment_61837\" style=\"width: 635px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-61837\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-61837 size-large\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-2.08.29-PM-1024x714.png\" alt=\"Update Node path\" width=\"625\" height=\"436\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-2.08.29-PM-1024x714.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-2.08.29-PM-300x209.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-2.08.29-PM-768x536.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-2.08.29-PM-1536x1071.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-2.08.29-PM-624x435.png 624w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-2.08.29-PM.png 1804w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><p id=\"caption-attachment-61837\" class=\"wp-caption-text\">Update Node path<\/p><\/div><\/li>\n<li>We are now ready to set up the suggestion feature. Click on \u201cInstall\u201d in the Copilot Language Server section. On the click, it will redirect us to the GitHub verification page, A user code will be copied to the clipboard, Paste it on the verification input box, and complete the SignUp by Clicking the <strong>\u201cConfirm Sign-in\u201d<\/strong> in the Host Application.\n<p><div id=\"attachment_61838\" style=\"width: 324px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-61838\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-61838 \" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-2.14.28-PM-1024x794.png\" alt=\"GitHub verification page\" width=\"314\" height=\"244\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-2.14.28-PM-1024x794.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-2.14.28-PM-300x233.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-2.14.28-PM-768x595.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-2.14.28-PM-1536x1191.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-2.14.28-PM-624x484.png 624w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-2.14.28-PM.png 1762w\" sizes=\"(max-width: 314px) 100vw, 314px\" \/><p id=\"caption-attachment-61838\" class=\"wp-caption-text\">GitHub verification page<\/p><\/div><\/li>\n<li>Go to <strong>&#8220;Feature &#8211; Suggestion&#8221;<\/strong> and update the feature provider to <strong>&#8220;GitHub Copilot&#8221;<\/strong>.<\/li>\n<\/ol>\n<h2>Setting Up Codeium:<\/h2>\n<p><a href=\"https:\/\/codeium.com\/\"><strong>Codeium<\/strong><\/a> serves as an alternative to <strong>GitHub Copilot<\/strong>, offering a free service for individual users with unlimited usage.<\/p>\n<p>The installation process is similar to GitHub Copilot as we will use the same extension for using Codeium as the service provider.<\/p>\n<ol>\n<li>In the host app, navigate to &#8220;Service &#8211; Codeium&#8221; to access the Codeium account settings.<\/li>\n<li>Click on &#8220;Install&#8221; to install the language server.<\/li>\n<li>Click on &#8220;Sign In&#8221; and you will be redirected to codeium.com. After signing in, a token will be provided. You need to copy and paste this token back into the app to complete the sign-in process.<\/li>\n<li>Go to &#8220;Feature &#8211; Suggestion&#8221; and update the feature provider to &#8220;Codeium&#8221;.\n<p><div id=\"attachment_61840\" style=\"width: 525px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-61840\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-61840 \" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-20-at-9.39.48-PM-1024x448.png\" alt=\"Select Provider\" width=\"515\" height=\"225\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-20-at-9.39.48-PM-1024x448.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-20-at-9.39.48-PM-300x131.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-20-at-9.39.48-PM-768x336.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-20-at-9.39.48-PM-1536x671.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-20-at-9.39.48-PM-624x273.png 624w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-20-at-9.39.48-PM.png 1794w\" sizes=\"(max-width: 515px) 100vw, 515px\" \/><p id=\"caption-attachment-61840\" class=\"wp-caption-text\">Select Provider<\/p><\/div><\/li>\n<\/ol>\n<p>That was all about setting up the code suggestion feature.<\/p>\n<p>Now, Let\u2019s see in code a few <strong>use cases<\/strong> how it may help us. Just start typing as usual and Copilot will start assisting you with code suggestions.<\/p>\n<h3>Code Suggestions:<\/h3>\n<div id=\"attachment_61841\" style=\"width: 405px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-61841\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-61841\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-2.29.17-PM-1024x702.png\" alt=\"Code Suggestions\" width=\"395\" height=\"270\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-2.29.17-PM-1024x702.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-2.29.17-PM-300x206.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-2.29.17-PM-768x526.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-2.29.17-PM-1536x1052.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-2.29.17-PM-624x428.png 624w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-2.29.17-PM.png 1734w\" sizes=\"(max-width: 395px) 100vw, 395px\" \/><p id=\"caption-attachment-61841\" class=\"wp-caption-text\">Code Suggestions<\/p><\/div>\n<p><strong>GitHub Copilot<\/strong> and <strong>Codeium<\/strong> offer valuable assistance in generating code snippets tailored to specific contexts within Xcode. For instance, upon entering &#8220;Ank,&#8221; Copilot suggested the text &#8220;Ankit Nigam&#8221; along with other necessary view modifiers.<\/p>\n<h3>Write Code upon request:<\/h3>\n<div id=\"attachment_61842\" style=\"width: 406px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-61842\" decoding=\"async\" loading=\"lazy\" class=\" wp-image-61842\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-4.53.54-PM-1024x505.png\" alt=\"Write Code upon request\" width=\"396\" height=\"195\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-4.53.54-PM-1024x505.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-4.53.54-PM-300x148.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-4.53.54-PM-768x379.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-4.53.54-PM-624x308.png 624w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-4.53.54-PM.png 1124w\" sizes=\"(max-width: 396px) 100vw, 396px\" \/><p id=\"caption-attachment-61842\" class=\"wp-caption-text\">Write Code upon request<\/p><\/div>\n<p>Upon requesting, &#8220;Add Story Model Struct and make it <strong>Codable<\/strong>,&#8221; Copilot generated a Codable Story model with property suggestions, demonstrating its ability to fulfill coding requests within the editor.<\/p>\n<h3>Refactor Code:<\/h3>\n<div id=\"attachment_61843\" style=\"width: 416px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-61843\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-61843 \" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-4.55.04-PM-1024x872.png\" alt=\"Refactor Code\" width=\"406\" height=\"346\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-4.55.04-PM-1024x872.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-4.55.04-PM-300x256.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-4.55.04-PM-768x654.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-4.55.04-PM-624x532.png 624w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-4.55.04-PM.png 1162w\" sizes=\"(max-width: 406px) 100vw, 406px\" \/><p id=\"caption-attachment-61843\" class=\"wp-caption-text\">Refactor Code<\/p><\/div>\n<p>I tasked Copilot with refactoring a class named <strong>RelationStorage<\/strong> to be generic instead of saving only <strong>Strings<\/strong>. The result exceeded expectations, highlighting Copilot&#8217;s skill in code optimization and enhancement.<\/p>\n<h3>Test Case Suggestions:<\/h3>\n<div id=\"attachment_61844\" style=\"width: 420px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-61844\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-61844 \" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-17-at-1.02.07-PM-1024x537.png\" alt=\"Test Case Suggestions\" width=\"410\" height=\"215\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-17-at-1.02.07-PM-1024x537.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-17-at-1.02.07-PM-300x157.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-17-at-1.02.07-PM-768x403.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-17-at-1.02.07-PM-624x327.png 624w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-17-at-1.02.07-PM.png 1094w\" sizes=\"(max-width: 410px) 100vw, 410px\" \/><p id=\"caption-attachment-61844\" class=\"wp-caption-text\">Test Case Suggestions<\/p><\/div>\n<p>Beyond code generation and refactoring, Copilot and Codeium offer valuable insights for test case generation, further enhancing code quality and reliability within Xcode.<\/p>\n<h2>Incorporating Chat and Code Prompts:<\/h2>\n<p>Advanced features like chat and code prompts require access to paid <strong>OpenAI<\/strong> services. Once your OpenAI account is set up with the necessary permissions, you can integrate these features into your Xcode environment for enhanced collaboration and code exploration.<\/p>\n<h3>Setting Up the Chat &amp; Code Prompt:<\/h3>\n<ol>\n<li>Please switch to the Chat Section on the Host app.<\/li>\n<li>Click on Add model. That will open a dialog to input the key. Select the Chat Model Provider and follow the steps to create keys on your choice of Provider. I create with OpenAI.<\/li>\n<li>Clip on Key Button Next to the API key dropdown, Add your keys in the prompted dialog box.<\/li>\n<li><span style=\"font-weight: 400;\">Select the key in the API key dropdown. Click Save and then Test to check if all is set correctly.<\/span><\/li>\n<li>Jump into XCode. Setup key binding, I\u2019ll leave it to you to set up your key. <strong>\u2325\u21e7P<\/strong> is my key to open the code prompt. Alternatively, you may explore all the options by going to <strong>Editor &gt; CoPilot &gt; All the Options list.<\/strong><\/li>\n<\/ol>\n<div id=\"attachment_61846\" style=\"width: 450px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-61846\" decoding=\"async\" loading=\"lazy\" class=\" wp-image-61846\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-17-at-12.51.45-PM-1024x607.png\" alt=\"Add Chat Model Keys\" width=\"440\" height=\"261\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-17-at-12.51.45-PM-1024x607.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-17-at-12.51.45-PM-300x178.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-17-at-12.51.45-PM-768x455.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-17-at-12.51.45-PM-1536x911.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-17-at-12.51.45-PM-624x370.png 624w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-17-at-12.51.45-PM.png 1788w\" sizes=\"(max-width: 440px) 100vw, 440px\" \/><p id=\"caption-attachment-61846\" class=\"wp-caption-text\">Add Chat Model Keys<\/p><\/div>\n<p>Now with the addition of <strong>Chat<\/strong> and <strong>Code Prompt<\/strong> into Xcode. We can chat about code and ask to write up code right into Xcode.<br \/>\nLet\u2019s see how I was able to make use of Code Prompt and Chat Prompt.<\/p>\n<h3>Write Unit Test cases:<\/h3>\n<div id=\"attachment_61848\" style=\"width: 525px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-61848\" decoding=\"async\" loading=\"lazy\" class=\" wp-image-61848\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-17-at-1.10.41-PM-1024x614.png\" alt=\"Write Unit Test cases:\" width=\"515\" height=\"309\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-17-at-1.10.41-PM-1024x614.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-17-at-1.10.41-PM-300x180.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-17-at-1.10.41-PM-768x460.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-17-at-1.10.41-PM-1536x921.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-17-at-1.10.41-PM-624x374.png 624w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-17-at-1.10.41-PM.png 1922w\" sizes=\"(max-width: 515px) 100vw, 515px\" \/><p id=\"caption-attachment-61848\" class=\"wp-caption-text\">Write Unit Test cases:<\/p><\/div>\n<p>When I asked Copilot to write a unit test, it quickly generated a well-structured Test class. The class included setup methods, clear test cases, and thorough teardown procedures, demonstrating Copilot&#8217;s skill in creating test cases.<\/p>\n<h3>Code Explanation:<\/h3>\n<div id=\"attachment_61849\" style=\"width: 412px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-61849\" decoding=\"async\" loading=\"lazy\" class=\" wp-image-61849\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-20-at-10.04.28-PM-1024x1001.png\" alt=\"Code Explanation\" width=\"402\" height=\"393\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-20-at-10.04.28-PM-1024x1001.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-20-at-10.04.28-PM-300x293.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-20-at-10.04.28-PM-768x751.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-20-at-10.04.28-PM-624x610.png 624w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-20-at-10.04.28-PM-24x24.png 24w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-20-at-10.04.28-PM-48x48.png 48w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-20-at-10.04.28-PM.png 1182w\" sizes=\"(max-width: 402px) 100vw, 402px\" \/><p id=\"caption-attachment-61849\" class=\"wp-caption-text\">Code Explanation<\/p><\/div>\n<p>Deciphering the logic in legacy code can be challenging for developers. Yet, with the Chat prompt feature, I swiftly obtained a concise explanation, saving valuable time and accelerating my understanding of the code&#8217;s intricacies.<\/p>\n<h3>Code Improvement Suggestions:<\/h3>\n<div id=\"attachment_61850\" style=\"width: 411px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-61850\" decoding=\"async\" loading=\"lazy\" class=\" wp-image-61850\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-5.17.44-PM-1019x1024.png\" alt=\"Code Improvement Suggestions\" width=\"401\" height=\"403\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-5.17.44-PM-1019x1024.png 1019w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-5.17.44-PM-298x300.png 298w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-5.17.44-PM-150x150.png 150w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-5.17.44-PM-768x772.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-5.17.44-PM-1528x1536.png 1528w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-5.17.44-PM-624x627.png 624w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-5.17.44-PM-120x120.png 120w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-5.17.44-PM-24x24.png 24w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-5.17.44-PM-48x48.png 48w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-5.17.44-PM-96x96.png 96w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-5.17.44-PM-300x300.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/05\/Screenshot-2024-05-15-at-5.17.44-PM.png 1588w\" sizes=\"(max-width: 401px) 100vw, 401px\" \/><p id=\"caption-attachment-61850\" class=\"wp-caption-text\">Code Improvement Suggestions<\/p><\/div>\n<p>Asking for code improvements paid off, with satisfactory results. There&#8217;s more to explore, but I&#8217;ll wrap up here. You can dive deeper to discover Copilot&#8217;s full capabilities within Xcode.<\/p>\n<h2>Summarised Use Cases:<\/h2>\n<p>GitHub Copilot\/Codeium simplifies coding by generating boilerplate code and suggesting error handling strategies and test cases, streamlining development. It also provides insights into various coding patterns, making it ideal for learning and exploration.<\/p>\n<h2>Limitations:<\/h2>\n<ol>\n<li><strong>Quality of Suggestions:<\/strong> While GitHub Copilot&#8217;s suggestions can be helpful, they may not always be perfect or suitable for every situation. Developers should review and test the generated code thoroughly.<\/li>\n<li><strong>Privacy Concerns:<\/strong> While providers assure that their AI models only collect code snippet data to improve functionality and quality, privacy concerns persist. Thus, cautious use is advised.<\/li>\n<\/ol>\n<p>In conclusion, the integration of GitHub <strong>Copilot<\/strong>, and <strong>Codeium<\/strong> with <strong>Xcode<\/strong>, presents an exciting opportunity for iOS developers to elevate their coding experience. By seamlessly blending Copilot&#8217;s AI-driven suggestions with the familiar Xcode environment, developers can enhance productivity, streamline workflows, and explore new coding avenues with accelerated development cycles.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The world of software development is fast-evolving. Today&#8217;s need is not only learning programming but to capitalise on edge cutting tools. GitHub Copilot, an AI-powered code completion tool by GitHub and OpenAI, is making a significant impact by generating code snippets and offering intelligent suggestions based on context. As an iOS developer, I integrated Copilot [&hellip;]<\/p>\n","protected":false},"author":1138,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":484},"categories":[1400],"tags":[5930,5929,5733,4848,5783],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/61820"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1138"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=61820"}],"version-history":[{"count":25,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/61820\/revisions"}],"predecessor-version":[{"id":61911,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/61820\/revisions\/61911"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=61820"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=61820"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=61820"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}