-
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
Nib resolver for view controllers #82
Comments
Probably a good idea to also add an 'exclusions' property if you want the processor to skip some component. |
Hi Erik, This looks cool . . we could also implement 'name-space handlers'. This way you could have: <mvc:controller nib-name="myNib">
<property name="" ref=""/>
</mvc:controller>
There are other nice things you could put in the mvc namespace. . . we'd need something similar for the block-style, I guess. To proceed with this, we need to:
ps: Personally, I tend to favor UIViews implmented in code! (Not that there's anything wrong with xibs of course - wide range of tastes here). |
I like the MVC name-space idea. The block-style syntax could follow the same pattern. [TyphoonDefinition withViewControllerClass:[MyViewController class] nibNameOrNil:@"MyViewControllerView" properties: … ];
How ever it differs a bit from what I try to achieve with the postProcessor. Create a new issue for the MVC name-space support perhaps? Myself, I tend to use xibs for most view controllers. And there is a lot of boiler-plate code defining these in the Assembly currently. In one current project I am working on we are evaluating which xib to load in runtime, depending on if the device is an iPhone4 / iPhone5. With the postProcessor as an optional component that logic could easily be implemented in a subclass of TyphoonViewControllerNibResolver. |
Hmm. I guess I could always just implement this class myself and attach it as a postProcessor in the project. |
You can go ahead and push it to Typhoon if you like (you have push access). I think it will be useful to others. The one prerequisite is to: a) Put it in an iOS folder This way it won't break OSX. |
SHA: b32e214 |
Nice work Erik! |
Here's a suggestion for a default factory post processor to include for iOS:
TyphoonViewControllerNibResolver
Example:
The text was updated successfully, but these errors were encountered: