{"id":22362695,"url":"https://github.com/lawlabs/rectselectanddragdemo","last_synced_at":"2026-02-12T09:04:17.800Z","repository":{"id":265411834,"uuid":"895943176","full_name":"lawlabs/RectSelectAndDragDemo","owner":"lawlabs","description":"An educational SwiftUI demo showcasing rectangular selection, object highlighting, and drag-and-drop functionality.","archived":false,"fork":false,"pushed_at":"2024-11-30T07:20:54.000Z","size":29,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T21:09:25.723Z","etag":null,"topics":["drag-and-drop","gestures","interaction","lawlabs","legaltech","selection","swiftui"],"latest_commit_sha":null,"homepage":"https://lawlabs.ru/","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/lawlabs.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":"2024-11-29T08:27:57.000Z","updated_at":"2025-01-09T19:07:14.000Z","dependencies_parsed_at":"2024-11-29T09:40:39.032Z","dependency_job_id":null,"html_url":"https://github.com/lawlabs/RectSelectAndDragDemo","commit_stats":null,"previous_names":["lawlabs/rectselectanddragdemo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lawlabs%2FRectSelectAndDragDemo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lawlabs%2FRectSelectAndDragDemo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lawlabs%2FRectSelectAndDragDemo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lawlabs%2FRectSelectAndDragDemo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lawlabs","download_url":"https://codeload.github.com/lawlabs/RectSelectAndDragDemo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631676,"owners_count":21136562,"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":["drag-and-drop","gestures","interaction","lawlabs","legaltech","selection","swiftui"],"created_at":"2024-12-04T17:10:30.039Z","updated_at":"2026-02-12T09:04:17.791Z","avatar_url":"https://github.com/lawlabs.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftUI Rectangle Selection and Object Manipulation\n\nThis project demonstrates a simple SwiftUI-based application for selecting and manipulating objects (squares). It's designed as an educational resource, showcasing how to implement key features like rectangle selection, dragging, and updating object states dynamically.\n\n## Features\n1. **Rectangle Selection**: Click and drag to draw a selection rectangle. Any squares intersecting the rectangle are highlighted.\n2. **Drag-and-Drop**: Selected squares can be dragged to a new position by holding and moving the mouse.\n3. **Dynamic Updates**: The positions of squares update in real-time during drag-and-drop interactions.\n4. **Interactive Feedback**: Squares change color to indicate their selection status.\n\n## How to Use\n1. Clone the repository and run the project in Xcode.\n2. Drag within the green area to select squares.\n3. Drag the selected squares to move them.\n\n## Demo Screenshots\n### Initial State\n\n\u003cimg width=\"973\" alt=\"image\" src=\"https://github.com/user-attachments/assets/434339ff-75b4-426b-adf3-2d472d1e8b3e\"\u003e\n\n### Rectangle Selection\n\n\u003cimg width=\"973\" alt=\"Снимок экрана 2024-11-29 в 11 31 05\" src=\"https://github.com/user-attachments/assets/a0ace3d2-9f5f-4837-a77f-9983137a1b68\"\u003e\n\n\n### Drag-and-Drop\n\nhttps://github.com/user-attachments/assets/04fb861b-2b64-46bb-afac-224776f9d2c1\n\n\n\n## Code Overview\n- **`ContentView.swift`**: Contains all logic for selection and manipulation.\n- **`generateRandomSquares`**: Randomly generates square positions.\n- **`updateSelectedSquares`**: Updates the selection status of squares based on their intersection with the selection rectangle.\n- **`moveSelectedSquares`**: Updates the positions of selected squares after a drag operation.\n\n## Prerequisites\n- Xcode 14 or later\n- macOS 13 or later\n\n## Contributions\nFeel free to fork this repository, submit pull requests, or suggest improvements!\n\n### О проекте на русском языке  \n\nООО \"Лаборатория юридических исследований\" и АБ \"КАиП\" готовят к выпуску приложение для визуализации прохождения судебных дел по всем стадиям, включая промежуточные обжалования обеспечительных мер, определения о приостановке рассмотрения дела в связи с назначением экспертизы, определения о взыскании судебных расходов и другие процессы.  \n\nВ этом приложении графические изображения стадий можно будет выделять мышкой и оперировать выделенными стадиями:  \n- Перемещать их (например, с одного уровня инстанций на другой),  \n- Изменять даты и время,  \n- Выполнять другие действия с выбранными стадиями.  \n\nВ рамках подготовки к реализации этих возможностей мы тестируем различные подходы и техники работы с выделением и манипуляцией объектов в **SwiftUI**. Этот проект — результат одной из таких проб. Мы надеемся, что он станет полезным примером для интересующихся разработчиков.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flawlabs%2Frectselectanddragdemo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flawlabs%2Frectselectanddragdemo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flawlabs%2Frectselectanddragdemo/lists"}