How to write better Swift

Gerriet M. Denkmann

This works (Xcode Version 8.3.2 (8E2002)):

class SomeClass
private var privateStatus: Int

var status: Int
get{ return privateStatus }
if new == privateStatus {return}

… do something here …

privateStatus = new

But is this “privateStatus” really necessary?
If not, how can it be avoided?


Join to automatically receive all group messages.