I am trying to create a FirebaseService in my swift app, which role will be to login and signup the user. I want to make it happen with a delegation pattern.
I did the following
- create LoginViewDelegate
- create weak var delegate: LoginViewDelegate in my LoginViewController
3.Conform to LoginViewDelegate in my FirebaseService and implement the method
- typed loginViewController.delegate = self in the firebaseService init
So I think the problem is that FirebaseService is not initialized, cuz in LoginViewController the delegate is nil when I call the function. I tried to instantiate it in LoginViewController but it crashes because I think a cycle reference is made