     /// - Parameters:
     ///   - value: 将要存入的 Bool 值
     ///   - key: 将要存入的 key
+    @available(*, deprecated, message: "Extensions directly on UserDefaults are deprecated. Use `UserDefaults.standard.rat.save` instead.", renamed: "save(_:for:)")
     public func saveBool(_ value: Bool, forKey key: String) {
         base.set(value, forKey: key)
         base.synchronize()


import Foundation

extension RGAppTools where Base: UserDefaults {
    /// 检验 UserDefaults 中是否存在某个 key
    ///
    /// - Parameter key: 待检验的 key
    /// - Returns: 检验结果
    public func has<ValueType>(key: Key<ValueType>) -> Bool {
        return base.value(forKey: key.key) != nil
    }


    /// - Parameters:
    ///   - value: 将要存入的内容
    ///   - key: 用于标记的 key
    public func save<ValueType>(_ value: ValueType, for key: Key<ValueType>) {
        if isPrimitive(type: ValueType.self) {
            base.set(value, forKey: key.key)
            base.synchronize()
