Skip to content
Back to skills

Ios Dependency Injection

ASecurity

Standards for Protocol-based DI, Property Wrappers, and Factory/Needle. Use when configuring dependency injection or factory patterns in iOS. (triggers: **/*.swift, @Injected, Resolver, Container, Swinject, register, resolve)

  • 67 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 10, 2026
ai-agentsswifttestingdatabase

Security analysis

A100/100

Scanned November 10, 2026

npx -y skills add ComeOnOliver/skillshub --skill ios-dependency-injection --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ios Dependency Injection?

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

Security grade badge for Ios Dependency Injection
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/comeonoliver-ios-dependency-injection/badge)](https://www.skillsdirectory.com/skills/comeonoliver-ios-dependency-injection)

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-dependency-injection
description: "Standards for Protocol-based DI, Property Wrappers, and Factory/Needle. Use when configuring dependency injection or factory patterns in iOS. (triggers: **/*.swift, @Injected, Resolver, Container, Swinject, register, resolve)"
---

# iOS Dependency Injection Standards

## **Priority: P0**

## Implementation Guidelines

### Protocol-Based DI (Manual)

- **Initializer Injection**: Preferred method. Pass dependencies through `init`.
- **Abstractions**: Inject protocols instead of concrete classes to facilitate testing (Mocks/Stubs).

### Modern Property Wrappers (Factory/Resolver)

- **Factory**: Use the `Factory` library for lightweight, type-safe navigation-friendly DI.
- **Swinject**: Use for enterprise-grade container-based DI in large modular projects.
- **Injected**: Use `@Injected` property wrappers for cleaner syntax in ViewModels.

### Scoping

- **Singleton**: Use for app-wide services (Auth, Network, Database).
- **Unique/Transient**: Default for ViewModels and temporary workers.
- **Graph/Cached**: Use for shared data within a specific feature flow (Coordinator scope).

## Anti-Patterns

- **No global singleton access everywhere**: Inject service via initializer.
- **No Resolver.resolve() inside logic**: Pass dependency via constructor.
- **No direct class instantiation**: Depend on protocols for testability.

## References

- [Manual & Library DI Setup](references/implementation.md)

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 ai-agents →

Comments

Loading comments…

Newsletter

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