I've been working through the state restoration example Apple has online. I'm successfully able to encode data but am having difficulties decoding the json file. I've put print statements in my decoding functions, and none of them appear to be firing. I'm working on a watch/phone app, and when the message is sent to the phone, it populates a textView to allow userEditing of the data. Upon receiving the message from the watch, the message is encoded. After appropriately populating this text field and leaving the app, my iOS program is not decoding upon entering foreground or "will appear" or "did appear". Does anyone have a straightforward and simple example of successfully decoding data from json and repopulating a text field? I feel as though I'm wading through a lot of weeds with the state restoration project for what I'm trying to accomplish (new to programming if this is a laughable statement). My other question is, how does state restoration coincide with "user kill"? It's obviously possible to retain data in text fields after user kill (Apple's Messages app).
I was able to solve the above issue. My question now is what about WatchOS state restoration? I'm able to encode and decode a JSON file from the watchOS hard drive, and the settings are retained after removing the app from the dock. However, after restarting the watch, the settings revert back to the original settings even though the JSON file is intact and contains the changed settings.