Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/manhpham90vn/mpinjector
An tiny Dependency Injection framework for Swift on iOS.
https://github.com/manhpham90vn/mpinjector
Last synced: 6 days ago
JSON representation
An tiny Dependency Injection framework for Swift on iOS.
- Host: GitHub
- URL: https://github.com/manhpham90vn/mpinjector
- Owner: manhpham90vn
- License: mit
- Created: 2022-08-04T16:32:05.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-03T02:43:14.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T18:04:26.847Z (about 1 month ago)
- Language: Swift
- Homepage:
- Size: 132 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MPInjector
### An tiny Dependency Injection framework for Swift on iOS.
# Install use cocoapods
```
pod 'MPInjector'
```# Register intance
```swift
extension MPInjector: Registering {
public func registerService() {
// use singleton life time
registerSingleton { UserDefaults.standard as UserDefaults }
registerSingleton { UserDefaultsStorage() as Storage }
// use factory life time
registerFactory { LoginUseCase() }
registerFactory { GETEventUseCase() }
}
}
```# Resolve intance
```swift
@Inject var connectivityService: ConnectivityService
@LazyInject var log: Logger
```# Sample App
[iOS-VIPER-Architecture](https://github.com/manhpham90vn/iOS-VIPER-Architecture)