Skip to content

Commit 8dc9e67

Browse files
Merge pull request #4 from Infomaniak/updatePackage
fix: Compatibility with swift 5.6
2 parents cc56d1c + 5e578e0 commit 8dc9e67

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.7
1+
// swift-tools-version: 5.6
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription

README.md

+19-12
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
11
# InfomaniakDI
22

3+
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FInfomaniak%2Fswift-dependency-injection%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/Infomaniak/swift-dependency-injection)
4+
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FInfomaniak%2Fswift-dependency-injection%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/Infomaniak/swift-dependency-injection)
5+
36
Minimalist dependency injection mechanism written in pure Swift.
47

5-
## Abstract
6-
Register factories thanks to the `Factory` type into the resolver.
7-
Use the property wrapper `@InjectService` to resolve a shared instance from any queue.
8+
Support any first party Swift platfom. [ iOS / iPadOS / watchOS / macOS / Linux ]
9+
10+
Well tested. Used in production across the Infomaniak iOS Apps.
11+
12+
Property wrapper based with `@LazyInjectService` and `@InjectService`.
13+
14+
Optimised to work well with SwiftUI Views.
815

916
## Features
17+
- [x] Efficient SwiftUI. `@(Lazy)InjectService` will not re-resolve, when used as a property, on a `View` redraw.
18+
- [x] Good integration test coverage
1019
- [x] Pure Swift Type Support
1120
- [x] Thread safety
1221
- [x] Injection by name
1322
- [x] Injection with Arguments
14-
- [x] Integration tests
1523
- [x] Lazy init (with @LazyInjectService)
16-
- [x] Efficient SwiftUI with `@LazyInjectService` and `@InjectService` used as IVAR in `View`
17-
18-
## OS Support
19-
20-
Anything with first party Swift support. (iOS / macOS / Linux …)
2124

2225
## Roadmap
2326
- [ ] Optionals
2427
- [ ] Multiple containers
2528

2629
## Requirements
27-
- Swift 5.x +
30+
- Swift 5.6 +
2831
- SPM
2932

30-
## Usage
33+
## Setup
3134

3235
Early on in the lifecycle of your app, you want to write something like this :
3336

@@ -52,7 +55,11 @@ later on, when you want to resolve a service use the property wrapper like so:
5255
```swift
5356
@InjectService var injected: SomeService
5457
```
55-
Injection will be performed at the init time of the owner of the property.
58+
Injection will be performed at the init time of the owner of the property.
59+
60+
Use `@LazyInjectService` for resolution at first use of the wrapped property. Prefer `@LazyInjectService` when used as a property.
61+
62+
## Documentation
5663

5764
Checkout `ITSimpleReslover.swift` for more advanced examples.
5865

0 commit comments

Comments
 (0)