-
Notifications
You must be signed in to change notification settings - Fork 3
Injections Handling
apleshkov edited this page Jul 30, 2018
·
2 revisions
To handle the completion of property/method injections add a new method to your service with the @saber.didInject
annotation.
Only one method is supported and it'll be called if there's at least one property or method injection.
// @saber.scope(App)
class StorageManager {
// @saber.inject
var logger: Logging?
private var fileManager: FileManager?
// @saber.inject
func set(fileManager: FileManager) {
self.fileManager = fileManager
}
// @saber.didInject
func postInit() {
print(logger)
print(fileManager)
}
}
- User's Guide
- Advanced