So, when I sat down last night to rewrite the way the “Add Account” feature in MobileChat was done, I realized how absolutely terrible we were handling the Preference table. There was no “straight forward” way to UIPreferencesTable’s and further more, no simple way to implemented segmented controls into it.
So, I wrote a few classes and a helper to take care of it for me. Here’s a run down:
* UIPreferencesTableGroup — Quickly create a group of cells
* UIPreferencesSegmentedTableGroup — Extends UIPreferencesTableGroup, but adds support for Segments
* UIPreferencesController — This is the dataSource/delegate of any UIPreferenceTalbe you create.
* UIPrefHelper — You can use this even without the above classes, just contains a few quick make functions to create text fields. Keep reading for the code and an example of the implementation…