Category "nsuserdefaults"

How to save a color in NSUserDefaults in swift?

I have a litle problem with saving a color in NSUserDefaults . In objective-c is easy : -(NSColor *)colorForKey:(NSString *)key{ NSData *data; NSColor *color

Top-level Bool encoded as number property list fragment. PropertyListEncoder

I have this generic function to save in NSUserDefaults, in generally works but now I want to save a boolean value and I get an error. I could not find anything

Save string to the NSUserDefaults?

How to save a string into the NSUserDefaults?