{"id":2467,"url":"https://github.com/ParkGwangBeom/Sheet","last_synced_at":"2025-08-06T16:31:05.304Z","repository":{"id":40605304,"uuid":"151074174","full_name":"ParkGwangBeom/Sheet","owner":"ParkGwangBeom","description":"📑 Actionsheet with navigation features such as the Flipboard App","archived":false,"fork":false,"pushed_at":"2021-10-14T06:19:41.000Z","size":6681,"stargazers_count":338,"open_issues_count":4,"forks_count":27,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-12-04T00:32:06.339Z","etag":null,"topics":["actionsheet","custom","customactionsheet","flipboard","ios","navigation","navigationactionsheet","navigationsheet","popup","sheet","transition","ui"],"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/ParkGwangBeom.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":"2018-10-01T10:57:05.000Z","updated_at":"2024-11-14T08:31:14.000Z","dependencies_parsed_at":"2022-09-04T12:01:44.473Z","dependency_job_id":null,"html_url":"https://github.com/ParkGwangBeom/Sheet","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParkGwangBeom%2FSheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParkGwangBeom%2FSheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParkGwangBeom%2FSheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParkGwangBeom%2FSheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ParkGwangBeom","download_url":"https://codeload.github.com/ParkGwangBeom/Sheet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228923678,"owners_count":17992566,"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":["actionsheet","custom","customactionsheet","flipboard","ios","navigation","navigationactionsheet","navigationsheet","popup","sheet","transition","ui"],"created_at":"2024-01-05T20:16:14.457Z","updated_at":"2024-12-09T16:30:58.971Z","avatar_url":"https://github.com/ParkGwangBeom.png","language":"Swift","funding_links":[],"categories":["UI","Libs","Swift","UI [🔝](#readme)"],"sub_categories":["Alert \u0026 Action Sheet","UI"],"readme":"\n\u003cp align=\"center\"\u003e\n   \u003cimg width=\"600\" src=\"README/main.png\" alt=\"Logo\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n   \u003ca href=\"https://developer.apple.com/swift/\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/Swift-4.0%2B-orange.svg?style=flat\" alt=\"Swift 4.0+\"\u003e\n   \u003c/a\u003e\n      \u003ca href=\"https://developer.apple.com/\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/iOS-9.0%2B-blue.svg?style=flat\" alt=\"iOS 9.0\"\u003e\n   \u003c/a\u003e\n   \u003ca href=\"http://cocoapods.org/pods/Sheet\"\u003e\n      \u003cimg src=\"https://img.shields.io/cocoapods/v/Sheet.svg?style=flat\" alt=\"Version\"\u003e\n   \u003c/a\u003e\n   \u003ca href=\"https://github.com/Carthage/Carthage\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat\" alt=\"Carthage Compatible\"\u003e\n   \u003c/a\u003e\n      \u003ca href=\"http://cocoapods.org/pods/Sheet\"\u003e\n      \u003cimg src=\"https://img.shields.io/cocoapods/p/Sheet.svg?style=flat\" alt=\"Platform\"\u003e\n   \u003c/a\u003e\n      \u003ca href=\"https://github.com/ParkGwangBeom/Sheet/blob/master/LICENSE?raw=true\"\u003e\n      \u003cimg src=\"https://img.shields.io/cocoapods/l/Sheet.svg?style=flat\" alt=\"License\"\u003e\n   \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr/\u003e\n\n\u003cp align=\"center\"\u003e\n📑 SHEET helps you easily create a wide variety of action sheets with navigation features used in the Flipboard App\n\u003c/p\u003e\n\n\u003cbr/\u003e\n\n\u003cp align=\"center\"\u003e\n   \u003cimg width=\"300\" src=\"README/example.gif\" alt=\"Example\"\u003e\n\u003c/p\u003e\n\n## Installation\n\n### CocoaPods\n```bash\npod 'Sheet', '~\u003e 0.7.0'\n```\n\n### Carthage\n```bash\ngithub \"ParkGwangBeom/Sheet\" ~\u003e 0.7.0\n```\n\n### Manually\n\nIf you prefer not to use either of the aforementioned dependency managers, you can integrate Sheet into your project manually.\n\n## Usage\n\nImplementing the contents of a Sheet is similar to implementing an existing UICollectionViewController.\nSimply make your view controller subclass of SheetContentsViewController.\n\n```\nimport Sheet\n\nclass ViewController: SheetContentsViewController {\n\n   /// Sheet visible contents height. If contentSize height is less than visibleContentsHeight, contentSize height is applied.\n    override var visibleContentsHeight: CGFloat {\n        return 600\n    }\n    \n    /// Give CollectionView a chance to regulate Supplementray Element\n    override func registCollectionElement() {\n        let nib = UINib(nibName: \"TitleHeaderView\", bundle: nil)\n        collectionView?.register(nib, forSupplementaryViewOfKind: SheetLayoutElement.header.kind, withReuseIdentifier: SheetLayoutElement.header.id)\n    }\n\n    /// Provide an opportunity to set default settings for collectionview custom layout\n    override func setupSheetLayout(_ layout: SheetContentsLayout) {\n        layout.settings.itemSize = { indexPath in\n            let height: CGFloat = indexPath.section == 0 ? 30 : 60\n            return CGSize(width: UIScreen.main.bounds.width, height: height)\n        }\n        layout.sectionInset = UIEdgeInsets(top: 0, left: 0, bottom: 15, right: 0)\n        layout.settings.headerSize = CGSize(width: UIScreen.main.bounds.width, height: 60)\n        layout.settings.isHeaderStretchy = true\n    }\n    \n   override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -\u003e Int {\n        return 10\n    }\n    \n    override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -\u003e UICollectionViewCell {\n        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: \"cell\", for: indexPath)\n         ...\n        return cell\n    }\n    \n    override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {\n         ...\n    }\n   \n     ...\n}\n```\n\nYou can use the custom action sheet transition using the default api provided by UIKit such as present, push, pop.\n\u003e 🔥 **However, do not use the dismiss of the NavigationController, but use the close (duration: completion :) function.**\n```\n// present\nlet contentsViewController = ViewController()\nlet sheetNavigation = SheetNavigationController(rootViewController: contentsViewController)\npresent(sheetNavigation, animated: true, completion: nil)\n\n// push\nlet nextContentsViewController = NextContentsViewController()\nnavigationController?.pushViewController(nextContentsViewController, animated: true)\n\n// pop\nnavigationController?.popViewController(animated: true)\n```\n**See the Example project for more details.**\n\n\n## Layout\n**Sheet** basically has Navigation structure. All children should inherit from **SheetContentsViewController**. SheetContentsViewController inherits **UICollectionViewController** by default, and its layout is like the following image. \n\n\u003cp align=\"center\"\u003e\n   \u003cimg width=\"400\" src=\"README/allLayout.png\" alt=\"layout\"\u003e\n\u003c/p\u003e\n\n**Please refer to Example Code for detailed setting of image layout.**\n\n\n## Advanced\nEasily customizable by SheetContents.\n\n### Options\n\n| Property | Type | Default Value |\n| -------- | ---  |  ---  |\n| `defaultToolBarBackgroundColor` | `UIColor` | `.black` |\n| `sheetToolBarHeight` | `CGFloat`| `50`|\n| `isSheetToolBarHidden` | `Bool` | `false`|\n| `cornerRadius` | `CGFloat` | `0`|\n| `defaultVisibleContentHeight` | `CGFloat` | `240`|\n| `dimmingViewBackgroundColor` | `UIColor` | `.black.withAlphaComponent(0.3)`|\n| `sheetBackgroundColor` | `UIColor` | `.white`|\n| `presentTransitionType` | `SheetPresentTransitionType` | `.scale`|\n\n### Layout Settings\n\n| Property | Type |\n| -------- | ---  |\n| `headerSize` | `CGSize?` |\n| `footerSize` | `CGSize?`|\n| `itemSize` | `((IndexPath) -\u003e CGSize)?` |\n| `sectionHeaderSize` | `((IndexPath) -\u003e CGSize)?` |\n| `sectionFooterSize` | `((IndexPath) -\u003e CGSize)?` |\n\n### SheetContentsViewController\n\n| Property | Type |\n| -------- | ---  |\n| `sheetToolBar` | `UIView` |\n\n| Method | Explanation |\n| -------- | ---  |\n| `func registCollectionElement()` | `Give CollectionView a chance to regulate Supplementray Element` |\n| `func setupSheetLayout()` | `Provide an opportunity to set default settings for collectionview custom layout`|\n| `func reload()` | `Help reload CollectionView and adjust the height of the content.`|\n| `func close(completion: (() -\u003e Void)? = nil)` | `Sheet Dismiss`|\n\n### Custom ToolBar\n\nThe built-in toolbar consists of a single button.\n\n| Default ToolBar |\n|------- | \n|\u003cimg src=\"README/toolbar.png\" width=\"300\"\u003e |\n\nSetting up a Custom ToolBar is very simple.\n```\nsheetToolBar = CustomToolBar()\n```\n\n## Author\n\n- GwangBeom Park ([@gwangbeom](https://github.com/ParkGwangBeom))\n\n## License\n\nSheet is released under the MIT license. See LICENSE for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FParkGwangBeom%2FSheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FParkGwangBeom%2FSheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FParkGwangBeom%2FSheet/lists"}