I can't for the life of me figure out how to store anything to do with an optional in NSCache. I can understand directly storing an optional would not make sense, but storing an array or dictionary where some options may be optional certainly seems like it should be possible.
Yet a simple example doesn't work:
let dict: [String: String?] = ["foo": "bar"]
NSCache().setObject(dict, forKey: "dict")
Is there something I'm overlooking or is there really no way to do this?