2.3 KiB
2.3 KiB
iOS AI Setup
Setup Path A: Xcode + GitHub Copilot for Xcode
Prerequisites
- Xcode installed and up to date.
- GitHub account with Copilot Enterprise access.
Install and Sign In (High-Level)
- Install the GitHub Copilot for Xcode plugin.
- Sign in with your GitHub account.
- Confirm Copilot is enabled in Xcode.
- Run a simple prompt to verify suggestions appear.
Example Prompt (Xcode)
Type this in a Swift file comment, then wait for a suggestion:
// Create a function that validates an email string.
Verification Steps
- Open a Swift file and start a small function.
- Confirm inline suggestions appear.
- Open the Copilot chat panel and ask a short question.
Setup Path B: VS Code + GitHub Copilot Extension
When to Use VS Code on iOS
- Editing shared docs or configs.
- Rapid refactors or explorations.
- Working on multi-platform files.
Install and Sign In (High-Level)
- Install VS Code and the GitHub Copilot extension.
- Sign in with your GitHub account.
- Confirm Copilot is enabled in VS Code.
- Run a simple prompt to verify suggestions appear.
Example Prompt (VS Code)
Open a Swift file and add:
// Create a Swift struct for a user profile with name and email.
Verification Steps
- Open a Swift file and type a short function signature.
- Confirm inline suggestions appear.
- Open Copilot Chat and request a short summary.
iOS-Specific Guidance
- Ask for Swift/SwiftUI patterns with small, bounded tasks.
- Request tests or sample usages for view models.
- Favor refactor or patch requests over full rewrites.
Example Request
"Refactor this SwiftUI view to reduce duplication. Do not change behavior. Provide a short diff summary."
Starter Prompts
- "Create a SwiftUI view model for this screen and list its inputs and outputs."
- "Write unit tests for this view model using XCTest."
- "Refactor this view to reduce duplication without changing behavior."
iOS Troubleshooting
- If suggestions are missing, confirm sign-in and access.
- If the plugin is not visible, verify extension compatibility.
- If responses are blocked, check network or policy constraints.
Common Setup Gaps
- Copilot access not provisioned for the GitHub account.
- Xcode plugin disabled after update.
- Multiple AI plugins competing for suggestions.