sunshinejr / SwiftyUserDefaults

Modern Swift API for NSUserDefaults
http://radex.io/swift/nsuserdefaults/static
MIT License
4.86k stars 366 forks source link

Add synchronize after set #126

Closed iDurian closed 7 years ago

iDurian commented 7 years ago

Add synchronize after set

Uupis commented 7 years ago

According to David Smith, one of the engineers spending countless hours keeping Cocoa running, calling synchronize is virtually never necessary. http://dscoder.com/defaults.html

In my experience, it has only been necessary during development, when I kill the app immediately after doing something with NSUserDefaults.

radex commented 7 years ago

Exactly. Thank you @iDurian for the PR, but calling synchronize every time after set is a cargo cult of sorts. David Smith said so himself in some other PR/issue on this repo.