-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storyboard viewcontroller circular dependency issue #307
Comments
Yeah. That is problem, since viewController created by Storyboard and not owned by typhoon (which required to work with circular references) |
We like to have use GH for bug tracking and general support on Stack Overflow. The advantage of StackOverflow is wider community involvement and therefore faster response time, and also its very well indexed by Google for future users. So, I hope you don't but I've copied your question here: |
If we do end up discovering a bug a feature request we can always reopen a new issue. Thanks for choosing Typhoon. |
My initial thoughts are that it should be straight forward to keep references to any storyboard created through TyphoonStoryboard and therefore easy to hook up them up as dependencies? |
There's a |
@jasperblues Agree. We can leave this as |
@foulkesjohn I made a change to that I think should work, but can't do unit tests at the moment. Can you try update to: pod 'Typhoon', :head And let me know how it goes? |
Doesn't seem have made a difference, not sure where to look to try and debug it either. Where should I be looking to try track down whats wrong? |
Oops. I only took you part of the way there. Can you try again?
Circular dependencies can be tricky because there's lots of recursion involved. It relies on |
One more change, and added the following test case, which passes: - (void)test_first_resolves_circular_dependencies {
StoryboardFirstlViewController *controller = [storyboard instantiateViewControllerWithIdentifier:@"first"];
StoryboardControllerDependency *dependency = controller.dependency;
StoryboardFirstlViewController *circular = dependency.circularDependencyBackToViewController;
XCTAssertTrue(controller == circular);
} Thanks for your patience. |
That seems to have worked, thanks for looking at it so quickly |
We'll push this out as a minor version then, so you don't have to pod from |
Pushed Typhoon 2.3.4 to CocoaPods master repo. |
I am loading view controllers from TyphoonStoryboard and have a definition for the class which works fine, several properties are injected with no problems. However one of the properties is a view which itself has a delegate property which I want to be the view controller instance. When the view comes to set the delegate property it tries to create a new instance of the view controller instead of using the instance which has been created by the storyboard. How can I make the delegate property use the current instance of the view controller? My definitions look something like this:
From what I can see the view controller can never be used a reference as it doesn't added a shared reference anywhere and Typhoon has no option but to instantiate a new one?
The text was updated successfully, but these errors were encountered: