I use NSKeyedArchiver.archivedDataWithRootObject(obj)to convert an object to NSData. A method archivedDataWithRootObject(obj)requires that its parameter be NSObjectappropriate NSCoding.
I tried archiving Swift Strings, Arrays, and Dictionarys, and it worked well. Therefore, I think it is Stringappropriate NSObject, appropriate NSCoding.
I also checked this code on the playground to confirm what Stringis NSObject:
var str = "Hello, playground"
let isObject = (str is NSObject)
But when I get to the definition String(using Cmd + Click), it shows what it Stringis struct. I can not find the code showing what Stringis NSObject.
public struct String {
public init()
}
, String , , String NSObject? NSObject?