2
Hi Pravesh,
A lazy stored property is a property whose initial value is not calculated until the first time it is used. You indicate a lazy stored property by writing the lazy modifier before its declaration.
Please check given below links for better understanding.
https://www.hackingwithswift.com/example-code/language/what-are-lazy-variables
https://medium.com/@abhimuralidharan/lazy-var-in-ios-swift-96c75cb8a13a
https://stackoverflow.com/questions/40694691/what-is-the-advantage-of-a-lazy-var-in-swift
Accepted 1
Please mark it as an answer, if it has solved your purpose.
1
lazy variable is a keyword which can be used with function. These variables will be assigned a value only and only when function is called. This will save memory and processing of variables.