I have a test project that I'm trying to pass an argument to the resolve method in a Swinject project.
Here is an example of what my Swinject storyboard extetion file has in it.
import Swinject
extension SwinjectStoryboard {
class func…
I have a question, I'm using Swinject in a separate framework.
My app get the object from this framework and my appExtension use it too.
But in the Extension the Object is not correctly instantiate. Does Swinject use the first instance of my object…
At this point in my project I use Swinject (DI Container).
I want to know how to register the ViewController, if I have the following hierarchy:
class RateAnswersBaseVC: UIViewController { }
class RateAnswersDoctorVC: RateAnswersBaseVC { }
class…
I am using Swinject in my Swift 3 app. When I tried
let container = Container()
container.register(NetworkModeling.self) { _ in Network() }
I get an error saying
Ambiguous reference to member 'register(_:name:factory:)'
What is wrong here?
In a Swift 2.0, Single Page Application project, in XCode 7.0.1, with the Swift dependency injection framework Swinject, I am doing the following:
DuplicateProtocol.swift:
protocol DuplicateProtocol { var id: String { get }…
Right now, I've been running into an issue of registering protocol conforming to ObservableObject. Since ObservableObject uses an associated type, I cannot find a way to register it without compiling error.
This is my simple model, called A
protocol…
I'm trying to inject my viewModel class to WKInterfaceController, in my InterfaceController I have set property but when I try to use it in func awake(withContext context: Any?), it's nil.
So the way I was trying to do it: setting up the container…
I'm using Swinject in my Swift iOS app and try doing a circular dependency as explained on the official documentation page: https://github.com/Swinject/Swinject/blob/master/Documentation/CircularDependencies.md
I've copied the code from the circular…
I am using the library Chatto (https://github.com/badoo/Chatto) for a chat window and initializing a view controller that inherits from it's BaseChatViewController.
The issue that i'm having is that while the scroll view can scroll all the way to…
I am trying to setup DI for multi-module workspace with Swinject. I have one ParentProject where I embed binary framework built from ChildProject (so ParentProject includes all public code from ChildProject).
My approach is to create one Assembly…
I'm using Swinject for my DI solution, and extend it with the SwinjectStoryboard extension.
I'm struggling with dynamic injecting the right viewModel to a specific viewContoller. The specific scenario is as follow:
MyViewController has a property…
Recently I have started getting crash when trying to resolve an object. Following is the crash logs. I can see that in Container.swift at line 299 guard let currentObjectGraph = currentObjectGraph else { fatalError() } the application is not…
Everytime we resolve a protocol/class then we get a new object. My coordinator needs a view model and my controller needs the same view model.
internal class LoginFactory: Assembly {
func assemble(container: Container) {
let delegate =…
I am using Swinject for Dependency Injection. I have created a DependencyManager which has a shared instance of container.
internal class DependencyManager {
private static let sharedInstance = DependencyManager()
private var assembler:…
I am starting to use Swinject in my apps and I want to share an instance of my rootNavigator between presenters(Viper/MVP) or viewControllers(Not Viper). The main problem that I have is that I want to share appRootNavigator in presenters, but I…