starting to convert save-and-restore-state examples from chapter 6 to swift (not in order)