     /// - Parameter key: The key.
     /// - Returns: A `ValueType` or nil if the key was not found.
     public func get<ValueType>(for key: Key<ValueType>) -> ValueType? {
-        if isPrimitive(type: ValueType.self) {
+        if isSwiftCodableType(ValueType.self) || isFoundationCodableType(ValueType.self) {
             return self.userDefaults.value(forKey: key._key) as? ValueType
         }
         

        }
    }
    
    /// Checks if a given type is primitive.
    ///
    /// - Parameter type: The type.
    /// - Returns: A boolean value indicating if the type is primitive.
    private func isPrimitive<ValueType>(type: ValueType.Type) -> Bool {
        switch type {
        case is String.Type, is Bool.Type, is Int.Type, is Float.Type, is Double.Type, is Date.Type:
            return true
        default:
            return false

    ///   - some: The value to set.
    ///   - key: The associated `Key<ValueType>`.
    public func set<ValueType>(_ value: ValueType, for key: Key<ValueType>) {
        if isSwiftCodableType(ValueType.self) || isFoundationCodableType(ValueType.self) {
            self.userDefaults.set(value, forKey: key._key)
            return
        }
