GO FURTHER, FASTER: Try the Swift Career Accelerator today! >>

SOLVED: Moonshot - Astronaut.swift throwing errors about protocol "Decodable"

Forums > 100 Days of SwiftUI

I'm on the "Loading a specific kind of codable data" page. I've created Astronaut.swift but it gives me a ton of errors about conforming to the Decodable protocol and refuses to build. Am I doing something wrong or did Xcode 16.2 change some behaviour that's making things not work?

screenshot

   

Change

let id = String

to

let id: String

and get back to us.

   

lmao I have no idea how I 1. Did that and 2. Didn't notice it.

That fixed it, thank you.

   

Hacking with Swift is sponsored by Alex.

SPONSORED Alex is the iOS & Mac developer’s ultimate AI assistant. It integrates with Xcode, offering a best-in-class Swift coding agent. Generate modern SwiftUI from images. Fast-apply suggestions from Claude 3.5 Sonnet, o3-mini, and DeepSeek R1. Autofix Swift 6 errors and warnings. And so much more. Start your 7-day free trial today!

Try for free!

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.