NEW: Start my new Ultimate Portfolio App course with a free Hacking with Swift+ trial! >>

Day 33 - Project 7

Forums > 100 Days of Swift

Hey all,

One thing I'm not understanding about Day 33/Project 7 is why 2 files called 'users' and 'user' get created. I've toyed with JSON data on several small test/learning apps and I seem to be able to slap structs in my ViewController and use them to point Decodables to the right section in the JSON data I download.

So, what's the logic behind it? Is it to keep the code cleaner (in that case, why create two files) or is there a deeper reason my inexperienced self isn't seeing? :-)

   

Hey Eric, I think it's for the purpose of keeping code cleaner. The code works regardless of if you want to slap them in the current viewController or create 2 seperate ones, but since there are already a viewController class with a bunch of code in it, it's just prettier and way less messy to create 2 clean files, saves us some scrolling.

Just my opinion, there may be a technical reason i don't know about? Let's see what the rest of the community have to say :)

   

Hacking with Swift is sponsored by Essential Developer

SPONSORED From January 26th to 31st you can join a FREE crash course for iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a senior developer!

Save your spot now

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

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

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.