{"id":13719734,"url":"https://github.com/RxSwiftCommunity/RxRealmDataSources","last_synced_at":"2025-05-07T11:32:35.077Z","repository":{"id":14101818,"uuid":"75845935","full_name":"RxSwiftCommunity/RxRealmDataSources","owner":"RxSwiftCommunity","description":"An easy way to bind an RxRealm observable to a table or collection view ","archived":false,"fork":false,"pushed_at":"2022-01-08T11:02:14.000Z","size":95,"stargazers_count":161,"open_issues_count":10,"forks_count":47,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-10T00:25:11.371Z","etag":null,"topics":["binding","collectionview","reactive","realm","realmswift","tableview"],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/RxSwiftCommunity.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":"2016-12-07T14:53:17.000Z","updated_at":"2024-10-29T06:23:35.000Z","dependencies_parsed_at":"2022-08-07T07:16:18.084Z","dependency_job_id":null,"html_url":"https://github.com/RxSwiftCommunity/RxRealmDataSources","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FRxRealmDataSources","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FRxRealmDataSources/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FRxRealmDataSources/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FRxRealmDataSources/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RxSwiftCommunity","download_url":"https://codeload.github.com/RxSwiftCommunity/RxRealmDataSources/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252869156,"owners_count":21816984,"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":["binding","collectionview","reactive","realm","realmswift","tableview"],"created_at":"2024-08-03T01:00:54.789Z","updated_at":"2025-05-07T11:32:30.228Z","avatar_url":"https://github.com/RxSwiftCommunity.png","language":"Swift","readme":"# RxRealmDataSources\n\n[![Version](https://img.shields.io/cocoapods/v/RxRealmDataSources.svg?style=flat)](http://cocoapods.org/pods/RxRealmDataSources)\n[![License](https://img.shields.io/cocoapods/l/RxRealmDataSources.svg?style=flat)](http://cocoapods.org/pods/RxRealmDataSources)\n[![Platform](https://img.shields.io/cocoapods/p/RxRealmDataSources.svg?style=flat)](http://cocoapods.org/pods/RxRealmDataSources)\n\nThis library is currently WIP.\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Usage\n\nThis library is a light data source implementation for `RxRealm`. It allows you to easily bind an Observable sequence of Realm objects to a table or a collection view. The library is both iOS and macOS compatible.\n\n### Binding to a table view\n\nCheck out the included demo app to see this in action.\n\n```swift\n// create data source\nlet dataSource = RxTableViewRealmDataSource\u003cLap\u003e(cellIdentifier: \"Cell\", cellType: PersonCell.self) {cell, ip, lap in\n    cell.customLabel.text = \"\\(ip.row). \\(lap.text)\"\n}\n\n// RxRealm to get Observable\u003cResults\u003e\nlet realm = try! Realm(configuration: DataRandomizer.realmConfig)\nlet laps = Observable.changeset(from: realm.objects(Timer.self).first!.laps)\n    .share()\n\n// bind to table view\nlaps\n    .bindTo(tableView.rx.realmChanges(dataSource))\n    .disposed(by: bag)\n```\n\n### Binding to a collection view\n\nCheck out the included demo app to see this in action.\n\n```swift\n// create data source\nlet dataSource = RxCollectionViewRealmDataSource\u003cLap\u003e(cellIdentifier: \"Cell\", cellType: LapCollectionCell.self) {cell, ip, lap in\n    cell.customLabel.text = \"\\(ip.row). \\(lap.text)\"\n}\n\n// RxRealm to get Observable\u003cResults\u003e\nlet realm = try! Realm(configuration: DataRandomizer.realmConfig)\nlet laps = Observable.changeset(from: realm.objects(Timer.self).first!.laps)\n    .share()\n\n// bind to collection view\nlaps\n    .bindTo(collectionView.rx.realmChanges(dataSource))\n    .disposed(by: bag)\n```\n\n### Reacting to cell taps\n\nThe library adds an extension to table views and collection views, allowing you to easily subscribe to the cell selected delegate event. Here's a snippet from the example demo app:\n\n```swift\ntableView.rx.realmModelSelected(Lap.self)\n  .map({ $0.text })\n  .bind(to: rx.title)\n  .disposed(by: bag)\n```\n\n## Installation\n\nThis library depends on __RxSwift__,  __RealmSwift__, and __RxRealm__.\n\n#### CocoaPods\nRxRealm is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile:\n\n```ruby\npod \"RxRealmDataSources\"\n```\n\n## TODO\n\n* Test add platforms and add compatibility for the pod\n\n## License\n\nThis library belongs to _RxSwiftCommunity_. It has been created by Marin Todorov.\n\nRxRealm is available under the MIT license. See the LICENSE file for more info.\n","funding_links":[],"categories":["Libraries"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRxSwiftCommunity%2FRxRealmDataSources","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRxSwiftCommunity%2FRxRealmDataSources","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRxSwiftCommunity%2FRxRealmDataSources/lists"}