{"id":15787174,"url":"https://github.com/fmo91/dequeuableregistrable","last_synced_at":"2025-03-14T11:31:34.824Z","repository":{"id":56908447,"uuid":"78159626","full_name":"fmo91/DequeuableRegistrable","owner":"fmo91","description":"Safe and convenient registering and dequeuing of UITableViewCells and UICollectionViewCells without using strings.","archived":false,"fork":false,"pushed_at":"2019-01-02T18:30:25.000Z","size":50,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-11T21:45:22.301Z","etag":null,"topics":["ios","protocol-oriented","swift","uicollectionview","uitableview"],"latest_commit_sha":null,"homepage":"https://fmo91.github.io/DequeuableRegistrable/","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/fmo91.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":"2017-01-06T00:32:12.000Z","updated_at":"2024-09-07T13:04:14.000Z","dependencies_parsed_at":"2022-08-21T03:50:20.444Z","dependency_job_id":null,"html_url":"https://github.com/fmo91/DequeuableRegistrable","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmo91%2FDequeuableRegistrable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmo91%2FDequeuableRegistrable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmo91%2FDequeuableRegistrable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmo91%2FDequeuableRegistrable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fmo91","download_url":"https://codeload.github.com/fmo91/DequeuableRegistrable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243569665,"owners_count":20312477,"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":["ios","protocol-oriented","swift","uicollectionview","uitableview"],"created_at":"2024-10-04T21:06:06.591Z","updated_at":"2025-03-14T11:31:31.817Z","avatar_url":"https://github.com/fmo91.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DequeuableRegistrable\n\n[![CI Status](http://img.shields.io/travis/Fernando Ortiz/DequeuableRegistrable.svg?style=flat)](https://travis-ci.org/Fernando Ortiz/DequeuableRegistrable)\n[![Version](https://img.shields.io/cocoapods/v/DequeuableRegistrable.svg?style=flat)](http://cocoapods.org/pods/DequeuableRegistrable)\n[![License](https://img.shields.io/cocoapods/l/DequeuableRegistrable.svg?style=flat)](http://cocoapods.org/pods/DequeuableRegistrable)\n[![Platform](https://img.shields.io/cocoapods/p/DequeuableRegistrable.svg?style=flat)](http://cocoapods.org/pods/DequeuableRegistrable)\n\n## Introduction\n\nDequeuableRegistrable is a simple set of protocol extensions that allow registering and dequeuing cells and footers/headers (either from UITableView or UICollectionView) without using unsafe strings or explicit casting.\n\n\n\n## Example Project\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Requirements\n\n* iOS 9.0 or higher\n* Swift 3.0 or higher\n\n## Installation\n\nDequeuableRegistrable is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"DequeuableRegistrable\", :git =\u003e \"https://github.com/fmo91/DequeuableRegistrable/\"\n```\n\n## At a glance\n\nDequeuableRegistrable turns registering from this:\n\n```swift\ntableView.register(UINib(nibName: \"DogCell\", bundle: nil), forCellReuseIdentifier: \"DogCell\")\n```\n\nto this\n\n```swift\nDogCell.register(in: tableView)\n```\n\nand turns dequeuing from this:\n\n```swift\nlet cell = tableView.dequeueReusableCell(withIdentifier: \"DogCell\") as! DogCell\n```\n\nto this:\n\n```swift\nlet cell = DogCell.dequeue(from: tableView) \n// cell is DogCell, not UITableViewCell. It's already casted.\n```\n\nat the only cost of doing this:\n\n```swift\nextension DogCell: Registrable, Dequeuable {}\n```\n\n## Usage\n\nDequeuableRegistrable consists in three simple protocols:\n\n1. `Identifiable`: It allows to identify any kind of object by providing a key string. In case of cells, that string is the reusable identifier.\n2. `Dequeuable`: Inherits from Identifiable. It allows to dequeue cells from UICollectionView or UITableView using the reusable identifier provided by Identifiable protocol.\n3. `Registrable`: Inherits from Identifiable. It allows to register cells in UICollectionView or UITableView using the reusable identifier provided by Identifiable protocol, and a nib object that Registrable protocol requires.\n\nAll of these protocols have extensions that returns defaults values that match the class name. So, for example, if you have a `ABCCell` class, then its default reusable identifier would be `\"ABCCell\"`, and its `UINib` would be `UINib(nibName: \"ABCCell\")`\n\n## Author\n\nFernando Ortiz, ortizfernandomartin@gmail.com\n\n## License\n\nDequeuableRegistrable is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmo91%2Fdequeuableregistrable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffmo91%2Fdequeuableregistrable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmo91%2Fdequeuableregistrable/lists"}