Stored and computed variables in Swift

All global and local variables are stored variables in Swift. Stored variables provide storage for a value and allow it to be set or retrieved. Computed variables calculate the value instead of storing it. Global constants and variables are always computed lazily. Local constants and variables are never computed lazily.

Leave a Reply