Title: How to properly subclass an existing row
Tags: ios;swift;eureka-forms
Question: I'm needing help in correctly subclassing an existing row so I can change the UI only, not the function. The type of row I'd like to subclass is TextRow. 

Again, I only want to change the UI and not the functionality.

Eurek mentions here a way to do it but I can't seem to figure out the correct way to do it. I'd like to form rows look like this. 

The steps according to Eureka:



Subclassing cells using the same row

Sometimes we want to change the UI look of one of our rows but without changing the row type and all the logic associated to one row. There is currently one way to do this if you are using cells that are instantiated from nib files. Currently, none of Eureka's core rows are instantiated from nib files but some of the custom rows in EurekaCommunity are, in particular the PostalAddressRow which was moved there.

What you have to do is:


Create a nib file containing the cell you want to create.
Then set the class of the cell to be the existing cell you want to modify (if you want to change something more apart from pure UI then you should subclass that cell). Make sure the module of that class is correctly set
Connect the outlets to your class
Tell your row to use the new nib file. This is done by setting the cellProvider variable to use this nib. You should do this in the initialiser, either in each concrete instantiation or using the defaultRowInitializer. For example:

<<< PostalAddressRow() {
     $0.cellProvider = CellProvider(nibName: "CustomNib", bundle: Bundle.main)
}


You could also create a new row for this. In that case try to inherit from the same superclass as the row you want to change to inherit its logic.

There are some things to consider when you do this:

If you want to see an example have a look at the PostalAddressRow or the CreditCardRow which have use a custom nib file in their examples.
If you get an error saying ```Unknown class <YOUR_CLASS_NAME&gt; in Interface Builder file```, it might be that you have to instantiate that new type somewhere in your code to load it in the runtime. Calling let t = YourClass.self helped in my case.



Basically what I need help with is setting up the correct xib/nib and class to use within the form. Thank you.

Comment: What code have you tried so far?

Comment: @Carpsen90 I have followed a tutorial to build my own custom classes but it was a lot of work for only wanting to change my UI. I don't want to sublcass Cell and Row and design my own custom cells, I want to subclass an existing TextRow and just change the UI if that makes sense.



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 2, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2018:00:12/09/18', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<ios><swift><eureka-forms>', 'Title': 'How to properly subclass an existing row', 'ViewCount': 163, 'id': 53690461, 'user_AboutMe': None, 'user_AccountId': 6992551.0, 'user_DisplayName': 'Philzeey', 'user_Reputation': 51.0, 'user_Views': 21.0, 'user_id': 5361290.0}}