How do I make a Swift property read-only?

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

Sizin İçin Seçtik  How do I check my Udemy refund?

Leave a Reply

Your email address will not be published. Required fields are marked *