awesome-repositories.com
博客
MCP
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目关于排名机制媒体报道MCP 服务器
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
sunshinejr avatar

sunshinejr/SwiftyUserDefaults

0
View on GitHub↗
4,893 星标·362 分支·Swift·MIT·6 次浏览radex.io/swift/nsuserdefaults/static↗

SwiftyUserDefaults

SwiftyUserDefaults 是一个类型安全的 Swift 接口,用于使用 NSUserDefaults 存储系统读写用户偏好设置。它提供了一个静态类型的偏好存储,利用泛型和默认值来防止应用设置中的运行时类型不匹配。

该库包括一个自定义类型序列化器,用于将复杂对象和数组转换为兼容的存储格式;以及一个观察者,使用键值观察 (KVO) 在偏好值更改时触发逻辑。它还具有一个应用组偏好管理器,利用套件名称在应用和扩展之间交换用户偏好。

该项目涵盖了更广泛的功能领域,包括偏好生命周期管理、减少存储读取的内存值缓存,以及将应用启动参数读取为静态类型配置值的能力。它还提供了用于管理多个隔离键存储和重置偏好存储的工具。

Features

  • User Preference Managers - Manages reading and writing application settings through a statically-typed interface to ensure type safety.
  • Standard Library Wrappers - Provides a type-safe Swift wrapper around the NSUserDefaults standard library to improve ergonomics and safety.
  • User Preference Management - Provides utilities to check for key existence and remove individual entries to maintain preference state.
  • User Preference Managers - Provides a type-safe interface for storing and retrieving application settings on iOS.
  • Type-Safe Configuration Stores - Implements a preference store using generic types and default values to prevent runtime type mismatches in settings.
  • Type-Safe Key Interfaces - Maps preference keys to specific Swift types to prevent runtime type mismatches during data retrieval.
  • App Group Synchronization - Provides a preference manager that uses suite names to exchange user settings between applications and extensions.
  • Storage Key Observation - Ships a monitoring tool that uses key-value observing to trigger logic when specific preference values are updated.
  • Custom Type Serializers - Allows specifying how custom types and arrays are transformed when reading from or writing to persistent storage.
  • Data Type Serialization - Provides logic for encoding and decoding complex custom types and arrays into persistent storage formats.
  • In-Memory Caches - Implements an in-memory cache for retrieved preferences to reduce direct read operations from persistent storage.
  • Preference Caches - Stores retrieved preference values in memory to reduce the frequency of direct reads from persistent storage.
  • Default Value Fallbacks - Provides fallback values when requested preference keys are absent to ensure non-optional returns.
  • Default Value Assignments - Assigns fallback values to keys so that lookups return a non-optional value when no data exists.
  • Inter-App Data Sharing - Uses shared suite names to synchronize user preferences and settings between a main application and its extensions.
  • App Group Storage - Directs preference operations to specific named containers to share data between applications and extensions.
  • Property Change Observers - Tracks updates to stored settings to trigger immediate logic changes within the application.
  • Shared Suite Access - Enables redirecting preference read and write operations to a shared container for use between applications and extensions.
  • State Change Observers - Uses key-value observing to trigger registered callbacks when stored preference values are updated.
  • Data Persistence - Cleaner syntax for UserDefaults.
  • Database Libraries - Statically-typed interface for UserDefaults.

Star 历史

sunshinejr/swiftyuserdefaults 的 Star 历史图表sunshinejr/swiftyuserdefaults 的 Star 历史图表

AI 搜索

探索更多 awesome 仓库

用简单的语言描述您的需求 —— AI 将根据相关性为您从数千个精选开源项目中进行排序。

Start searching with AI

常见问题解答

sunshinejr/swiftyuserdefaults 是做什么的?

SwiftyUserDefaults 是一个类型安全的 Swift 接口,用于使用 NSUserDefaults 存储系统读写用户偏好设置。它提供了一个静态类型的偏好存储,利用泛型和默认值来防止应用设置中的运行时类型不匹配。

