Skip to content

mattneub/DefaultsDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Unnecessarily elaborate because based on a real-life puzzle: why does UserDefaults seem to fall behind?

The answer, however, probably has nothing to do with the details of the code, but rather with my testing procedure. If you run this example repeatedly on simulator from Xcode (i.e. run, hit button repeatedly, stop, run again immediately, hit button repeatedly, etc.), you'll see that UserDefaults does indeed fall behind, but this seems to be because UserDefaults saving takes time. The solution is to count to 10 slowly before stopping and running again.

About

A puzzle: why does UserDefaults fall behind?

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages