Dependency

1.0.0

A dependency Injection solution for SwiftUI. Thank you Antoine van der Lee and Vincent Pradeilles for initially showcasing this idea.
chFlorian/Dependency

What's New

v1.0.0

2021-11-15T13:05:22Z

Dependency

A dependency Injection solution for SwiftUI. Based on a video by Antoine Van Der Lee and Vincent Pradeilles.

Usage

private struct UserServiceKey: DependencyKey {
    static var currentValue: UserService = MyUserService()
}

extension DependencyValues {
    var userService: UserService {
        get { Self[UserServiceKey.self] }
        set { Self[UserServiceKey.self] = newValue }
    }
}

Description

  • Swift Tools 5.5.0
View More Packages from this Author

Dependencies

  • None
Last updated: Wed Nov 23 2022 16:52:04 GMT-0500 (GMT-05:00)