Member-only story
Understanding Stored and Computed Properties in Swift
Everything you need to know about stored and computed properties

A concept that all developers meet early when start programming in Swift is about properties. This term is one of the most common ones that somebody reads, writes, or talks about in programming articles, books, courses, or discussions.
Putting it in plain words, properties are variables and constants that store values, and that we declare in Swift classes, structures, and enumerations. But properties are not unique to Swift. We meet them in every Object-Oriented Programming (OOP) language.
Regardless, two new terms are getting into the play-around properties soon enough — stored
and computed
. Even though both explain their meaning somehow, one realizes what they actually are only after exploring them.
It’s often the case where programmers are writing code without even having heard about the existence of these concepts. It’s a fact that we can write entire apps without knowing the slightest detail about those. So, why is it necessary to learn about them?
Well, first of all, since stored and computed properties exist as concepts in the Swift language, they become a must-have knowledge that everybody should be understanding and possess.