sunshinejr/swiftyuserdefaults 的主要功能有哪些?

sunshinejr/swiftyuserdefaults 的主要功能包括:User Preference Managers, Standard Library Wrappers, User Preference Management, Type-Safe Configuration Stores, Type-Safe Key Interfaces, App Group Synchronization, Storage Key Observation, Custom Type Serializers。

sunshinejr/swiftyuserdefaults 有哪些开源替代品?

sunshinejr/swiftyuserdefaults 的开源替代品包括: sindresorhus/electron-store — electron-store is a persistence layer and key-value storage solution for Electron applications. It manages user… mobxjs/mobx-react — mobx-react is a library that provides state bindings to connect React components to MobX observable state. It… pardom/activeandroid — ActiveAndroid is a persistence framework for managing local SQLite databases on Android. It provides an active record… johnestropia/corestore — CoreStore is a type-safe Swift interface and persistence wrapper for managing local data storage and object graphs… basedhardware/omi — Omi is an open-source wearable AI platform that captures audio and screen data to provide real-time conversational… ccgus/fmdb — fmdb is an object-oriented SQLite database library and persistence layer for native macOS and iOS environments. It…

SwiftyUserDefaults 的开源替代方案

相似的开源项目,按与 SwiftyUserDefaults 的功能重合度排序。
  • sindresorhus/electron-storesindresorhus 的头像

    sindresorhus/electron-store

    4,999在 GitHub 上查看↗

    electron-store is a persistence layer and key-value storage solution for Electron applications. It manages user preferences and application state by saving and retrieving structured data as JSON files on the local file system. The library includes capabilities for obfuscating configuration files to prevent manual modification of saved data. It also provides a system for automatic data structure migration when the application version is incremented and supports custom serialization pipelines to replace standard JSON parsing. The project covers a broad surface of state management, including sc

    JavaScript
    在 GitHub 上查看↗4,999
  • mobxjs/mobx-reactmobxjs 的头像

    mobxjs/mobx-react

    4,823在 GitHub 上查看↗

    mobx-react is a library that provides state bindings to connect React components to MobX observable state. It functions as a component state synchronizer, ensuring that user interface elements automatically re-render only when the specific observed data they consume changes. The project enables a decoupled state architecture by moving business logic and domain state into standalone stores, separating data management from the React component tree. It facilitates global state distribution across deep component hierarchies using providers and context to avoid manual prop drilling. The library c

    TypeScriptjavascriptmobxreact
    在 GitHub 上查看↗4,823
  • pardom/activeandroidpardom 的头像

    pardom/ActiveAndroid

    4,656在 GitHub 上查看↗

    ActiveAndroid is a persistence framework for managing local SQLite databases on Android. It provides an active record object-relational mapping system that binds database tables to classes, allowing for data persistence and retrieval without writing manual SQL. The project distinguishes itself through a dedicated schema migration tool that updates database structures using versioned scripts loaded from application assets. It also includes a framework for sharing database content between different Android applications via a standard URI-based content provider interface. The library covers bro

    Java
    在 GitHub 上查看↗4,656
  • johnestropia/corestoreJohnEstropia 的头像

    JohnEstropia/CoreStore

    4,055在 GitHub 上查看↗

    CoreStore is a type-safe Swift interface and persistence wrapper for managing local data storage and object graphs using the Core Data framework. It functions as an atomic persistence manager that executes data updates within transactional blocks to ensure changes are either fully saved or rolled back to prevent state corruption. The project provides a dedicated framework for performing sequential schema migrations through defined version chains and a type-safe object mapping system for importing external JSON data into persistent entities using Swift protocols. It includes a data binding la

    Swiftcarthagecocoapodscore-data
    在 GitHub 上查看↗4,055
查看 SwiftyUserDefaults 的所有 30 个替代方案→