In swift, we can create a read-only property by only defining a getter for a variable . Meaning no setter! Since the variable only has a getter, the compiler will throw an error when we try to assign a value to “sum”.18 Ara 2021
In swift, we can create a read-only property by only defining a getter for a variable . Meaning no setter! Since the variable only has a getter, the compiler will throw an error when we try to assign a value to “sum”.18 Ara 2021