Latest1.5.1
Homepagehttps://github.com/bigfish24/ABFRealmTableViewController
LicenseMIT
Platformsios 8.0, requires ARC
DependenciesSwiftFetchedResultsController, RealmSwift
Authors

ABFRealmTableViewController

The ABFRealmTableViewController class is a subclass of UITableViewController but adds data binding to a Realm object class. The underlying UITableView will animate changes via use of RBQFetchedResultsController.

A Swift version was added with an identical API in v1.1.

To use, simply subclass ABFRealmTableViewController in the same way as UITableViewController and set the entityName property to the Realm object class name. Similar to an UITableView implementation, you will need to implement the necessary UITableViewControllerDelegate and UITableViewControllerDataSource protocols.

Starting with v1.5, the underlying data binding provided by RBQFetchedResultsController doesn’t require any use of custom Realm mutation methods since Realm supports fine-grained notifications directly. As a result, you can just use ABFRealmTableViewController alongside the normal Realm methods.

Screenshot

The example application is a basic todo list with an object model: TaskObject that the UITableView is bound to. When a new TaskObject is created, the row animates in, and likewise when the TaskObject is deleted the row animates out.

Todo List Backed By ABFRealmTableViewController

Installation

ABFRealmTableViewController is available through CocoaPods. To install
it, simply add the following line to your Podfile:

Objective-C

pod 'ABFRealmTableViewController'

Swift

pod 'RealmTableViewController'

Demo

Build and run/test the Example project in Xcode to see ABFRealmTableViewController in action. This project uses CocoaPods. If you don’t have CocoaPods installed, grab it with [sudo] gem install cocoapods.

Objective-C

git clone https://github.com/bigfish24/ABFRealmTableViewController.git
cd ABFRealmTableViewController/ABFRealmTableViewControllerExample
pod install
open ABFRealmTableViewController.xcworkspace
Requirements
  • iOS 8+
  • Xcode 6+

Swift

git clone https://github.com/bigfish24/ABFRealmMapView.git
cd ABFRealmTableViewController/SwiftExample
pod install
open RealmTableViewController.xcworkspace
Requirements
  • iOS 8+
  • Xcode 7

Latest podspec

{
    "name": "RealmTableViewController",
    "version": "1.5.1",
    "summary": "Realm Swift Data-Binding For UITableView",
    "description": "The RealmTableViewController class is a subclass of UITableViewController but adds data-binding to a Realm Swift object subclass.",
    "homepage": "https://github.com/bigfish24/ABFRealmTableViewController",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Adam Fish": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/bigfish24/ABFRealmTableViewController.git",
        "tag": "v1.5.1"
    },
    "source_files": "RealmTableViewController/*.{swift}",
    "requires_arc": true,
    "dependencies": {
        "SwiftFetchedResultsController": [
            ">= 4.0.3"
        ],
        "RealmSwift": [
            ">= 0.103.0"
        ]
    }
}

Pin It on Pinterest

Share This