swift-sharing

Community

Share and persist app state across features.

Authornonameplum
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Swift-Sharing provides a unified approach to share mutable state across an app while ensuring changes persist and propagate to all dependents. It reduces boilerplate for coordinating state, persistence, and UI updates across modules.

Core Features & Use Cases

  • Shared state across features with automatic persistence to in-memory, appStorage, and fileStorage; suitable for configuration, preferences, and cross-feature data.
  • Live observation and propagation via SwiftUI and Combine so that views and models stay synchronized with the source of truth.
  • Safe mutation patterns with explicit locking and structured load/save lifecycles to avoid data races in concurrent environments.

Quick Start

  1. Add a Shared property to a model with a chosen storage key, e.g., Shared(.appStorage("count")) var count = 0.
  2. Access and mutate the shared value via the projected value to react to changes and persist updates.
  3. Run your app; changes are observed across features and persisted automatically.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: swift-sharing
Download link: https://github.com/nonameplum/agent-skills/archive/main.zip#swift-sharing

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.