Pass a variable from foreground to background in Swift
问题 I am developing an iOS application where I want to record the time when a user presses a particular button and keep it. Later I will use this time record in background. Is there a nice way of doing that without invoking NSUserDefaults or CoreData or whatever other database? I am very new to iOS development. I think this is very likely to be a naive question. But I'm just curious. Please don't laugh at me haha. Edit: This is indeed a very naive question haha. 回答1: A simple way to make sure