 //  Redistributions of files must retain the above copyright notice.
 //
 
-import Foundation
+import UIKit
 
 /// A simplified way to get/set user defaults.
 ///

    public mutating func set(_ value: Type?) {
        self.value = value
        hasCachedValue = true
        if defaultValue is NSURL
            || defaultValue is Bool
            || defaultValue is Int 
            || defaultValue is Double
            || defaultValue is Float 
            || defaultValue is String {
            hasCachedValue = true
            if let value = value {
                UserDefaults.standard.set(value, forKey: name)

    /// 4. nil.
    public mutating func get() -> Type? {
        if !hasCachedValue {
            if Type.self == URL.self {
                hasCachedValue = true
                value = UserDefaults.standard.url(forKey: name) as? Type
            } else if Type.self == Bool.self
                || Type.self == Int.self
                || Type.self == Decimal.self
                || Type.self == Double.self
                || Type.self == Float.self
                || Type.self == CGFloat.self
                || Type.self == String.self {
                hasCachedValue = true
                value = UserDefaults.standard.object(forKey: name) as? Type
            } else {
                // we don't always have to archive Array and Dictionary
                // but this is easier
