{"id":27086593,"url":"https://github.com/benedom/autoresizingsheet","last_synced_at":"2025-06-16T14:06:45.190Z","repository":{"id":228394580,"uuid":"771523778","full_name":"benedom/AutoResizingSheet","owner":"benedom","description":"Use automagically self-resizing sheets in Swift","archived":false,"fork":false,"pushed_at":"2025-04-05T11:37:15.000Z","size":11575,"stargazers_count":14,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-09T07:55:40.149Z","etag":null,"topics":["animation","bottomsheet","ios","resizing","sheet","swift","swift-package-manager","swift5","swiftui","uikit"],"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/benedom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-13T13:07:03.000Z","updated_at":"2025-05-21T18:51:22.000Z","dependencies_parsed_at":"2024-05-02T20:55:44.064Z","dependency_job_id":null,"html_url":"https://github.com/benedom/AutoResizingSheet","commit_stats":null,"previous_names":["benedom/autoresizingsheet"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/benedom/AutoResizingSheet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedom%2FAutoResizingSheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedom%2FAutoResizingSheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedom%2FAutoResizingSheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedom%2FAutoResizingSheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benedom","download_url":"https://codeload.github.com/benedom/AutoResizingSheet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedom%2FAutoResizingSheet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260173630,"owners_count":22969866,"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":["animation","bottomsheet","ios","resizing","sheet","swift","swift-package-manager","swift5","swiftui","uikit"],"created_at":"2025-04-06T05:30:17.391Z","updated_at":"2025-06-16T14:06:45.131Z","avatar_url":"https://github.com/benedom.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AutoResizingSheet\n[![Build](https://github.com/benedom/AutoResizingSheet/actions/workflows/build-swift.yml/badge.svg?branch=master)](https://github.com/benedom/AutoResizingSheet/actions/workflows/build-swift.yml)\n[![GitHub Tag](https://img.shields.io/github/v/tag/benedom/AutoResizingSheet?include_prereleases\u0026sort=semver)](https://github.com/benedom/AutoResizingSheet/releases)\n![Static Badge](https://img.shields.io/badge/Platform%20-%20iOS%20-%20light_green)\n![Static Badge](https://img.shields.io/badge/iOS%20-%20%3E%2016.0%20-%20light_green)\n![Static Badge](https://img.shields.io/badge/Swift%20-%20%3E%205.9%20-%20orange)\n\u003ca href=\"https://github.com/benedom/AutoResizingSheet/blob/master/LICENSE.md\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/License%20-%20MIT%20-%20blue\" alt=\"License - MIT\"\u003e\n\u003c/a\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/benedom/AutoResizingSheet/blob/master/Assets/dynamicSheet.gif\" style=\"margin: auto; width: 250px\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/benedom/AutoResizingSheet/blob/master/Assets/staticSheet.gif\" style=\"margin: auto; width: 250px\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/benedom/AutoResizingSheet/blob/master/Assets/asyncSheet.gif\" style=\"margin: auto; width: 250px\"/\u003e\n\u003c/p\u003e\n\n## 🔭 Overview\nAutoResizingSheet is a SwiftPackage which allows to display sheets which will automatically resize itself with an animation when the content height changes. This is useful when the sheet fetches data, where it is not known how large the content will be.\n\nIt also works for static sheet content. The height of the sheet is calculated so it matches the content perfectly.\n\nAutoResizingSheet also solves the issue of height detents for different devices. The content in the sheet will automatically be displayed, so that it fits the current device perfectly - no more blank spaces.\n\nAutoResizingSheet can be displayed using a SwiftUI ViewModifier or presented as a UIKit ViewController. See [Usage](#🛠️-usage) for details.\n\n## 📕 Contents\n\n- [Requirements](#-requirements)\n- [Installation](#-installation)\n- [Demo App](#📱-demo-app)\n- [Usage](#-usage)\n- [Contributors](#-contributors)\n- [Author](#-author)\n- [License](#-license)\n\n## 🧳 Requirements\n\n- iOS 16.0 or later\n- Xcode 15.0 or later\n- Swift 5.9 or later\n\n\n## 💻 Installation\nThere are two ways to use AutoResizingSheet in your project:\n- using Swift Package Manager\n- manual install (embed Xcode Project)\n\n### Swift Package Manager\n\nThe [Swift Package Manager](https://swift.org/package-manager/) is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.\n\nTo integrate `AutoResizingSheet` into your Xcode project using Xcode 15.0 or later, specify it in `File \u003e Swift Packages \u003e Add Package Dependency...`:\n\n```ogdl\nhttps://github.com/benedom/AutoResizingSheet\n```\n\nYou can also specify a version instead of using the `master` branch.\n\n### Manually\n\nIf you prefer not to use any of dependency managers, you can integrate `AutoResizingSheet` into your project manually. Put `Sources/AutoResizingSheet` folder in your Xcode project. Make sure to enable `Copy items if needed` and `Create groups`.\n\n## 📱 Demo App\n\nTo get a feeling how `AutoResizingSheet` works and in what scenarios it can be used, you can run the demo app. The demo app provides multiple sheet implementations to test and also a fully configurable `AutoResizingSheetConfiguration`.\n\n## 🛠️ Usage\n\n### SwiftUI\nThis example shows how to display `AutoResizingSheet` inside a SwiftUI View:\n```swift\nimport SwiftUI\nimport UIKit\nimport AutoResizingSheet\n\nstruct ExampleView: View {\n    @State private var showSheet: Bool = false\n\n    var body: some View {\n        VStack {\n             Button(\"Show sheet\") {\n                showSheet.toggle()\n             }\n        }\n        .autoResizingSheet(\n            isPresented: $showSheet\n        ) {\n            // Your sheet content View\n            SheetContentView()\n        }\n    }\n}\n```\n\n:bangbang: NOTE :bangbang:\n```\nThe resizing will not work properly if your view is wrapped inside a ScrollView. Use scrollable of AutoResizingSheetConfiguration instead, to make the content scrollable.\n```\n\nThe viewModifier takes multiple parameters:\n\n| Paramter      | Description |\n| ----------- | ----------- |\n| `isPresented` | `Binding\u003cBool\u003e`: Binding to control the displaying of the sheet. |\n| `configuration` | `AutoResizingSheetConfiguration`: The custom configuration to use. If not set, uses default configuration. |\n| `@ViewBuilder content` | `@escaping () -\u003e Content`: The content of the sheet as a SwiftUI View. |\n\n\u003cbr\u003e\u003c/br\u003e\nYou can also configure `AutoResizingSheet` by passing a `AutoResizingSheetConfiguration`. A configuration has the following properties:\n\n| Property      | Description |\n| ----------- | ----------- |\n| `scrollable` | `Bool`: Should the content be wrapped inside a scroll view. Defaults to `true`. |\n| `showGrabber` | `Bool`: If the grabber should be shown. Defaults to `true`. |\n| `extendableToFullSize` | `Bool`: If the sheet is extendable  to full size using the grabber. Defaults to `true`, will be `false` if `showGrabber` is `false`. |\n| `scrollBackground` | `UIColor`: If scrollable, defines the background color of the `ScrollView`. Defaults to `.clear`. |\n\nCreate a configuration like this:\n```swift\nlet configuration = AutoResizingSheetConfiguration(\n    scrollable: true,\n    showGrabber: true,\n    extendableToFullSize: true,\n    scrollBackground: .clear\n)\n```\n\nand use it like this:\n\n```swift\n.autoResizingSheet(\n    isPresented: $showSheet,\n    configuration: configuration\n    ) {\n        // Your sheet content View\n        SheetContentView()\n    }\n```\n\n### UIKit\nThis example shows how to display `AutoResizingSheet` using a `UIViewController` in UIKit:\n\n```swift\nfunc showSheet() {\n    // Create the view for the sheet content\n    let sheetContentView = YourSwiftUISheetView()\n    // Present the sheet\n    yourViewController.presentViewAsAutoResizingSheet(content: sheetContentView)\n}\n```\n\nThe function takes multiple parameters:\n\n| Paramter      | Description |\n| ----------- | ----------- |\n| `content` | `@escaping () -\u003e Content`: The content of the sheet as a SwiftUI View. |\n| `configuration` | `AutoResizingSheetConfiguration`: The custom configuration to use. If not set, uses default configuration. |\n| `onDismiss` | `(() -\u003e Void)?`: A closure that is executed when the sheet is dismissed. Defaults to `nil`. |\n\nJust like using the SwiftUI ViewModifier, you can pass a `AutoResizingSheetConfiguration`.\n\n## 👨‍💻 Contributors\n\nAll issue reports, feature requests, pull requests and GitHub stars are welcomed and much appreciated.\n\n## ✍️ Author\n\nBenedikt Betz \u0026 CHECK24\n\n## 📃 License\n\n`AutoResizingSheet` is available under the MIT license. See the [LICENSE](https://github.com/benedom/SwiftyCrop/blob/master/LICENSE.md) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenedom%2Fautoresizingsheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenedom%2Fautoresizingsheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenedom%2Fautoresizingsheet/lists"}