Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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)