{"id":2871,"url":"https://github.com/stuffrabbit/SwiftSpreadsheet","last_synced_at":"2025-08-06T16:31:46.935Z","repository":{"id":52717007,"uuid":"85993885","full_name":"stuffrabbit/SwiftSpreadsheet","owner":"stuffrabbit","description":"Spreadsheet CollectionViewLayout in Swift. Fully customizable. 🔶","archived":false,"fork":false,"pushed_at":"2019-10-15T20:14:45.000Z","size":75,"stargazers_count":637,"open_issues_count":4,"forks_count":39,"subscribers_count":17,"default_branch":"master","last_synced_at":"2023-11-20T16:07:47.738Z","etag":null,"topics":["custom","spreadsheet","swift","uicollectionview","uicollectionviewlayout"],"latest_commit_sha":null,"homepage":"","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/stuffrabbit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-23T20:21:31.000Z","updated_at":"2023-10-28T12:52:58.000Z","dependencies_parsed_at":"2022-08-22T10:01:13.637Z","dependency_job_id":null,"html_url":"https://github.com/stuffrabbit/SwiftSpreadsheet","commit_stats":null,"previous_names":[],"tags_count":4,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stuffrabbit%2FSwiftSpreadsheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stuffrabbit%2FSwiftSpreadsheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stuffrabbit%2FSwiftSpreadsheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stuffrabbit%2FSwiftSpreadsheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stuffrabbit","download_url":"https://codeload.github.com/stuffrabbit/SwiftSpreadsheet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228923723,"owners_count":17992568,"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":["custom","spreadsheet","swift","uicollectionview","uicollectionviewlayout"],"created_at":"2024-01-05T20:16:25.055Z","updated_at":"2024-12-09T16:31:11.079Z","avatar_url":"https://github.com/stuffrabbit.png","language":"Swift","funding_links":[],"categories":["UI","Libs","CollectionView","Swift","UI [🔝](#readme)"],"sub_categories":["Table View / Collection View","UI","Other free courses"],"readme":"# SwiftSpreadsheet\n\n[![Version](https://img.shields.io/cocoapods/v/SwiftSpreadsheet.svg?style=flat)](http://cocoapods.org/pods/SwiftSpreadsheet)\n[![License](https://img.shields.io/cocoapods/l/SwiftSpreadsheet.svg?style=flat)](http://cocoapods.org/pods/SwiftSpreadsheet)\n[![Platform](https://img.shields.io/cocoapods/p/SwiftSpreadsheet.svg?style=flat)](http://cocoapods.org/pods/SwiftSpreadsheet)\n\u003ca href=\"https://github.com/apple/swift-package-manager\"\u003e\u003cimg alt=\"Swift Package Manager compatible\" src=\"https://img.shields.io/badge/SPM-%E2%9C%93-brightgreen.svg?style=flat\"/\u003e\u003c/a\u003e\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Requirements\n\nSwift 5.0\n\n## Installation\n\nSwiftSpreadsheet is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"SwiftSpreadsheet\"\n```\n## Demo\n\n![Output sample](https://thumbs.gfycat.com/SilentLightheartedAmmonite-size_restricted.gif)\n\n\n## Quick start\n\nA short introduction on how to get started:\n\nThe rows of the spreadsheet represent a section in the collection view, with columns being the respective items.\nThe leftmost and the rightmost elements of the spreadsheet (`leftRowHeadline` and `rightRowHeadline`), as well as the topmost and the bottommost elements (`topColumnHeader` and `bottomColumnFooter`) are represented as `UISupplementaryView`, which — if needed — have to be registered with the respective identifiers of the provided enum `ViewKindType` (refer to the example code).\n \n The corners of the resulting spreadsheet are represented as `UIDecorationView` which can be passed as `UINib` or as `AnyClass` upon initialization of the layout. To allow more flexibilty you have to pass the given nib or class via the `DecorationViewType` enum. Its cases hold one of the respective types as associative value: `asNib(myNib)` or `asClass(myClass)`.\n\nA short example:\n\n```swift\n//Register SupplementaryViews first, then initialize the layout with optional Nibs/Classes for the DecorationViews\nlet layout = SpreadsheetLayout(delegate: self,\n                               topLeftDecorationViewType: .asNib(topLeftDecorationViewNib),\n                               topRightDecorationViewType: .asNib(topRightDecorationViewNib),\n                               bottomLeftDecorationViewType: .asClass(bottomLeftDecorationViewClass),\n                               bottomRightDecorationViewType: .asClass(bottomRightDecorationViewClass))\n\n//Default is true, set false here if you do not want some of these sides to remain sticky\nlayout.stickyLeftRowHeader = true\nlayout.stickyRightRowHeader = true\nlayout.stickyTopColumnHeader = true\nlayout.stickyBottomColumnFooter = true\n\nself.collectionView.collectionViewLayout = layout\n\n```\n\nImplement the provided `SpreadsheetLayoutDelegate`. The methods are straightforward. Simply pass `nil` wherever you do not want supplementary views to be displayed (leftmost, rightmost, topmost and bottommost).\n\n\nReload Layout:\n```swift\n//On Layout:\nlayout.resetLayoutCache()\n//Helper Method for collection view\ncollectionView.reloadDataAndSpreadsheetLayout()\n```\n\nSo in short:\n1) Register the respective objects of type `UISupplementaryView` you want to use with the provided identifiers of the enum `ViewKindType`.\n2) Create a `UINib` object for each `UIDecrationView` (corner of the Spreadsheet) and pass it upon initialization of the layout.\n3) Initialize the layout with the provided convenience initializer and pass the delegate as well as the required decoration views.\n4) Implement the `SpreadsheetLayoutDelegate`.\n5) Set the content of your cells and the supplementary views in the data source methods of your collection view.\n6) Enjoy ;)\n\n## Questions\n\nPlease refer to the demo application or contact me directly.\n\n## Author\n\nWojtek Kordylewski.\n \nindiControl GmbH owns the Copyright of the respective SwiftSpreadsheet.swift file.\n\n## License\n\nSwiftSpreadsheet 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%2Fstuffrabbit%2FSwiftSpreadsheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstuffrabbit%2FSwiftSpreadsheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstuffrabbit%2FSwiftSpreadsheet/lists"}