Closed ivanyorgov closed 7 years ago
+1
Have you tried to inject TyphoonConfig(@"singleObject")
. I think it will inject an NSArray of custom objects. Or not?
@alexgarbarev For singleObject it works, because it is a single object. It doesn't work for the second case with array of objects in the config.
@ivanyorgov This feature is not currently possible. You can use a custom TyphoonTypeConverter
for this. See documentation for more info.
E.g. You'd be able to write a TyphoonTypeConverter
that can convert this:
<key>MyArray</key>
<string>CustomArray(object1,object2,object3,object4)</string>
into this:
@[@"object1", @"object2", @"object3", @"object4"]
Does it solve your problem?
@etolstoy I also thought of this, but in the end came up with another solution. I've created a retriever object to which I inject the configuration, then I use the TypeConverter manually. I inject the retriever object to the controller, and when needed I get the objects.
Great! Closing this issue then.
Hi, I've created a TyphoonTypeConverter for a custom object, I have tested it with a single object injection from the config file, and it is working fine.
Is it currently possible to make it work with an array of objects from the config.
I have tried with no success.