xlform custom rows using nibs

949 Views Asked by At

I want to use XLFormSelectorCell but I need to customize the UI in a nib file. How do I do this? Can I just create a subclass from XLFormSelectorCell instead of XLFormBaseCell or do I really need to rewrite all the methods in XLFormSelectorCell? Can you show me the best way to do it? Thanks!

2

There are 2 best solutions below

0
On

In the overridden +load method of your custom cell, you need to add your cell in the XLFormViewController.cellClassesForRowDescriptorTypes dictionary. But, when using nibs, instead of the class, you should use a string containing the nibName.

For example:

[XLFormViewController.cellClassesForRowDescriptorTypes setObject:@"nibName" forKey:@"XLFormRowDescriptorYourCustomType"]
0
On

It is clearly mentioned with example in this link.

All you need to do is just create a custom cell of type XLFormBaseCell and then manipulate the data according to your requirement