Skip to content
Back to skills

Ios State Management

ASecurity

Implement reactive state with Combine, Observation framework, and UDF patterns. Use when implementing state management with Combine, @Observable, or reactive patterns in iOS.

  • 24 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 4, 2026
documentationswiftreact

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 4, 2026

npx -y skills add gabrielmoreira/agent-skills-mirror --skill ios-state-management --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ios State Management?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ios State Management
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gabrielmoreira-ios-state-management/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-ios-state-management)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ios-state-management
description: Implement reactive state with Combine, Observation framework, and UDF patterns. Use when implementing state management with Combine, @Observable, or reactive patterns in iOS.
metadata:
  triggers:
    files:
    - '**/*.swift'
    keywords:
    - Observable
    - "@Published"
    - PassthroughSubject
    - "@Observable"
    - "@Namespace"
---
# iOS State Management

## **Priority: P0 (CRITICAL)**

## Implementation Workflow

1. **Choose observation approach** — Use `@Observable` (iOS 17+) for modern SwiftUI; `Combine` with `@Published` for UIKit or broader compatibility.
2. **Expose state clearly** — Use UDF pattern: ViewModel exposes `Input` enum (events) and `Output` struct (state).
3. **Manage subscriptions** — Store Combine subscriptions in `Set<AnyCancellable>` with `.store(in: &cancellables)`.
4. **Dispatch to main thread** — Use `@MainActor` or `.receive(on: DispatchQueue.main)` for UI updates.
5. **Use exhaustive ViewState** — Prefer single `ViewState` enum (`.loading`, `.success(data)`, `.error(failure)`).

See [Combine and Observation framework examples](references/implementation.md)

## Anti-Patterns

- **No Uncleared Subscriptions**: Always use `.store(in: &cancellables)`
- **No Background UI Updates**: Use `.receive(on: .main)` or `@MainActor`
- **No Manual `objectWillChange.send()`**: Use `@Published` or `@Observable` instead

## References

- [Combine & Observation Setup](references/implementation.md)

Files in this skill

  • SKILL.md1.5 KB
  • evals/evals.json1.7 KB
  • references/implementation.md2.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in documentation →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.