{"id":18270071,"url":"https://github.com/carson-katri/drag-and-drop","last_synced_at":"2025-05-05T01:31:45.841Z","repository":{"id":102304868,"uuid":"204990265","full_name":"carson-katri/drag-and-drop","owner":"carson-katri","description":"Simple drag and drop for SwiftUI","archived":false,"fork":false,"pushed_at":"2019-08-28T18:56:51.000Z","size":5455,"stargazers_count":20,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-08T15:05:09.194Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/carson-katri.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":"2019-08-28T17:47:36.000Z","updated_at":"2024-09-10T11:38:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"d772cb0c-8bea-4f23-9fcd-95872e4c3b0e","html_url":"https://github.com/carson-katri/drag-and-drop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carson-katri%2Fdrag-and-drop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carson-katri%2Fdrag-and-drop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carson-katri%2Fdrag-and-drop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carson-katri%2Fdrag-and-drop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carson-katri","download_url":"https://codeload.github.com/carson-katri/drag-and-drop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252423323,"owners_count":21745570,"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":[],"created_at":"2024-11-05T11:38:16.056Z","updated_at":"2025-05-05T01:31:43.286Z","avatar_url":"https://github.com/carson-katri.png","language":"Swift","funding_links":[],"categories":["etc"],"sub_categories":[],"readme":"# Drag and Drop\n\nSimple drag and drop for SwiftUI\n\n![Sample GIF](Resources/SampleGIF.gif)\n\n## Installation\nYou can install via the Swift Package Manager:\n\n`File \u003e Swift Packages \u003e Add Package Dependency...`, then paste in `https://github.com/carson-katri/drag-and-drop`\n\n## Usage\n\nFirst, add the `DragDropManager` environment object:\n```swift\nContentView().environmentObject(DragDropManager())\n```\n\nExample:\n```swift\nVStack {\n  Text(\"Drop Here\")\n    .droppable()\n  Text(\"Drag Me\")\n    .draggable(data: myDropData)\n}\n```\n\nYou can also get the data from the drag view like so:\n```swift\nVStack {\n  DropView { data in\n    Text(data as? String ?? \"Drop Here\")\n  }\n  Text(\"Drag Me\")\n    .draggable(data: \"Hello World\")\n}\n```\n\nYou can also make the `DragView` directly:\n```swift\nDragView(myDropData) {\n  Text(\"Drag Me\")\n}\n```\n\nAnother capability is resizing the `DragView` to fit in the `DropView` automatically:\n```swift\nText(\"Drag Me\")\n  .draggable(data: \"Hello World\", resize: true)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarson-katri%2Fdrag-and-drop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarson-katri%2Fdrag-and-drop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarson-katri%2Fdrag-and-drop/lists"}