{"id":18421396,"url":"https://github.com/rebeloper/sharesheetview","last_synced_at":"2026-04-29T17:05:06.102Z","repository":{"id":169311230,"uuid":"333431930","full_name":"rebeloper/ShareSheetView","owner":"rebeloper","description":"📤 The missing UIActivityViewController for SwiftUI","archived":false,"fork":false,"pushed_at":"2021-01-27T14:45:11.000Z","size":13,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T11:59:34.771Z","etag":null,"topics":["share-sheet","share-sheet-button","share-sheet-view","swiftui","swiftui-uiactivityviewcontroller","uiactivityviewcontroller","uiactivityviewcontroller-swiftui"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rebeloper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-01-27T13:37:48.000Z","updated_at":"2024-04-06T20:08:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"515771b6-256e-4c7b-b911-3af15f26406b","html_url":"https://github.com/rebeloper/ShareSheetView","commit_stats":null,"previous_names":["rebeloper/sharesheetview"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rebeloper%2FShareSheetView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rebeloper%2FShareSheetView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rebeloper%2FShareSheetView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rebeloper%2FShareSheetView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rebeloper","download_url":"https://codeload.github.com/rebeloper/ShareSheetView/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710436,"owners_count":21149188,"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":["share-sheet","share-sheet-button","share-sheet-view","swiftui","swiftui-uiactivityviewcontroller","uiactivityviewcontroller","uiactivityviewcontroller-swiftui"],"created_at":"2024-11-06T04:25:31.363Z","updated_at":"2026-04-29T17:05:01.062Z","avatar_url":"https://github.com/rebeloper.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📤 ShareSheetView\n\n![swift v5.3](https://img.shields.io/badge/swift-v5.3-orange.svg)\n![platform iOS](https://img.shields.io/badge/platform-iOS-blue.svg)\n![deployment target iOS 13](https://img.shields.io/badge/deployment%20target-iOS%2013-blueviolet)\n\n**ShareSheetView** is a lightweight library that creates a `UIActivityViewController` in `SwiftUI`.\n\n## 💻 Installation\n### 📦 Swift Package Manager\nUsing \u003ca href=\"https://swift.org/package-manager/\" rel=\"nofollow\"\u003eSwift Package Manager\u003c/a\u003e, add it as a Swift Package in Xcode 11.0 or later, `select File \u003e Swift Packages \u003e Add Package Dependency...` and add the repository URL:\n```\nhttps://github.com/rebeloper/ShareSheetView.git\n```\n### ✊ Manual Installation\nDownload and include the `ShareSheetView` folder and files in your codebase.\n\n### 📲 Requirements\n- iOS 13+\n- Swift 5.3+\n\n## 👉 Import\n\nImport `ShareSheetView` into your `View`\n\n```\nimport ShareSheetView\n```\n\n## 🧳 Features\n\nHere's the list of the awesome features `ShareSheetView` has:\n- [X] `UIActivityViewController` in `SwiftUI`\n- [X] `ShareSheetButton`\n\n## 💻 How to Use\n\nHere are the ways that you can create a new `ShareSheetView`:\n\n1. Create a `@State` variable to hold the `ShareSheetView` presentation\n2. Create a `Button` that triggers a `sheet` view-modifier that has a `ShareSheetView` as its `content`\n\n```\nimport SwiftUI\nimport ShareSheetView\n\nstruct ContentView: View {\n    \n    // 1.\n    @State private var isShareSheetViewPresented = false\n    \n    var body: some View {\n        VStack(spacing: 12) {\n            \n            // 2.\n            Button(action: {\n                isShareSheetViewPresented = true\n            }, label: {\n                Text(\"Share\")\n            })\n            .sheet(isPresented: $isShareSheetViewPresented, content: {\n                ShareSheetView(activityItems: getActivityItems(), applicationActivities: getApplicationActivities(), excludedActivityTypes: getExcludedActivityTypes()) { (activityType, finished, activityItems, error) in\n                    if let error = error {\n                        print(error.localizedDescription)\n                        return\n                    }\n                    \n                    if let activityType = activityType {\n                        print(activityType)\n                    }\n                    \n                    print(finished)\n                    \n                    if let activityItems = activityItems {\n                        print(activityItems)\n                    }\n                }\n            })\n            \n            Spacer()\n        }\n        .padding()\n    }\n    \n    func getActivityItems() -\u003e [Any] {\n        return [\"Hello ShareSheetView\"]\n    }\n    \n    func getApplicationActivities() -\u003e [UIActivity]? {\n        return nil\n    }\n    \n    func getExcludedActivityTypes() -\u003e [UIActivity.ActivityType]? {\n        return [.postToFacebook]\n    }\n}\n```\n\nOr use the more convinient `ShareSheetButton`:\n\n```\nimport SwiftUI\nimport ShareSheetView\n\nstruct ContentView: View {\n    \n    var body: some View {\n        VStack(spacing: 12) {\n            \n            ShareSheetButton { () -\u003e ShareSheetView in\n                ShareSheetView(activityItems: getActivityItems())\n            } label: { () -\u003e AnyView in\n                AnyView(\n                    Image(systemName: \"square.and.arrow.up\")\n                        .resizable()\n                        .aspectRatio(contentMode: .fit)\n                        .frame(width: 32, height: 32)\n                )\n            }\n            \n            Spacer()\n        }\n        .padding()\n    }\n    \n    func getActivityItems() -\u003e [Any] {\n        return [\"Hello ShareSheetView\"]\n    }\n    \n}\n```\n\n## 🪁 Demo project\n\nFor a comprehensive Demo project check out: \n\u003ca href=\"https://github.com/rebeloper/ShareSheetViewDemo\"\u003eShareSheetViewDemo\u003c/a\u003e\n\n## ✍️ Contact\n\n\u003ca href=\"https://rebeloper.com/\"\u003erebeloper.com\u003c/a\u003e / \n\u003ca href=\"https://www.youtube.com/rebeloper/\"\u003eYouTube\u003c/a\u003e / \n\u003ca href=\"https://store.rebeloper.com/\"\u003eShop\u003c/a\u003e / \n\u003ca href=\"https://rebeloper.com/mentoring\"\u003eMentoring\u003c/a\u003e\n\n## 📃 License\n\nThe MIT License (MIT)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frebeloper%2Fsharesheetview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frebeloper%2Fsharesheetview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frebeloper%2Fsharesheetview/lists"}