{"id":13611001,"url":"https://github.com/romaonthego/RETableViewManager","last_synced_at":"2025-04-13T01:33:55.988Z","repository":{"id":7187510,"uuid":"8490636","full_name":"romaonthego/RETableViewManager","owner":"romaonthego","description":"Powerful data driven content manager for UITableView.","archived":false,"fork":false,"pushed_at":"2016-05-05T08:49:37.000Z","size":6442,"stargazers_count":2477,"open_issues_count":54,"forks_count":428,"subscribers_count":98,"default_branch":"master","last_synced_at":"2025-04-10T04:01:12.860Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/romaonthego.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-28T23:44:17.000Z","updated_at":"2025-02-12T03:34:39.000Z","dependencies_parsed_at":"2022-08-20T08:00:21.629Z","dependency_job_id":null,"html_url":"https://github.com/romaonthego/RETableViewManager","commit_stats":null,"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romaonthego%2FRETableViewManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romaonthego%2FRETableViewManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romaonthego%2FRETableViewManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romaonthego%2FRETableViewManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/romaonthego","download_url":"https://codeload.github.com/romaonthego/RETableViewManager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647225,"owners_count":21139084,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T19:01:50.740Z","updated_at":"2025-04-13T01:33:55.546Z","avatar_url":"https://github.com/romaonthego.png","language":"Objective-C","funding_links":[],"categories":["Objective-C"],"sub_categories":[],"readme":"# RETableViewManager\n\n__Powerful data driven content manager for UITableView.__\n\n`RETableViewManager` allows to manage the content of any `UITableView` with ease, both forms and lists. `RETableViewManager` is built on top of reusable cells technique and provides APIs for mapping any object class to any custom cell subclass.\n\nThe general idea is to allow developers to use their own `UITableView` and `UITableViewController` instances (and even subclasses), providing a layer that synchronizes data with the cell appearance.\nIt fully implements `UITableViewDelegate` and `UITableViewDataSource` protocols so you don't have to.\n\n\u003cimg src=\"https://github.com/romaonthego/RETableViewManager/raw/master/Screenshot1.png\" alt=\"RETableViewManager Screenshot\" width=\"684\" height=\"568\" /\u003e\n\n\u003cimg src=\"https://github.com/romaonthego/RETableViewManager/raw/master/Screenshot2.png\" alt=\"RETableViewManager Screenshot\" width=\"684\" height=\"568\" /\u003e\n\n\u003cimg src=\"https://github.com/romaonthego/RETableViewManager/raw/master/Screenshot3.png\" alt=\"RETableViewManager Screenshot\" width=\"684\" height=\"568\" /\u003e\n\n### Quick Example\n\nGet your `UITableView` up and running in several lines of code:\n\n``` objective-c\n- (void)viewDidLoad\n{\n    [super viewDidLoad];\n\n    // Create the manager and assign a UITableView\n    //\n    self.manager = [[RETableViewManager alloc] initWithTableView:self.tableView];\n\n    // Add a section\n    //\n    RETableViewSection *section = [RETableViewSection sectionWithHeaderTitle:@\"Test\"];\n    [self.manager addSection:section];\n\n    // Add a string\n    //\n    [section addItem:@\"Just a simple NSString\"];\n\n    // Add a basic cell with disclosure indicator\n    //\n    [section addItem:[RETableViewItem itemWithTitle:@\"String cell\" accessoryType:UITableViewCellAccessoryDisclosureIndicator selectionHandler:^(RETableViewItem *item) {\n        NSLog(@\"Test: %@\", item);\n    }]];\n\n    // Custom items / cells\n    //\n    self.manager[@\"CustomItem\"] = @\"CustomCell\";\n\n    [section addItem:[CustomItem item]];\n}\n```\n\n\u003e RETableViewManager comes pre-packaged with extensible and ready-to-use in production components:\n\n\u003e * Text\n* Bool\n* Number\n* Float\n* Date/Time\n* Long Text\n* Radio option selector\n* Multiple option selector\n* Credit card and expiration date\n\nAlso `RETableViewManager` provides APIs for super easy cell styling.\n\n## Requirements\n* Xcode 5 or higher\n* Apple LLVM compiler\n* iOS 7.0 or higher\n* ARC\n\n## Demo\n\nBuild and run the `RETableViewManagerExample.xcworkspace` in Xcode to see `RETableViewManager` in action.\n\n## Installation\n\n### 1) CocoaPods\n\nThe recommended approach for installing `RETableViewManager` is via the [CocoaPods](http://cocoapods.org/) package manager, as it provides flexible dependency management and dead simple installation.\nFor best results, it is recommended that you install via CocoaPods \u003e= **0.28.0** using Git \u003e= **1.8.0** installed via Homebrew.\n\nInstall CocoaPods if not already available:\n\n``` bash\n$ [sudo] gem install cocoapods\n$ pod setup\n```\n\nChange to the directory of your Xcode project:\n\n``` bash\n$ cd /path/to/MyProject\n$ touch Podfile\n$ edit Podfile\n```\n\nEdit your Podfile and add RETableViewManager:\n\n``` bash\nplatform :ios, '7.0'\npod 'RETableViewManager', '~\u003e 1.6'\n```\n\nInstall into your Xcode project:\n\n``` bash\n$ pod install\n```\n\nOpen your project in Xcode from the .xcworkspace file (not the usual project file)\n\n``` bash\n$ open MyProject.xcworkspace\n```\n\nPlease note that if your installation fails, it may be because you are installing with a version of Git lower than CocoaPods is expecting. Please ensure that you are running Git \u003e= **1.8.0** by executing `git --version`. You can get a full picture of the installation details by executing `pod install --verbose`.\n\n### 2) Include Source Code\n\nInclude RETableViewManager, REValidation, Resources, REFormattedNumberField folders in your source code\n\n\n## API Quickstart\n\n\u003ctable\u003e\n  \u003ctr\u003e\u003cth colspan=\"2\" style=\"text-align:center;\"\u003eKey Classes\u003c/th\u003e\u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eRETableViewManager\u003c/td\u003e\n    \u003ctd\u003eThe manager class. Each manager has multiple \u003ctt\u003eRETableViewSection\u003c/tt\u003e sections.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eRETableViewSection\u003c/td\u003e\n    \u003ctd\u003eRepresents sections in \u003ctt\u003eRETableViewManager\u003c/tt\u003e, each section has multiple \u003ctt\u003eRETableViewItem\u003c/tt\u003e items.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eRETableViewItem\u003c/td\u003e\n    \u003ctd\u003e\u003ctt\u003eRETableViewItem\u003c/tt\u003e is the root class of most \u003ctt\u003eRETableViewManager\u003c/tt\u003e item hierarchies.\u003cbr /\u003e\n    Through \u003ctt\u003eRETableViewItem\u003c/tt\u003e, items inherit a basic interface that communicates with \u003ctt\u003eRETableViewCell\u003c/tt\u003e and \u003ctt\u003eRETableViewManager\u003c/tt\u003e.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eRETableViewCell\u003c/td\u003e\n    \u003ctd\u003eThe \u003ctt\u003eRETableViewCell\u003c/tt\u003e class defines the attributes and behavior of the cells that appear in \u003ctt\u003eUITableView\u003c/tt\u003e objects.\n     You should subclass \u003ctt\u003eRETableViewCell\u003c/tt\u003e to obtain cell characteristics and behavior specific to your application's needs.\n     By default, \u003ctt\u003eRETableViewCell\u003c/tt\u003e is being mapped with \u003ctt\u003eRETableViewItem\u003c/tt\u003e.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\u003cth colspan=\"2\" style=\"text-align:center;\"\u003eStyling\u003c/th\u003e\u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eRETableViewCellStyle\u003c/td\u003e\n    \u003ctd\u003eProvides style for \u003ctt\u003eRETableViewCell\u003c/tt\u003e subclasses. You can define such properties as\n    \u003ctt\u003ebackgroundImageMargin\u003c/tt\u003e, \u003ctt\u003ecellHeight\u003c/tt\u003e, \u003ctt\u003econtentViewMargin\u003c/tt\u003e and more.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\u003cth colspan=\"2\" style=\"text-align:center;\"\u003eHelper Controllers\u003c/th\u003e\u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eRETableViewOptionsController\u003c/td\u003e\n    \u003ctd\u003ePerforms selection based on user input and provides result on completion. Should be used with \u003ctt\u003eRERadioItem\u003c/tt\u003e.\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n`RETableViewManager` includes a number of built-in items and cells that perform common tasks (text input, date input and so on).\n\n\u003ctable\u003e\n  \u003ctr\u003e\u003cth colspan=\"3\" style=\"text-align:center;\"\u003eBuilt-in Items and Cells\u003c/th\u003e\u003c/tr\u003e\n  \u003ctr\u003e\n    \u003cth\u003eItem Class\u003c/th\u003e\n    \u003cth\u003eCell Class\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eRETextItem\u003c/td\u003e\n    \u003ctd\u003eRETableViewTextCell\u003c/td\u003e\n    \u003ctd\u003eProvides convenience for a user text input. You can set a bunch of properties through \u003ctt\u003eRETextItem\u003c/tt\u003e that you would\n    normally find in \u003ctt\u003eUITextField\u003c/tt\u003e.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eRELongTextItem\u003c/td\u003e\n    \u003ctd\u003eRETableViewLongTextCell\u003c/td\u003e\n    \u003ctd\u003eProvides convenience for a multiline user text input. You can set a bunch of properties through \u003ctt\u003eRELongTextItem\u003c/tt\u003e that you would\n    normally find in \u003ctt\u003eUITextView\u003c/tt\u003e.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eRENumberItem\u003c/td\u003e\n    \u003ctd\u003eRETableViewNumberCell\u003c/td\u003e\n    \u003ctd\u003eProvides convenience for a user number input using \u003ca href=\"https://github.com/romaonthego/REFormattedNumberField\"\u003eREFormattedNumberField\u003c/a\u003e.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eREBoolItem\u003c/td\u003e\n    \u003ctd\u003eRETableViewBoolCell\u003c/td\u003e\n    \u003ctd\u003eProvides convenience for a user boolean input using \u003ctt\u003eUISwitch\u003c/tt\u003e.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eRERadioItem\u003c/td\u003e\n    \u003ctd\u003eRETableViewCell\u003c/td\u003e\n    \u003ctd\u003eProvides convenience for selecting a single option using \u003ctt\u003eRETableViewOptionsController\u003c/tt\u003e.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eREMultipleChoiceItem\u003c/td\u003e\n    \u003ctd\u003eRETableViewCell\u003c/td\u003e\n    \u003ctd\u003eProvides convenience for selecting multiple options using \u003ctt\u003eRETableViewOptionsController\u003c/tt\u003e.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eREFloatItem\u003c/td\u003e\n    \u003ctd\u003eRETableViewFloatCell\u003c/td\u003e\n    \u003ctd\u003eProvides convenience for adjusting float values ranging from 0.0 to 1.0.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eREDateTimeItem\u003c/td\u003e\n    \u003ctd\u003eRETableViewDateTimeCell\u003c/td\u003e\n    \u003ctd\u003eProvides convenience for modifying date in \u003ctt\u003eNSDate\u003c/tt\u003e objects.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eREPickerItem\u003c/td\u003e\n    \u003ctd\u003eRETableViewPickerCell\u003c/td\u003e\n    \u003ctd\u003eProvides convenience for selecting multiple options using \u003ctt\u003eUIPickerView\u003c/tt\u003e.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eRESegmentedItem\u003c/td\u003e\n    \u003ctd\u003eRETableViewSegmentedCell\u003c/td\u003e\n    \u003ctd\u003eProvides convenience for working with \u003ctt\u003eUISegmentedControl\u003c/tt\u003e.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eRECreditCardItem\u003c/td\u003e\n    \u003ctd\u003eRETableViewCreditCardCell\u003c/td\u003e\n    \u003ctd\u003eProvides convenience for a user credit card input. Allows to enter a credit card number, expiration date and security code, all in a single table view cell.\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Examples\n\n### Creating Sections Example\n\nSection without a title:\n\n``` objective-c\nRETableViewSection *section = [RETableViewSection section];\n[self.manager addSection:section];\n```\n\nSection with a title:\n\n``` objective-c\nRETableViewSection *section = [RETableViewSection sectionWithHeaderTitle:@\"Header\"];\n[self.manager addSection:section];\n```\n\nSection with a title and a footer:\n\n``` objective-c\nRETableViewSection *section = [RETableViewSection sectionWithHeaderTitle:@\"Header\" footerTitle:@\"Footer\"];\n[self.manager addSection:section];\n```\n\nSection with a custom header view:\n\n``` objective-c\nRETableViewSection *section = [RETableViewSection sectionWithHeaderView:myCustomSectionHeaderView];\n[self.manager addSection:section];\n```\n\nSection with a custom header and footer view:\n\n``` objective-c\nRETableViewSection *section = [RETableViewSection sectionWithHeaderView:myCustomSectionHeaderView footerView:myCustomSectionFooterView];\n[self.manager addSection:section];\n```\n\n### Text (UITextField) and Number (REFormattedNumberField) Item Example\n\n``` objective-c\n// Create the manager\n//\nself.manager = [[RETableViewManager alloc] initWithTableView:self.tableView];\n\n// Add a section\n//\nRETableViewSection *section = [RETableViewSection sectionWithHeaderTitle:@\"Test\"];\n[self.manager addSection:section];\n\n// Add items to the section\n//\nself.textItem = [RETextItem itemWithTitle:@\"Enter text\" value:@\"\"];\n[section addItem:self.textItem];\n\nself.numberItem = [RENumberItem itemWithTitle:@\"Enter text\" value:@\"\" placeholder:@\"(123) 456-7890\" format:@\"(XXX) XXX-XXXX\"];\n[section addItem:self.numberItem];\n```\n\nYou can read `self.textItem.value` and `self.numberItem.value` later whenever you need them.\n\n### Bool Item (UISwitch) Example\n\n``` objective-c\n// Create the manager\n//\nself.manager = [[RETableViewManager alloc] initWithTableView:self.tableView];\n\n// Add a section\n//\nRETableViewSection *section = [RETableViewSection sectionWithHeaderTitle:@\"Test\"];\n[self.manager addSection:section];\n\n// Add a bool value cell (using UISwitch)\n//\n[section addItem:[REBoolItem itemWithTitle:@\"Switch test\" value:YES switchValueChangeHandler:^(REBoolItem *item) {\n    NSLog(@\"Value: %i\", item.value);\n}]];\n```\n\n### Radio (RETableViewOptionsController) Item Example\n\n``` objective-c\n// Create the manager\n//\nself.manager = [[RETableViewManager alloc] initWithTableView:self.tableView];\n\n// Add a section\n//\nRETableViewSection *section = [RETableViewSection sectionWithHeaderTitle:@\"Test\"];\n[self.manager addSection:section];\n\n// Add radio cell (options)\n//\n\n    __typeof (\u0026*self) __weak weakSelf = self;\n\n     RERadioItem *radioItem = [RERadioItem itemWithTitle:@\"Radio\" value:@\"Option 4\" selectionHandler:^(RERadioItem *item) {\n        [item deselectRowAnimated:YES]; // same as [weakSelf.tableView deselectRowAtIndexPath:item.indexPath animated:YES];\n\n        // Generate sample options\n        //\n        NSMutableArray *options = [[NSMutableArray alloc] init];\n        for (NSInteger i = 1; i \u003c 40; i++)\n            [options addObject:[NSString stringWithFormat:@\"Option %li\", (long) i]];\n\n        // Present options controller\n        //\n        RETableViewOptionsController *optionsController = [[RETableViewOptionsController alloc] initWithItem:item options:options multipleChoice:NO completionHandler:^{\n            [weakSelf.navigationController popViewControllerAnimated:YES];\n\n            [item reloadRowWithAnimation:UITableViewRowAnimationNone]; // same as [weakSelf.tableView reloadRowsAtIndexPaths:@[item.indexPath] withRowAnimation:UITableViewRowAnimationNone];\n        }];\n\n        // Adjust styles\n        //\n        optionsController.delegate = weakSelf;\n        optionsController.style = section.style;\n        if (weakSelf.tableView.backgroundView == nil) {\n            optionsController.tableView.backgroundColor = weakSelf.tableView.backgroundColor;\n            optionsController.tableView.backgroundView = nil;\n        }\n\n        // Push the options controller\n        //\n        [weakSelf.navigationController pushViewController:optionsController animated:YES];\n    }];\n\n    [section addItem:radioItem];\n\n\n```\n\n### Float Item (UISlider) Example\n\n``` objective-c\n// Create the manager\n//\nself.manager = [[RETableViewManager alloc] initWithTableView:self.tableView];\n\n// Add a section\n//\nRETableViewSection *section = [RETableViewSection sectionWithHeaderTitle:@\"Test\"];\n[self.manager addSection:section];\n\n// Add a float item\n//\n[section addItem:[REFloatItem itemWithTitle:@\"Float item\" value:0.3 sliderValueChangeHandler:^(REFloatItem *item) {\n    NSLog(@\"Value: %f\", item.value);\n}]];\n```\n\n### Date Item Example\n\n``` objective-c\n// Create the manager\n//\nself.manager = [[RETableViewManager alloc] initWithTableView:self.tableView];\n\n// Add a section\n//\nRETableViewSection *section = [RETableViewSection sectionWithHeaderTitle:@\"Test\"];\n[self.manager addSection:section];\n\n// Add a date item\n//\n[section addItem:[REDateTimeItem itemWithTitle:@\"Date / Time\" value:[NSDate date] placeholder:nil format:@\"MM/dd/yyyy hh:mm a\" datePickerMode:UIDatePickerModeDateAndTime]];\n```\n\n### Picker Item Example\n\n``` objective-c\n// Create the manager\n//\nself.manager = [[RETableViewManager alloc] initWithTableView:self.tableView];\n\n// Add a section\n//\nRETableViewSection *section = [RETableViewSection sectionWithHeaderTitle:@\"Test\"];\n[self.manager addSection:section];\n\n// Add a picker item\n//\n[section addItem:[REPickerItem itemWithTitle:@\"Picker\" value:@[@\"Item 12\", @\"Item 23\"] placeholder:nil options:@[@[@\"Item 11\", @\"Item 12\", @\"Item 13\"], @[@\"Item 21\", @\"Item 22\", @\"Item 23\", @\"Item 24\"]]]];\n```\n\n### Segmented Item Example\n\n``` objective-c\n// Create the manager\n//\nself.manager = [[RETableViewManager alloc] initWithTableView:self.tableView];\n\n// Add a section\n//\nRETableViewSection *section = [RETableViewSection sectionWithHeaderTitle:@\"Test\"];\n[self.manager addSection:section];\n\n// Add a segmented item\n//\n[section addItem:[RESegmentedItem itemWithTitles:@[@\"One\", @\"Two\"] value:1 switchValueChangeHandler:^(RESegmentedItem *item) {\n    NSLog(@\"Value: %i\", item.value);\n}]];\n```\n\n### Validations\n\nValidations are performed using [REValidation](https://github.com/romaonthego/REValidation) library.\n\nExample:\n\n```objective-c\nself.textItem = [RETextItem itemWithTitle:@\"Text\" value:@\"\" placeholder:@\"Text item\"];\nself.textItem.validators = @[@\"presence\", @\"length(3, 10)\"];\n\nself.emailItem = [RETextItem itemWithTitle:@\"Email\" value:@\"\" placeholder:@\"Email item\"];\nself.emailItem.name = @\"Your email\";\nself.emailItem.validators = @[@\"presence\", @\"email\"];\n```\n\nEach item, each section and the manager have property `errors`. This property is always up to date with errors on each level.\nFor example, an `RETableViewItem` would only have its own validation errors, `RETableViewSection` would have all errors that occured in that section (one per item).\n`RETableViewManager`'s property `errors` would reflect all errors.\n\n### Custom Cells\n\n`RETableViewManager` allows to map custom objects to custom cells. In order to map your custom object (an item) to a cell,\nsimply write:\n\n```objective-c\nself.manager[@\"CustomItem\"] = @\"CustomCell\";\n```\n\nIf you take a look at [RETableViewManager Source Code](https://github.com/romaonthego/RETableViewManager/blob/master/RETableViewManager/RETableViewManager.m) you may\nfind out how default mapping is being performed:\n\n``` objective-c\n- (void)registerDefaultClasses\n{\n    self[@\"__NSCFConstantString\"] = @\"RETableViewCell\";\n    self[@\"__NSCFString\"] = @\"RETableViewCell\";\n    self[@\"NSString\"] = @\"RETableViewCell\";\n    self[@\"RETableViewItem\"] = @\"RETableViewCell\";\n    self[@\"RERadioItem\"] = @\"RETableViewOptionCell\";\n    self[@\"REBoolItem\"] = @\"RETableViewBoolCell\";\n    self[@\"RETextItem\"] = @\"RETableViewTextCell\";\n    self[@\"RELongTextItem\"] = @\"RETableViewLongTextCell\";\n    self[@\"RENumberItem\"] = @\"RETableViewNumberCell\";\n    self[@\"REFloatItem\"] = @\"RETableViewFloatCell\";\n    self[@\"REDateTimeItem\"] = @\"RETableViewDateTimeCell\";\n    self[@\"RECreditCardItem\"] = @\"RETableViewCreditCardCell\";\n    self[@\"REMultipleChoiceItem\"] = @\"RETableViewOptionCell\";\n}\n```\n\nYour custom items should be subclassed from `RETableViewItem`. Custom cells should be subclassed from `RETableViewCell`.\nThese are 2 base classes that provide all necessary logic to bound your subclasses together.\n\nIn your `RETableViewCell` subclass you need to link an `item` object with your item. This could be simply done by declaring\nit:\n\n```objective-c\n#import \u003cRETableViewManager/RETableViewManager.h\u003e\n#import \"CustomItem.h\"\n\n@interface CustomCell : RETableViewCell\n\n@property (strong, readwrite, nonatomic) CustomItem *item;\n\n@end\n```\n\nAfter that your custom object (item) is ready to use within the cell.\n\nThere are 3 basic methods of `RETableViewCell` that you need to implement:\n\n* Class method to adjust cell size:\n\n```objective-c\n+ (CGFloat)heightWithItem:(RETableViewItem *)item tableViewManager:(RETableViewManager *)tableViewManager;\n```\n\nYour custom item will be passed to this method in order to determine cell size. You need to return the calculated size.\n\n* Instance method that is being fired when the cell is being created.\n\n```objective-c\n- (void)cellDidLoad;\n```\n\nYou might want to create cell subviews here. This method will be called only once, after that the cell will be reused.\n\n* Instance method that is being fired each time the cell is being reused.\n\n```objective-c\n- (void)cellWillAppear;\n```\n\n`cellWillAppear` is a great place to assign values to labels (from your custom item), adjust colors, etc.\n\nQuick example:\n\n```objective-c\n- (void)cellDidLoad\n{\n    [super cellDidLoad];\n    self.testLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 44)];\n    [self.contentView addSubview:self.testLabel];\n}\n\n- (void)cellWillAppear\n{\n    [super cellWillAppear];\n    self.testLabel.text = self.item.someVariable;\n}\n```\n\n### Interface Builder Support\n\nInterface builder cells are supported out of the box, no special set up needed.\nCells and items are being automatically registered like any other custom cells in `RETableViewManager`:\n\n```objective-c\nself.manager[@\"XIBTestItem\"] = @\"XIBTestCell\";\n```\n\nHere `XIBTestItem` would be your cell identifier and you should have the `XIBTestCell.xib` file in your bundle. That's it.\n\n### Styling\n\nIt's super easy to customize different offsets and cell background images of\nthe entire `UITableView` (or any particular section) with `RETableViewManager`.\n\n`RETableViewManager` and `RETableViewSection` both have the `style` property (an instance of the `RETableViewCellStyle` class).\n\nHere's the quick example of how the custom styling works:\n\n```objective-c\n// Set default cell height\n//\nself.manager.style.cellHeight = 42.0;\n\n// Set cell background image\n//\n[self.manager.style setBackgroundImage:[[UIImage imageNamed:@\"First\"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10)]\n                           forCellType:RETableViewCellTypeFirst];\n[self.manager.style setBackgroundImage:[[UIImage imageNamed:@\"Middle\"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10)]\n                           forCellType:RETableViewCellTypeMiddle];\n[self.manager.style setBackgroundImage:[[UIImage imageNamed:@\"Last\"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10)]\n                           forCellType:RETableViewCellTypeLast];\n[self.manager.style setBackgroundImage:[[UIImage imageNamed:@\"Single\"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10)]\n                           forCellType:RETableViewCellTypeSingle];\n\n// Set selected cell background image\n//\n[self.manager.style setSelectedBackgroundImage:[[UIImage imageNamed:@\"First_Selected\"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10)]\n                                   forCellType:RETableViewCellTypeFirst];\n[self.manager.style setSelectedBackgroundImage:[[UIImage imageNamed:@\"Middle_Selected\"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10)]\n                                   forCellType:RETableViewCellTypeMiddle];\n[self.manager.style setSelectedBackgroundImage:[[UIImage imageNamed:@\"Last_Selected\"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10)]\n                                   forCellType:RETableViewCellTypeLast];\n[self.manager.style setSelectedBackgroundImage:[[UIImage imageNamed:@\"Single_Selected\"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10)]\n                                   forCellType:RETableViewCellTypeSingle];\n\nself.manager.style.contentViewMargin = 10.0;\n    self.manager.style.backgroundImageMargin = 10.0;\n\n// Set a custom style for a particular section\n//\nself.accessoriesSection.style = [self.manager.style copy];\n[self.accessoriesSection.style setBackgroundImage:[[UIImage imageNamed:@\"First_Alt\"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10)]\n                                      forCellType:RETableViewCellTypeFirst];\n[self.accessoriesSection.style setBackgroundImage:[[UIImage imageNamed:@\"Middle_Alt\"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10)]\n                                      forCellType:RETableViewCellTypeMiddle];\n[self.accessoriesSection.style setBackgroundImage:[[UIImage imageNamed:@\"Last_Alt\"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10)]\n                                      forCellType:RETableViewCellTypeLast];\n[self.accessoriesSection.style setBackgroundImage:[[UIImage imageNamed:@\"Single_Alt\"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10)]\n                                      forCellType:RETableViewCellTypeSingle];\n```\n\n## Contact\n\nRoman Efimov\n\n- https://github.com/romaonthego\n- https://twitter.com/romaonthego\n- romefimov@gmail.com\n\n## License\n\nRETableViewManager is available under the MIT license.\n\nCopyright © 2013 Roman Efimov.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromaonthego%2FRETableViewManager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromaonthego%2FRETableViewManager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromaonthego%2FRETableViewManager/lists"}