TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

DAY 9

Structs, part two


As you’ve seen, structs let us combine individual pieces of data to make something new, then attach methods so we can manipulate that data.

Today you’re going to learn about some of the more advanced features of structs that make them more powerful, including access control, static properties, and laziness. Yes, laziness – Bill Gates once said, “I choose a lazy person to do a hard job, Because a lazy person will find an easy way to do it.” In Swift, laziness is an important performance optimization, as you’ll see.

Today you have six one-minute videos to watch, and as always once you’ve completed each video there’s some optional extra reading and a short test to help make sure you’ve understood what was taught.

  1. Initializers
  2. Referring to the current instance
  3. Lazy properties
  4. Static properties and methods
  5. Access control
  6. Structs summary

That’s another key Swift topic under your belt – good job! Now do the smart thing and post your progress online: it forces you to write about these things in your own words, and also encourages you to continue on to tomorrow.

Need help? Tweet me @twostraws!

 

Hacking with Swift is sponsored by RevenueCat.

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

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

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.