-
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
TyphoonStoryboard review #182
Comments
History: The current approach is to obtain an instance from the StoryBoard, and then tell Typhoon to inject it. Not nice. Other approaches:
Aleksey recommenced the last option, and I agree it appears to have the most merits. |
Good job Aleksey! - (void)injectProperties:(id)instance withDefinition:(SEL)selector comes around the previous limitation where you would only be able to safely inject properties on an object if there was only one definition for that class in the assembly. |
@eriksundin We should add that immediately at the TyphoonComponentFactory level, to get around the current limitation where "bring-your-own-instance" only supports by-type matching. For the pending TyphoonStoryboard (sub-class), we'll take it a little further: Make it a by convention approach, where the TyphoonDefinition key (ie selector in block-style) matches the storyboard identifier. . then just obtain the instance from the TyphoonStoryboard .. will come pre-injected. This should work in 99% of cases, but if not then fall back to the "bring-your-own-instance" style. |
@jasperblues using storyboad identifier as TyphoonDefinitionKey is ideal solution, but it can't be done :-( Tthe problem is in creation UINavigationController and UITabBarController - these controllers have 'relation' segues ('rootViewController' and 'viewController') but method I also thought of using restorationIdentifier (easer to specify in storyboard) as TyphoonDefinitionKey, but its avatailable since 6.0 :-( |
@jasperblues To see that I said in previous comment: |
Here's some other ideas to explore:
Update: Neither of the above suggestions are plausible. |
@alexgarbarev Great job. . . we've ruled out other approaches. Any more comments (from anyone) before we close? |
Issue to review feature
The text was updated successfully, but these errors were encountered: