Start with the storage number, not the download button. A clean Xcode install can pass 40 GB once simulators and caches unpack, and a Mac with 12 GB free will stall before your first print("Hello, Swift"). Check Apple menu > About This Mac > Storage and System Settings > General > Software Update before you install anything.
Before you buy anything: three Mac specs for Swift
- macOS: run a current Xcode release. Xcode 16 requires macOS Sonoma 14.5 or later; newer Xcode releases push that floor forward.
- Chip: Apple silicon M1 or newer is the safe choice. An Intel Mac can work for older Xcode versions, but it limits current simulators and long-term updates.
- Memory and storage: 8 GB RAM is the minimum for Xcode and a simulator; 16 GB is comfortable. Keep 50 GB free for Xcode, simulators, and project builds. A 256 GB SSD is workable if you keep one simulator runtime installed; 512 GB saves weekly cleanup.
- Screen: 13 inches is workable, but plan to hide sidebars or use an external display at 1920×1080 or higher.
- Skip iPad-only: Swift Playgrounds on iPad can teach syntax, but full Xcode and iOS simulators need a Mac.
The only purchase most beginners need: a Mac that runs Xcode
- New Mac mini: from $599 before monitor, keyboard, and mouse; budget $750-$850 for a complete desk.
- New MacBook Air with 16 GB memory: roughly $999-$1,299; 16 GB matters more than a larger screen for Xcode.
- Used or refurbished M1 MacBook Air: $400-$600; check battery health and confirm it can install the current macOS. If you buy used, make sure the seller signs out of iCloud and Activation Lock before you pay.
- Avoid 8 GB/256 GB as your only machine if you can. Xcode plus two simulators plus browser tabs will feel cramped.
- Do not buy the $99 Apple Developer Program on day one. A free Apple ID is enough for simulator work and limited device testing; paid membership is $99/year when you need TestFlight or App Store distribution.
Install Xcode without filling your SSD
- Download Xcode from the Mac App Store or Apple's developer downloads page. The download is about 10-15 GB; the installed footprint is larger. The first launch can take 10-20 minutes on a slow connection; do not force-quit.
- Launch Xcode once, accept the license, and allow it to install additional components.
- Open
Xcode > Settings > Accounts, sign in with your Apple ID, and confirm a free personal team appears. - Leave beta versions alone for your first workspace. Install the current stable Xcode.
- Check free space again after installation; keep at least 20 GB free for simulator runtime updates and build files.
Set up the first Swift workspace: Playground, then app project
Use Playgrounds for the first hour. In Xcode, choose File > New > Playground > iOS > Blank, name it HelloSwift, save it under ~/Developer/SwiftProjects, and run print("Hello, Swift"). If the console shows the line, your Swift toolchain is working.
Then make a real app: File > New > Project > iOS App, set Interface to SwiftUI, Language to Swift, product name FirstApp, organization identifier com.yourname, and save. Press Run and wait for an iPhone simulator to boot. This first project creates an .xcodeproj file. Use short project names without spaces; FirstApp is easier to type in Terminal than My First Swift App.
Do not create an .xcworkspace yet. A workspace groups multiple projects and Swift packages; a beginner with one app normally opens the .xcodeproj. Use File > New > Workspace only when a tutorial adds a local package or a second project.
Arrange Xcode so Swift code stays readable
- Turn on line numbers:
Xcode > Settings > Text Editing > Display > Line Numbers. - Set the editor font to 14-16 pt. Smaller text saves space but slows down error spotting.
- Keep the Navigator visible with the left sidebar and hide the Inspector until you need it.
- Put the Simulator on a second desktop so the code editor and the running app do not fight for one screen. Set the Simulator scale to 50-75% on a 13-inch screen so the full iPhone screen fits.
- Use one folder per project under
~/Developer/SwiftProjects; avoid saving projects to the Desktop or Downloads. - Back up that folder with Time Machine or a $60-$100 1 TB external SSD. Do not run Xcode itself from the external drive.
Add command-line Swift and Git when a tutorial asks
- Install command-line tools only when needed: run
xcode-select --installin Terminal, then checkswift --version. - Swift Package Manager is included with Xcode; try
swift package init --type executableonly in a test folder. - Git is included with the command-line tools. Run
git --version, thengit initinside a project folder if a tutorial requires version control. - Do not install a separate Swift toolchain from swift.org for Xcode work; Xcode's toolchain is already selected.
- Skip Homebrew and bulk tool installs at the start. Each extra tool is another update and permission problem.
- Keep a plain text note of every terminal command that worked; beginners often lose the exact setup step that fixed an error.
A realistic $0-to-$1,000 Swift setup budget
- Xcode: $0.
- Apple ID: $0.
- Simulator and Playgrounds: $0.
- Apple Developer Program: $99/year, optional at the start.
- Used M1 MacBook Air: $400-$600.
- New Mac mini plus basic monitor, keyboard, and mouse: $750-$850.
- New 16 GB MacBook Air: $999-$1,299.
- External SSD for backups: $60-$100.
- Beginner course or book: $0-$30; avoid $500 bootcamps before you have run one Swift project.
- A $20-$50 USB-C hub is optional for a MacBook Air with two ports; skip it if you use a single charger and one cable.
First-session Swift setup checklist
- [ ] macOS updated enough for current Xcode.
- [ ] 50 GB free before Xcode install; 20 GB free after.
- [ ] Xcode installed, launched, license accepted.
- [ ] Apple ID signed in under
Xcode > Settings > Accounts. - [ ] Playground
HelloSwiftrunsprint("Hello, Swift"). - [ ] iOS App
FirstAppruns in an iPhone simulator. - [ ] Simulator selected and booted once.
- [ ] Line numbers on; editor font 14-16 pt.
- [ ] Projects saved in
~/Developer/SwiftProjects. - [ ]
swift --versionreturns a version in Terminal. - [ ] Backup method chosen for the project folder.
Stop when the simulator shows your first screen and the console prints your first line. That is a working Swift workspace; everything else is an upgrade you can add when a real project demands it.