To save a string, I use the following code:
defaults.setObject(textViews.text, forKey: "userNameKey")
To load a previously saved string, I use this code:
if let name = defaults.stringForKey("userNameKey") {
textViews.text = name
}
However, the string does not preserve the formatting (color)!
. Is it possible to save the string and format it using NSUserDefaults, or do I need to use some other method?