Learn when it's best to use computed properties, and when it's best to use methods.
This is a companion discussion topic for the original entry at https://www.raywenderlich.com/3535-programming-in-swift/lessons/45
Learn when it's best to use computed properties, and when it's best to use methods.
To make it clear for you to know the difference between stored and computed type properties:
This example from Apple documentation
struct SomeStructure {
static var storedTypeProperty = βSome value.β
static var computedTypeProperty: Int {
return 1
}
}
This topic was automatically closed after 166 days. New replies are no longer allowed.