swift

Using private(set) and why it’s important

Why even use private(set) when you can just declare the variable Imagine you’re creating an app for a bank and every owner has a balance. Naturally, you may define a struct above with the variable balance and move on. Now the balance can be changed from anywhere in your app. When you create an instance

Scroll to Top