WWDC23 SALE: Save 50% on all my Swift books and bundles! >>

DAY 49

Project 12, part two


Alan Perlis once said “fools ignore complexity; pragmatists suffer it; some can avoid it; geniuses remove it.” Today you’re going to see that in Swift code: rather than try to simplify the code for NSCoding, the Swift team found a way to remove it entirely using the Codable protocol.

Sometimes you won’t have a choice and need to use NSCoding, but where possible Codable is both easier and safer to use. You do need to know them both, though, and by seeing them both used to solve the same problem hopefully you’ll able to decide for yourself which you prefer.

Before you get down to work, here’s another fun Swift in-joke for you: sometimes you might see T-shirts with a picture of a fish followed by “able”, but before you scratch your head wondering what “fishable” might mean please remember that “COD” is a type of fish!

Today you should work through the Codable chapter and wrap up for project 12, complete its review, then work through all three of its challenges.

Need help? Tweet me @twostraws!

 

Save 50% in my WWDC23 sale.

SAVE 50% To celebrate WWDC23, all our books and bundles are half price, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.

Save 50% on all our books and bundles!

100 Days of Swift


The 100 Days of Swift is a free collection of videos, tutorials, tests, and more to help you learn Swift faster. Click here to learn more, or watch the video below.

Back to 100 Days of Swift

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.