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

DAY 4

Complex data types, part 2


Today we’re going to finish our look at data types by examining type annotation, which is Swift’s way of letting us dictate exactly what data type each variable and constant should be. Once that’s done we’ll summarize what’s covered, then try another checkpoint so you can evaluate what you’ve learned so far.

I know, you’re probably sick of data types at this point, but as Eric Raymond said, “good data structures and bad code works a lot better than the other way around.”

Today you’ll learn about type annotation, then go through the summary and checkpoint. There’s some optional extra reading that I recommend you read, along with a short test to help make sure you’ve understood what was taught.

Today ought to take you a lot less than an hour to complete, but that’s okay – day 13 will probably take more than an hour, so it all balances out!

  1. How to use type annotations
  2. Summary: Complex data
  3. Checkpoint 2

Tip: Even though the checkpoint doesn’t ask much, don’t be surprised if you spend some time kind of staring at the screen wondering what to do. That isn’t a bad sign – in fact, I’d say it’s a good sign. I firmly believe there is no learning without struggle, so don’t be afraid to fight for it!

How can this day be improved?

Great job on finishing another day! If you still have questions about what you learned, please send them in using this form – I'll do my best to address the most common problems in the next course update. Thank you!

Now share your progress…

If you use Twitter, the button below will prepare a tweet saying you completed today, along with a celebratory graphic, the URL to this page, and the challenge hashtag. Don't worry – it won't be sent until you confirm on Twitter!

Alternatively, copy and paste the text below to your preferred social network - I'm @twostraws on Mastodon.social, Bluesky, and Threads.

🎉 I just finished Day 4 of the #100DaysOfSwiftUI at https://www.hackingwithswift.com/100/swiftui/4 via @twostraws

Need help? Tweet me @twostraws!

 

Hacking with Swift is sponsored by Essential Developer.

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until February 9th.

Click to save your free spot now

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

100 Days of SwiftUI


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

Back to 100 Days of SwiftUI

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.